Giter Club home page Giter Club logo

go-codec-dagpb's Introduction

go-dagpb

An implementation of the IPLD DAG-PB spec for go-ipld-prime

Use Decode(ipld.NodeAssembler, io.Reader) and Encode(ipld.Node, io.Writer) directly, or import this package to have this codec registered into the go-ipld-prime CID link loader.

Nodes encoded with this codec must conform to the DAG-PB spec. Specifically, they should have the non-optional fields shown in the DAG-PB schema:

type PBNode struct {
  Links [PBLink]
  Data optional Bytes
}

type PBLink struct {
  Hash Link
  Name optional String
  Tsize optional Int
}

Use dagpb.Type.PBNode and friends directly for strictness guarantees. Basic ipld.Nodes will need to have the appropraite fields (and no others) to successfully encode using this codec.

License & Copyright

Copyright © 2020 Protocol Labs

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

go-codec-dagpb's People

Contributors

acruikshank avatar dependabot[bot] avatar github-actions[bot] avatar ipldbot avatar marten-seemann avatar mvdan avatar ningmingxiao avatar rvagg avatar warpfork avatar web3-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232 iand

go-codec-dagpb's Issues

Replacing go-ipld-prime-proto

Hey @rvagg,

With this as the "canonical" dagpb implementation, I'd like to look at replacing go-ipld-prime-proto. At the moment, there are some elements missing that prevent me from doing this:

  1. go-codec-dagpb appears to lack support for RAW nodes as leaves a UnixFS dagpb tree structure -- this is immediately essential for Filecoin which uses raw leaves whenever it generates IPLD UnixFS V1 DAGs. I'm not sure that this makes sense as part of this library -- or alternatively as a seperate codec (dag-raw is not an actual format, but bytes as leaves of the dag is part of UnixFS v1, and it's relatively trivial to implement the loading part of this at least so that the bytes are read to a Bytes node). Maybe this should just wait for flexible byte layouts and other ADLs?
  2. go-coded-dagpb uses refmt for protobuf deserialization/serialization, while go-ipld-prime-proto uses the same code-gen'd serializers used by go-ipfs (see go-merkledag). I have two concerns about switching to refmt:
    1. I need to verify performance is comparable
    2. I need to verify refmt is 100% compatible with the generated serializers/deserializers in go-ipfs

Anyway, I am going to go ahead and update go-ipld-prime-proto to go-ipld-prime v0.7.0, but I'm hoping to work with you so that's the last update. I'd be happy to go over all the features of go-ipld-prime-proto and how they are used so we can figure out how to swap out the libraries for go-graphsync.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.