Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCidLink(hash []byte) cidlink.Link
- func Decode(proto datamodel.NodePrototype, src string) (datamodel.Node, error)
- func DecodeCBOR(proto datamodel.NodePrototype, src []byte) (datamodel.Node, error)
- func Encode(n datamodel.Node) (string, error)
- func EncodeCBOR(n datamodel.Node) ([]byte, error)
- func GetDagCBORLinkPrototype() ipld.LinkPrototype
- func GetDagEthereumLinkPrototype(codec string) ipld.LinkPrototype
- func GetDagJOSELinkPrototype() ipld.LinkPrototype
- func GetDagJSONLinkPrototype() ipld.LinkPrototype
- func GetLinkPrototype() ipld.LinkPrototype
- func GetRawLinkPrototype() ipld.LinkPrototype
- func ParseCidLink(hash string) (cidlink.Link, error)
- func ReadFromStore(s Storage, hash string, path string) (string, error)
- func ValueToJSON(val ref.Val) string
- type AnconSyncContext
- type Storage
- func (s *Storage) Commit() (*pb.SaveVersionResponse, error)
- func (s *Storage) Get(path []byte, id string) ([]byte, error)
- func (s *Storage) GetCommitmentProof(key []byte, version int64) (json.RawMessage, error)
- func (s *Storage) GetTreeHash() []byte
- func (s *Storage) GetTreeHeight() int8
- func (s *Storage) GetTreeVersion() int64
- func (s *Storage) GetWithProof(key []byte) (json.RawMessage, error)
- func (s *Storage) Has(path []byte, id []byte) (bool, error)
- func (s *Storage) InitGenesis(moniker []byte)
- func (s *Storage) Iterate(path []byte, start, end []byte) (dbm.Iterator, error)
- func (k *Storage) Load(linkCtx ipld.LinkContext, link datamodel.Link) (datamodel.Node, error)
- func (s *Storage) LoadGenesis(cid string)
- func (s *Storage) Put(path []byte, id string, data []byte) (err error)
- func (s *Storage) Remove(path []byte, id string) error
- func (k *Storage) Store(linkCtx ipld.LinkContext, node datamodel.Node) datamodel.Link
- func (k *Storage) StoreDagCBOR(linkCtx ipld.LinkContext, node datamodel.Node) datamodel.Link
- func (k *Storage) StoreDagEth(linkCtx ipld.LinkContext, node datamodel.Node, codecFormat string) datamodel.Link
- func (k *Storage) StoreRaw(linkCtx ipld.LinkContext, node datamodel.Node) datamodel.Link
Constants ¶
const (
LINK_PROTO_VERSION = 1
)
Variables ¶
eth-block ipld 0x90 permanent Ethereum Header (RLP) eth-block-list ipld 0x91 permanent Ethereum Header List (RLP) eth-tx-trie ipld 0x92 permanent Ethereum Transaction Trie (Eth-Trie) eth-tx ipld 0x93 permanent Ethereum Transaction (MarshalBinary) eth-tx-receipt-trie ipld 0x94 permanent Ethereum Transaction Receipt Trie (Eth-Trie) eth-tx-receipt ipld 0x95 permanent Ethereum Transaction Receipt (MarshalBinary) eth-state-trie ipld 0x96 permanent Ethereum State Trie (Eth-Secure-Trie) eth-account-snapshot ipld 0x97 permanent Eth ereum Account Snapshot (RLP) eth-storage-trie ipld 0x98 permanent Ethereum Contract Storage Trie (Eth-Secure-Trie) eth-receipt-log-trie ipld 0x99 draft Ethereum Transaction Receipt Log Trie (Eth-Trie) eth-reciept-log ipld 0x9a draft Ethereum Transaction Receipt Log (RLP)
Functions ¶
func CreateCidLink ¶
CreateCidLink takes a hash eg ethereum hash and converts it to cid multihash
func DecodeCBOR ¶
func GetDagCBORLinkPrototype ¶
func GetDagCBORLinkPrototype() ipld.LinkPrototype
func GetDagEthereumLinkPrototype ¶
func GetDagEthereumLinkPrototype(codec string) ipld.LinkPrototype
func GetDagJOSELinkPrototype ¶
func GetDagJOSELinkPrototype() ipld.LinkPrototype
func GetDagJSONLinkPrototype ¶
func GetDagJSONLinkPrototype() ipld.LinkPrototype
func GetLinkPrototype ¶
func GetLinkPrototype() ipld.LinkPrototype
func GetRawLinkPrototype ¶
func GetRawLinkPrototype() ipld.LinkPrototype
func ParseCidLink ¶
ParseCidLink parses a string cid multihash into a cidLink
func ValueToJSON ¶
From: https://github.com/google/cel-go/blob/master/codelab/solution/codelab.go valueToJSON converts the CEL type to a protobuf JSON representation and marshals the result to a string.
Types ¶
type AnconSyncContext ¶
type AnconSyncContext struct { Store Storage Exchange graphsync.GraphExchange IPFSPeer *peer.AddrInfo PrivateKey *ecdsa.PrivateKey }
func NewAnconSyncContext ¶
func NewAnconSyncContext(s Storage, exchange graphsync.GraphExchange, ipfspeer *peer.AddrInfo) *AnconSyncContext
type Storage ¶
type Storage struct { LinkSystem linking.LinkSystem RootHash cidlink.Link // contains filtered or unexported fields }
func (*Storage) Commit ¶ added in v1.5.7
func (s *Storage) Commit() (*pb.SaveVersionResponse, error)
SaveVersion saves a new IAVL tree version to the DB based on the current state (version) of the tree. It returns a result containing the hash and new version number.
func (*Storage) GetCommitmentProof ¶ added in v1.5.7
GetCommitmentProof returns a result containing the IAVL tree version and value for a given key based on the current state (version) of the tree including a verifiable existing or not existing Commitment proof.
func (*Storage) GetTreeHash ¶ added in v1.5.7
func (*Storage) GetTreeHeight ¶ added in v1.5.7
func (*Storage) GetTreeVersion ¶ added in v1.5.7
func (*Storage) GetWithProof ¶ added in v1.5.7
func (s *Storage) GetWithProof(key []byte) (json.RawMessage, error)
GetWithProof returns a result containing the IAVL tree version and value for a given key based on the current state (version) of the tree including a verifiable Merkle proof.
func (*Storage) InitGenesis ¶
func (*Storage) LoadGenesis ¶
func (*Storage) StoreDagCBOR ¶
Store node as dag-cbor