Documentation ¶
Index ¶
- Variables
- type ExecutionHistory
- type ExecutionToBlock
- type Indexer
- func (idx *Indexer) BuildIndex(blk *blockchain.Block) error
- func (idx *Indexer) GetBlockByExecution(executionHash hash.Hash32B) (hash.Hash32B, error)
- func (idx *Indexer) GetBlockByTransfer(transferHash hash.Hash32B) (hash.Hash32B, error)
- func (idx *Indexer) GetBlockByVote(voteHash hash.Hash32B) (hash.Hash32B, error)
- func (idx *Indexer) GetExecutionHistory(userAddr string) ([]hash.Hash32B, error)
- func (idx *Indexer) GetTransferHistory(userAddr string) ([]hash.Hash32B, error)
- func (idx *Indexer) GetVoteHistory(userAddr string) ([]hash.Hash32B, error)
- func (idx *Indexer) UpdateExecutionHistory(blk *blockchain.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateExecutionToBlock(blk *blockchain.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateTransferHistory(blk *blockchain.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateTransferToBlock(blk *blockchain.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateVoteHistory(blk *blockchain.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateVoteToBlock(blk *blockchain.Block, tx *sql.Tx) error
- type Server
- type TransferHistory
- type TransferToBlock
- type VoteHistory
- type VoteToBlock
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotExist indicates certain item does not exist in Blockchain database ErrNotExist = errors.New("not exist in DB") // ErrAlreadyExist indicates certain item already exists in Blockchain database ErrAlreadyExist = errors.New("already exist in DB") )
Functions ¶
This section is empty.
Types ¶
type ExecutionHistory ¶
ExecutionHistory defines the schema of "execution history" table
type ExecutionToBlock ¶
ExecutionToBlock defines the schema of "execution hash to block hash" table
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer handle the index build for blocks
func (*Indexer) BuildIndex ¶
func (idx *Indexer) BuildIndex(blk *blockchain.Block) error
BuildIndex build the index for a block
func (*Indexer) GetBlockByExecution ¶
GetBlockByExecution return block hash by execution hash
func (*Indexer) GetBlockByTransfer ¶
GetBlockByTransfer return block hash by transfer hash
func (*Indexer) GetBlockByVote ¶
GetBlockByVote return block hash by vote hash
func (*Indexer) GetExecutionHistory ¶
GetExecutionHistory get execution history
func (*Indexer) GetTransferHistory ¶
GetTransferHistory get transfer history
func (*Indexer) GetVoteHistory ¶
GetVoteHistory get vote history
func (*Indexer) UpdateExecutionHistory ¶
UpdateExecutionHistory stores execution information into execution history table
func (*Indexer) UpdateExecutionToBlock ¶
UpdateExecutionToBlock map execution hash to block hash
func (*Indexer) UpdateTransferHistory ¶
UpdateTransferHistory stores transfer information into transfer history table
func (*Indexer) UpdateTransferToBlock ¶
UpdateTransferToBlock map transfer hash to block hash
func (*Indexer) UpdateVoteHistory ¶
UpdateVoteHistory stores vote information into vote history table
func (*Indexer) UpdateVoteToBlock ¶
UpdateVoteToBlock map vote hash to block hash
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the container of the index service
func NewServer ¶
func NewServer( cfg *config.Config, bc blockchain.Blockchain, ) *Server
NewServer instantiates an index service
type TransferHistory ¶
TransferHistory defines the schema of "transfer history" table
type TransferToBlock ¶
TransferToBlock defines the schema of "transfer hash to block hash" table
type VoteHistory ¶
VoteHistory defines the schema of "vote history" table
type VoteToBlock ¶
VoteToBlock defines the schema of "vote hash to block hash" table