Documentation
¶
Index ¶
Constants ¶
View Source
const ( SYNC_WORKERS = "SYNC_WORKERS" SYNC_MAX_IDLE_CONNECTIONS = "SYNC_MAX_IDLE_CONNECTIONS" SYNC_MAX_OPEN_CONNECTIONS = "SYNC_MAX_OPEN_CONNECTIONS" SYNC_MAX_CONN_LIFETIME = "SYNC_MAX_CONN_LIFETIME" )
Env variables
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DB *postgres.DB
DBConfig postgres.Config
Workers int64
WSClient *rpc.Client
NodeInfo node.Info
}
Config struct
type Indexer ¶
type Indexer interface {
// APIs(), Protocols(), Start() and Stop()
ethnode.Lifecycle
APIs() []rpc.API
Protocols() []p2p.Protocol
// Data processing event loop
Sync(wg *sync.WaitGroup) error
// Method to access chain type
Chain() shared.ChainType
}
Indexer is the top level interface for streaming, converting to IPLDs, publishing, and indexing all chain data at head This service is compatible with the Ethereum service interface (node.Service)
func NewIndexerService ¶
NewIndexer creates a new Indexer using an underlying Service struct
type Service ¶
type Service struct {
// Interface for streaming payloads over an rpc subscription
Streamer eth.Streamer
// Interface for transforming raw payloads into IPLD object models in Postgres
Transformer eth.Transformer
// Chan the processor uses to subscribe to payloads from the Streamer
PayloadChan chan statediff.Payload
// Used to signal shutdown of the service
QuitChan chan bool
// Number of sync workers
Workers int64
// chain type for this service
ChainConfig *params.ChainConfig
}
Service is the underlying struct for the indexer
func (*Service) Start ¶
Start is used to begin the service This is mostly just to satisfy the node.Service interface
Click to show internal directories.
Click to hide internal directories.