Skip to content

proofzero-legacy/go-ipld-linkstore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-ipld-linkstore

Go Reference Go Go Report Card build matrix Slack

A small module that makes IPLD LinkSystems (newer, "prime node" architecture) easy to use with carfiles and other, older modules that use the legacy "format node" architecture.

Install

At a shell within your go module:

go get github.com/proofzero/go-ipld-linkstore

Build Instructions

go build

Usage

Pseudo-golang for quickly and easily writing a v1 carfile full of prime nodes:

sls := NewStorageLinkSystemWithNewStorage(cidlink.DefaultLinkSystem())
cid := sls.MustStore(myLinkContext, myLinkPrototype, myPrimeNode)
car := carv1.NewSelectiveCar(context.Background(),
    sls.ReadStore, // <- special sauce block format access to prime nodes.
    []carv1.Dag{{
        // CID of the root node of the DAG to traverse.
        Root: cid.(cidlink.Link).Cid,
        // Traversal convenience selector that gives us "everything".
        Selector: everything(),
    }})
file, _ := os.Create("myV1Carfile.v1.car")
car.Write(file)

An attempt has been made to over-comment the code. See especially example_test.go.

Testing

go test

Contribute

We would appreciate your help to make this a useful utility. For code contributions, please send a pull request. First outlining your proposed change in an issue or discussion thread to get feedback from other developers is a good idea for anything but small changes. Other ways to contribute include:

  • making a feature request
  • reporting a bug
  • writing a test
  • adding some documentation
  • providing feedback on the project direction
  • reporting your experience using it

For most things we will use GitHub issues and discussions, but feel free to join the project Matrix room to chat or ask questions.

About

An IPLD LinkSystem that provides block format support for prime node APIs (primarily carfiles).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages