forked from cerc-io/ipld-eth-server
24bc83a448
* Add block categorization (is_final=) * Add godo task for vulcanizeDB (Example of how everything could work together) * Add unique constraint on block_number and node * Add index on block_id for transactions_table * Add node_id index on blocks table * Sort transactions returned from FindBlock by tx_hash * lowercase tx_to, tx_from like etherscan
22 lines
642 B
Go
22 lines
642 B
Go
package repositories
|
|
|
|
import "github.com/8thlight/vulcanizedb/pkg/core"
|
|
|
|
const (
|
|
blocksFromHeadBeforeFinal = 20
|
|
)
|
|
|
|
type Repository interface {
|
|
CreateOrUpdateBlock(block core.Block) error
|
|
BlockCount() int
|
|
FindBlockByNumber(blockNumber int64) (core.Block, error)
|
|
MaxBlockNumber() int64
|
|
MissingBlockNumbers(startingBlockNumber int64, endingBlockNumber int64) []int64
|
|
CreateContract(contract core.Contract) error
|
|
ContractExists(contractHash string) bool
|
|
FindContract(contractHash string) (core.Contract, error)
|
|
CreateLogs(log []core.Log) error
|
|
FindLogs(address string, blockNumber int64) []core.Log
|
|
SetBlocksStatus(chainHead int64)
|
|
}
|