Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More examples and getting-started code demos needed #392

Open
warpfork opened this issue Mar 24, 2022 · 2 comments
Open

More examples and getting-started code demos needed #392

warpfork opened this issue Mar 24, 2022 · 2 comments
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up

Comments

@warpfork
Copy link
Collaborator

Like it says on the tin.

Making an issue for this so we can put it on boards to remind ourselves there's work to be done here. However, there could be a lot of specific targets in this area, and I'm not sure I can enumerate them all immediately -- more issues may follow.

Some examples of room for improvement:

  • some of our big end to end example code right now has package scoped variables in it -- which don't show up well as the godoc sites render examples, and also pass state between two separate examples, making them very hard to read and very fragile
  • some of our big end to end example code has critical reliance on a side-effecting import -- also doesn't show up very well as the godoc sites render examples, so, problematic: frequently leads to users not seeing that critical bit, and being derailed for a while
  • a lot of our example code is just plain boilerplate havy
  • need more examples for how to use selectors
  • need more examples for how to use traversal package in general
  • need examples that show transcoding -- in as few SLOC as possible
  • need more examples for creating dags (e.g. using LinkSystem -- repeatedly)
  • need examples that show how to create a content-addressable storage system on disk
  • etc
@BigLep BigLep added help wanted Seeking public contribution on this issue exp/intermediate Prior experience is likely helpful P2 Medium: Good to have, but can wait until someone steps up labels May 17, 2022
@drgomesp
Copy link

Would be nice to have an example of how to create a sort of DAGService implementation using go-ipld-prime, if that's even applicable anymore, of course.

@rvagg
Copy link
Member

rvagg commented Aug 22, 2022

@drgomesp one of the difficulties with that API is that it's primarily built around the dag-pb codec, which only manages lists of links and an optional byte array. So it's relatively straightforward to model an API that "builds a DAG" by just adding and removing CIDs. Because go-ipld-prime is not tied strictly to a codec, just arbirary "nodes" in a graph that may or may not involve links, you have to bring some strong opinions about the shape of the data structure to do it.

But maybe such an example makes sense if it's strictly modelled on the dag-pb structure and can therefore be output through the dag-pb codec. Or maybe it could demonstrate a more modern form that uses dag-cbor and a HAMT. I've been working toward some "collections" style work for IPLD that are essentially large managed collections of links, with some additional nice features, maybe that'll end up being a useful example when I finally get something worth showing.. although I'm primarily working on JS with it first, so a Go form may be even more delayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/intermediate Prior experience is likely helpful help wanted Seeking public contribution on this issue P2 Medium: Good to have, but can wait until someone steps up
Projects
None yet
Development

No branches or pull requests

4 participants