Documentation ¶
Index ¶
- Constants
- func FetchIPLD(tx *sqlx.Tx, cid string) ([]byte, error)
- func GetBtcNodeAndClient(path string) (core.Node, *rpcclient.ConnConfig)
- func GetEthNodeAndClient(path string) (core.Node, *rpc.Client, error)
- func GetIPFSPath() (string, error)
- func HandleNullAddr(to common.Address) string
- func HandleNullAddrPointer(to *common.Address) string
- func IPLDsContainBytes(iplds []ipfs.BlockModel, b []byte) bool
- func ListContainsGap(gapList []Gap, gap Gap) bool
- func ListContainsString(sss []string, s string) bool
- func MultihashKeyFromCIDString(c string) (string, 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() (*postgres.DB, error)
- func SupportedDataType(d DataType, c ChainType) (bool, error)
- type CIDIndexer
- type CIDRetriever
- type CIDsForFetching
- type CIDsForIndexing
- type ChainType
- type Cleaner
- type ClientSubscription
- type ConvertedData
- type DataType
- type Gap
- type IPFSMode
- type IPLDFetcher
- type IPLDPublisher
- type IPLDs
- type PayloadConverter
- type PayloadFetcher
- type PayloadStreamer
- type RawChainData
- type ResponseFilterer
- type SubscriptionSettings
Constants ¶
const ( IPFS_PATH = "IPFS_PATH" IPFS_MODE = "IPFS_MODE" HTTP_TIMEOUT = "HTTP_TIMEOUT" ETH_WS_PATH = "ETH_WS_PATH" ETH_HTTP_PATH = "ETH_HTTP_PATH" ETH_NODE_ID = "ETH_NODE_ID" ETH_CLIENT_NAME = "ETH_CLIENT_NAME" ETH_GENESIS_BLOCK = "ETH_GENESIS_BLOCK" ETH_NETWORK_ID = "ETH_NETWORK_ID" BTC_WS_PATH = "BTC_WS_PATH" BTC_HTTP_PATH = "BTC_HTTP_PATH" BTC_NODE_PASSWORD = "BTC_NODE_PASSWORD" BTC_NODE_USER = "BTC_NODE_USER" BTC_NODE_ID = "BTC_NODE_ID" BTC_CLIENT_NAME = "BTC_CLIENT_NAME" BTC_GENESIS_BLOCK = "BTC_GENESIS_BLOCK" BTC_NETWORK_ID = "BTC_NETWORK_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
func GetBtcNodeAndClient ¶
func GetBtcNodeAndClient(path string) (core.Node, *rpcclient.ConnConfig)
GetBtcNodeAndClient returns btc node info from path url
func GetEthNodeAndClient ¶
GetEthNodeAndClient returns eth node info and client from path url
func GetIPFSPath ¶
GetIPFSPath returns the ipfs path from the config or env variable
func HandleNullAddr ¶
HandleNullAddr will return an empty string for a a null address
func HandleNullAddrPointer ¶
HandleNullAddrPointer 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 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
Types ¶
type CIDIndexer ¶
type CIDIndexer interface {
Index(cids CIDsForIndexing) error
}
CIDIndexer indexes a CID payload in Postgres
type CIDRetriever ¶
type CIDRetriever interface { Retrieve(filter SubscriptionSettings, blockNumber int64) ([]CIDsForFetching, bool, error) RetrieveFirstBlockNumber() (int64, error) RetrieveLastBlockNumber() (int64, error) RetrieveGapsInData(validationLevel int) ([]Gap, error) }
CIDRetriever retrieves cids according to a provided filter and returns a CID wrapper
type CIDsForFetching ¶
type CIDsForFetching interface{}
type CIDsForIndexing ¶
type CIDsForIndexing interface{}
type Cleaner ¶
type Cleaner interface { Clean(rngs [][2]uint64, t DataType) error ResetValidation(rngs [][2]uint64) error }
Cleaner is for cleaning out data from the cache within the given ranges
type ClientSubscription ¶
type ClientSubscription interface { Err() <-chan error Unsubscribe() }
ClientSubscription is a general interface for chain data subscriptions
type ConvertedData ¶
type ConvertedData interface {
Height() int64
}
The concrete type underneath StreamedIPLDs should not be a pointer
type DataType ¶
type DataType int
DataType is an enum to loosely represent type of chain data
func GenerateDataTypeFromString ¶
GenerateDataTypeFromString
type IPFSMode ¶
type IPFSMode int
IPFSMode enum for specifying how we want to interface and publish objects to IPFS
func GetIPFSMode ¶
GetIPFSMode returns the ipfs mode of operation from the config or env variable
func NewIPFSMode ¶
type IPLDFetcher ¶
type IPLDFetcher interface {
Fetch(cids CIDsForFetching) (IPLDs, error)
}
IPLDFetcher uses a CID wrapper to fetch an IPLD wrapper
type IPLDPublisher ¶
type IPLDPublisher interface {
Publish(payload ConvertedData) (CIDsForIndexing, error)
}
IPLDPublisher publishes IPLD payloads and returns a CID payload for indexing
type PayloadConverter ¶
type PayloadConverter interface {
Convert(payload RawChainData) (ConvertedData, error)
}
PayloadConverter converts chain-specific payloads into IPLD payloads for publishing
type PayloadFetcher ¶
type PayloadFetcher interface {
FetchAt(blockHeights []uint64) ([]RawChainData, error)
}
PayloadFetcher fetches chain-specific payloads
type PayloadStreamer ¶
type PayloadStreamer interface {
Stream(payloadChan chan RawChainData) (ClientSubscription, error)
}
PayloadStreamer streams chain-specific payloads to the provided channel
type RawChainData ¶
type RawChainData interface{}
These types serve as very loose wrappers around a generic underlying interface{}
type ResponseFilterer ¶
type ResponseFilterer interface {
Filter(filter SubscriptionSettings, payload ConvertedData) (response IPLDs, err error)
}
ResponseFilterer applies a filter to an IPLD payload to return a subscription response packet
type SubscriptionSettings ¶
type SubscriptionSettings interface { StartingBlock() *big.Int EndingBlock() *big.Int ChainType() ChainType HistoricalData() bool HistoricalDataOnly() bool }
SubscriptionSettings is the interface every subscription filter type needs to satisfy, no matter the chain Further specifics of the underlying filter type depend on the internal needs of the types which satisfy the ResponseFilterer and CIDRetriever interfaces for a specific chain The underlying type needs to be rlp serializable