Documentation ¶
Index ¶
- Constants
- func FetchIPLD(tx *sqlx.Tx, cid string) ([]byte, error)
- func FetchIPLDByMhKey(tx *sqlx.Tx, mhKey string) ([]byte, error)
- func GetNodeInfo() node.Info
- func HandleZeroAddr(to common.Address) string
- func HandleZeroAddrPointer(to *common.Address) string
- func IPLDsContainBytes(iplds []ipfs.BlockModel, b []byte) bool
- func ListContainsGap(gapList []eth.DBGap, gap eth.DBGap) bool
- func ListContainsString(sss []string, s string) bool
- func MultihashKeyFromCID(c cid.Cid) string
- func MultihashKeyFromCIDString(c string) (string, error)
- func PublishIPLD(tx *sqlx.Tx, i node.Node) error
- func PublishMockIPLD(db *postgres.DB, mhKey string, mockData []byte) error
- func PublishRaw(tx *sqlx.Tx, codec, mh uint64, raw []byte) (string, error)
- func Rollback(tx *sqlx.Tx)
- func SetupDB() (*postgres.DB, error)
- func TestCID(b []byte) cid.Cid
- type ChainType
Constants ¶
const ( DefaultMaxBatchSize uint64 = 100 DefaultMaxBatchNumber int64 = 50 )
const ( ETH_NODE_ID = "ETH_NODE_ID" ETH_CLIENT_NAME = "ETH_CLIENT_NAME" ETH_GENESIS_BLOCK = "ETH_GENESIS_BLOCK" ETH_NETWORK_ID = "ETH_NETWORK_ID" ETH_CHAIN_ID = "ETH_CHAIN_ID" )
Env variables
Variables ¶
This section is empty.
Functions ¶
func FetchIPLD ¶
FetchIPLD is used to retrieve an ipld from Postgres blockstore with the provided tx and cid string
func FetchIPLDByMhKey ¶
FetchIPLDByMhKey is used to retrieve an ipld from Postgres blockstore with the provided tx and mhkey string
func GetNodeInfo ¶
GetNodeInfo returns the ethereum node info from env variables
func HandleZeroAddr ¶
HandleZeroAddr will return an empty string for a 0 value address
func HandleZeroAddrPointer ¶
HandleZeroAddrPointer will return an emtpy string for a nil address pointer
func IPLDsContainBytes ¶
func IPLDsContainBytes(iplds []ipfs.BlockModel, b []byte) bool
IPLDsContainBytes used to check if a list of strings contains a particular string
func ListContainsGap ¶
ListContainsGap used to check if a list of Gaps contains a particular Gap
func ListContainsString ¶
ListContainsString used to check if a list of strings contains a particular string
func MultihashKeyFromCID ¶
func MultihashKeyFromCID(c cid.Cid) string
MultihashKeyFromCID converts a cid into a blockstore-prefixed multihash db key string
func MultihashKeyFromCIDString ¶
MultihashKeyFromCIDString converts a cid string into a blockstore-prefixed multihash db key string
func PublishIPLD ¶
PublishIPLD is used to insert an ipld into Postgres blockstore with the provided tx
func PublishMockIPLD ¶
PublishMockIPLD writes a mhkey-data pair to the public.blocks table so that test data can FK reference the mhkey
func PublishRaw ¶
PublishRaw derives a cid from raw bytes and provided codec and multihash type, and writes it to the db tx