Documentation ¶
Index ¶
- Constants
- func FetchIPLD(tx *sqlx.Tx, cid string) ([]byte, error)
- func FetchIPLDByMhKey(tx *sqlx.Tx, mhKey string) ([]byte, error)
- func HandleZeroAddr(to common.Address) string
- func HandleZeroAddrPointer(to *common.Address) string
- func IPLDsContainBytes(iplds []models.IPLDModel, b []byte) bool
- func MultihashKeyFromCID(c cid.Cid) string
- func MultihashKeyFromCIDString(c string) (string, error)
- func NewDB(connectString string, config postgres.Config) (*sqlx.DB, error)
- func PublishIPLD(tx *sqlx.Tx, i node.Node) error
- func PublishRaw(tx *sqlx.Tx, codec, mh uint64, raw []byte) (string, error)
- func Rollback(tx *sqlx.Tx)
- func SetupDB() *sqlx.DB
- func SetupTestStateDiffIndexer(ctx context.Context, chainConfig *params.ChainConfig, genHash common.Hash) interfaces.StateDiffIndexer
- func TearDownDB(db *sqlx.DB)
- type GroupCacheConfig
- type GroupConfig
- type PoolConfig
Constants ¶
const ( DefaultMaxBatchSize uint64 = 100 DefaultMaxBatchNumber int64 = 50 GcachePoolEnabled = "GCACHE_POOL_ENABLED" GcachePoolHttpPath = "GCACHE_POOL_HTTP_PATH" GcachePoolHttpPeers = "GCACHE_POOL_HTTP_PEERS" GcacheStatedbCacheSize = "GCACHE_STATEDB_CACHE_SIZE" GcacheStatedbCacheExpiry = "GCACHE_STATEDB_CACHE_EXPIRY" GcacheStatedbLogStatsInterval = "GCACHE_STATEDB_LOG_STATS_INTERVAL" )
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 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 ¶
IPLDsContainBytes 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 PublishRaw ¶
PublishRaw derives a cid from raw bytes and provided codec and multihash type, and writes it to the db tx
func SetupTestStateDiffIndexer ¶
func SetupTestStateDiffIndexer(ctx context.Context, chainConfig *params.ChainConfig, genHash common.Hash) interfaces.StateDiffIndexer
func TearDownDB ¶
TearDownDB is used to tear down the watcher dbs after tests
Types ¶
type GroupCacheConfig ¶
type GroupCacheConfig struct { Pool PoolConfig StateDB GroupConfig }