anconsync

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LINK_PROTO_VERSION = 1
)

Variables

View Source
var (
	DagEthCodecs map[string]uint64 = make(map[string]uint64)
)

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(hash []byte) cidlink.Link

CreateCidLink takes a hash eg ethereum hash and converts it to cid multihash

func Decode

func Decode(proto datamodel.NodePrototype, src string) (datamodel.Node, error)

func DecodeCBOR

func DecodeCBOR(proto datamodel.NodePrototype, src []byte) (datamodel.Node, error)

func Encode

func Encode(n datamodel.Node) (string, error)

func EncodeCBOR

func EncodeCBOR(n datamodel.Node) ([]byte, error)

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(hash string) (cidlink.Link, error)

ParseCidLink parses a string cid multihash into a cidLink

func ReadFromStore

func ReadFromStore(s Storage, hash string, path string) (string, error)

func ValueToJSON

func ValueToJSON(val ref.Val) string

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 Storage

type Storage struct {
	DataStore  fsstore.Store
	LinkSystem linking.LinkSystem
	RootHash   cidlink.Link
}

func NewStorage

func NewStorage(folder string) Storage

func (*Storage) InitGenesis added in v0.4.1

func (s *Storage) InitGenesis(moniker []byte)

func (*Storage) Load

func (k *Storage) Load(linkCtx ipld.LinkContext, link datamodel.Link) (datamodel.Node, error)

Load node from dag-json

func (*Storage) LoadGenesis added in v0.4.1

func (s *Storage) LoadGenesis(cid string)

func (*Storage) Store

func (k *Storage) Store(linkCtx ipld.LinkContext, node datamodel.Node) datamodel.Link

Store node as dag-json

func (*Storage) StoreDagCBOR

func (k *Storage) StoreDagCBOR(linkCtx ipld.LinkContext, node datamodel.Node) datamodel.Link

Store node as dag-cbor

func (*Storage) StoreDagEth

func (k *Storage) StoreDagEth(linkCtx ipld.LinkContext, node datamodel.Node, codecFormat string) datamodel.Link

Store node as dag-eth

func (*Storage) StoreRaw

func (k *Storage) StoreRaw(linkCtx ipld.LinkContext, node datamodel.Node) datamodel.Link

Store node as raw

Directories

Path Synopsis
codegen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL