Documentation ¶
Overview ¶
Package config contains the config for the Scribe
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAddressLength = errors.New("invalid address length")
ErrAddressLength indicates that an invalid address length is found.
var ErrDuplicateAddress = errors.New("duplicate address")
ErrDuplicateAddress indicates that a duplicate address is found.
var ErrDuplicateChainID = errors.New("duplicate chain id")
ErrDuplicateChainID indicates that a duplicate chain ID is found.
var ErrInvalidChainID = errors.New("invalid chain id")
ErrInvalidChainID indicates that the chain ID is invalid.
var ErrRequiredField = errors.New("field is required")
ErrRequiredField indicates that a required field is missing.
Functions ¶
This section is empty.
Types ¶
type ChainConfig ¶
type ChainConfig struct { // ChainID is the ID of the chain. ChainID uint32 `yaml:"chain_id"` // RPCUrl is the URL of the chain's RPC server. RPCUrl string `yaml:"rpc_url"` // Contracts stores all the contract information for the chain. Contracts ContractConfigs `yaml:"contracts"` }
ChainConfig defines the config for a specific chain.
type Config ¶
type Config struct { // Chains stores all chain information Chains ChainConfigs `yaml:"chains"` // RefreshRate is the rate at which the scribe will refresh the last block height in seconds. RefreshRate uint `yaml:"refresh_rate"` }
Config is used to configure a Scribe instance and information about chains and contracts.
func DecodeConfig ¶
DecodeConfig parses in a config from a file.
type ContractConfig ¶
type ContractConfig struct { // Address is the address of the contract. Address string `yaml:"address"` // StartBlock is the block number to start indexing events from. StartBlock uint64 `yaml:"start_block"` }
ContractConfig defines the config for a specific contract.
type ContractConfigs ¶
type ContractConfigs []ContractConfig
ContractConfigs contains a list of ContractConfigs.