Documentation ¶
Index ¶
- Variables
- func BackFillChains(ctx context.Context, Clients map[string]*ethclient.Client, mode string)
- func BackfillChainPersister(ctx context.Context, chain string) error
- func ChainPersister(ctx context.Context, chain string) error
- func CleanShutdownWithError(err error, message string)
- func GetTokenIDsForContract(contract string, chain string) []int64
- func HandleGetCurrentHoldersOfContract(w http.ResponseWriter, r *http.Request)
- func HandleGetTokenIDsByContract(w http.ResponseWriter, r *http.Request)
- func HandleGetTransactionByID(w http.ResponseWriter, r *http.Request)
- func HandleGetTransactionsByContract(w http.ResponseWriter, r *http.Request)
- func HandleGetTransactionsReceivedByAddress(w http.ResponseWriter, r *http.Request)
- func HandleGetTransactionsSentFromAddress(w http.ResponseWriter, r *http.Request)
- func IndexChains(ctx context.Context, Clients map[string]*ethclient.Client, mode string)
- func IndexTx(chain string, tx types.Transaction, blockData string) error
- func PersistLastChecked(chain string) error
- func PersistLastCheckedBackfill(chain string) error
- func Rescheduler(ctx context.Context, chain string)
- func TokenIDFromTransaction(c *ethclient.Client, r *types.Receipt) (*big.Int, error)
- type BlockJob
- type ChainState
- type ChainStateBackfill
- func (b *ChainStateBackfill) Get() *ChainStateBackfill
- func (b *ChainStateBackfill) GetLastCheckedBlock() uint64
- func (cs *ChainStateBackfill) GetLastSoftCheckedBlock() uint64
- func (b *ChainStateBackfill) UpdateLastCheckedBlock() error
- func (cs *ChainStateBackfill) UpdateLocalLastCheckedBlock() error
- type ContractHolder
- type IndexJob
- type Transaction
- func GetTransactionByID(chain string, txid string, cached bool) []Transaction
- func GetTransactionsByContract(contract string, chain string, tokenID int64) []Transaction
- func GetTransactionsByContractPager(contract string, chain string, tokenID int64, cached bool, page int, ...) []Transaction
- func GetTransactionsReceivedByAddress(address string, chain string, page int, pageSize int, order string) []Transaction
- func GetTransactionsSentFromAddress(address string, chain string, page int, pageSize int, order string) []Transaction
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BackFillChains ¶
BackFillChains indexes all txs in all blocks per chain
func CleanShutdownWithError ¶
func GetTokenIDsForContract ¶
func HandleGetCurrentHoldersOfContract ¶
func HandleGetCurrentHoldersOfContract(w http.ResponseWriter, r *http.Request)
func HandleGetTokenIDsByContract ¶
func HandleGetTokenIDsByContract(w http.ResponseWriter, r *http.Request)
func HandleGetTransactionByID ¶
func HandleGetTransactionByID(w http.ResponseWriter, r *http.Request)
func HandleGetTransactionsByContract ¶
func HandleGetTransactionsByContract(w http.ResponseWriter, r *http.Request)
HandleGetTransactionsByContract returns all transactions for a contract
func HandleGetTransactionsReceivedByAddress ¶
func HandleGetTransactionsReceivedByAddress(w http.ResponseWriter, r *http.Request)
HandleGetTransactionsReceivedByAddress returns all transactions received by an address
func HandleGetTransactionsSentFromAddress ¶
func HandleGetTransactionsSentFromAddress(w http.ResponseWriter, r *http.Request)
HandleGetTransactionsSentFromAddress returns all transactions received by an address
func IndexChains ¶
IndexChains indexes all txs in all blocks per chain
func PersistLastChecked ¶
func Rescheduler ¶
Types ¶
type ChainState ¶
type ChainState struct { gorm.Model ChainID string `gorm:"uniqueIndex,not null"` LastCheckedBlock uint64 }
ChainState contains the index state of the chain
func (*ChainState) GetLastCheckedBlock ¶
func (cs *ChainState) GetLastCheckedBlock() uint64
GetLastCheckedBlock returns the last checked block number for the defined chain
func (*ChainState) GetLastSoftCheckedBlock ¶
func (cs *ChainState) GetLastSoftCheckedBlock() uint64
GetLastSoftCheckedBlock returns the last checked block number for the defined chain from either the database or queue, optimistically assuming that the queue will be worked
func (*ChainState) IncrementLastCheckedBlock ¶
func (cs *ChainState) IncrementLastCheckedBlock() error
IncrementLastCheckedBlock sets the last checked block number for the defined chain if it is larger than current
func (*ChainState) IncrementLocalLastCheckedBlock ¶
func (cs *ChainState) IncrementLocalLastCheckedBlock() error
IncrementLocalLastCheckedBlock sets the last checked block number for the defined chain if it is larger than current
func (*ChainState) UpdateLastCheckedBlock ¶
func (cs *ChainState) UpdateLastCheckedBlock()
UpdateLastCheckedBlock sets the last checked block number for the defined chain
type ChainStateBackfill ¶
type ChainStateBackfill struct { gorm.Model ChainID string `gorm:"uniqueIndex,not null"` EndBlock uint64 LastCheckedBlock uint64 }
ChainStateBackfill contains the index state of the chain
func (*ChainStateBackfill) Get ¶
func (b *ChainStateBackfill) Get() *ChainStateBackfill
func (*ChainStateBackfill) GetLastCheckedBlock ¶
func (b *ChainStateBackfill) GetLastCheckedBlock() uint64
GetLastCheckedBlock returns the last checked block number for the defined chain
func (*ChainStateBackfill) GetLastSoftCheckedBlock ¶
func (cs *ChainStateBackfill) GetLastSoftCheckedBlock() uint64
GetLastSoftCheckedBlock returns the last checked block number for the defined chain from either the database or queue, optimistically assuming that the queue will be worked
func (*ChainStateBackfill) UpdateLastCheckedBlock ¶
func (b *ChainStateBackfill) UpdateLastCheckedBlock() error
UpdateLastCheckedBlock sets the last checked block number for the defined chain
func (*ChainStateBackfill) UpdateLocalLastCheckedBlock ¶
func (cs *ChainStateBackfill) UpdateLocalLastCheckedBlock() error
UpdateLocalLastCheckedBlock sets the last checked block number for the defined chain if it is larger than current
type ContractHolder ¶
type ContractHolder struct { Address string `json:"address"` SenderAddress string `json:"-"` Value uint64 `json:"value"` TokenIDs []int64 `json:"token_ids"` }
ContractHolder is a holder of a contract
func GetCurrentHoldersOfContract ¶
func GetCurrentHoldersOfContract(contract string, chain string, tokenID int64) ([]*ContractHolder, error)
type IndexJob ¶
type IndexJob struct { Chain string BlockData string Transaction *types.Transaction }
IndexJob contains a single transaction index job
type Transaction ¶
type Transaction struct { gorm.Model Time int64 ChainHash string `gorm:"uniqueIndex,not null"` ChainID string `` /* 169-byte string literal not displayed */ Status uint64 `gorm:"type:numeric"` BlockNumber int64 Hash string `gorm:"uniqueIndex:idx_chain_id_addrs;uniqueIndex:idx_chain_id_contract_to_addr"` ToAddr string `gorm:"uniqueIndex:idx_chain_id_addrs;index:idx_chain_id_contract_addr2;index:idx_chain_id_to_addr"` FromAddr string `gorm:"uniqueIndex:idx_chain_id_addrs;index:idx_chain_id_from_addr"` Value int64 Gas int64 GasPrice int64 ContractToAddr string `gorm:"uniqueIndex:idx_chain_id_addrs;uniqueIndex:idx_chain_id_contract_to_addr;index:idx_chain_id_contract_addr2"` ContractValue uint64 `gorm:"type:numeric"` ContractTokenID int64 Data []byte `json:"-" gorm:"-"` }
Transaction represents a single indexed transaction
func GetTransactionByID ¶
func GetTransactionByID(chain string, txid string, cached bool) []Transaction
GetTransactionByID returns all transactions for an ID
func GetTransactionsByContract ¶
func GetTransactionsByContract(contract string, chain string, tokenID int64) []Transaction
GetTransactionsByContract returns all transactions for a contract
func GetTransactionsByContractPager ¶
func GetTransactionsByContractPager(contract string, chain string, tokenID int64, cached bool, page int, pageSize int) []Transaction
GetTransactionsByContractPager returns all transactions for a contract
func GetTransactionsReceivedByAddress ¶
func GetTransactionsReceivedByAddress(address string, chain string, page int, pageSize int, order string) []Transaction
GetTransactionsReceivedByAddress returns all transactions for a contract
func GetTransactionsSentFromAddress ¶
func GetTransactionsSentFromAddress(address string, chain string, page int, pageSize int, order string) []Transaction
GetTransactionsSentFromAddress returns all transactions for a contract
func (*Transaction) Index ¶
func (t *Transaction) Index() error
Index indexes the transactions in the given block