Documentation ¶
Index ¶
- Variables
- type ActionHistory
- type ActionToBlock
- type ExecutionHistory
- type ExecutionToBlock
- type Indexer
- func (idx *Indexer) BuildIndex(blk *block.Block) error
- func (idx *Indexer) CreateTablesIfNotExist() error
- func (idx *Indexer) GetActionHistory(userAddr string) ([]hash.Hash32B, error)
- func (idx *Indexer) GetBlockByAction(actionHash hash.Hash32B) (hash.Hash32B, 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) HandleBlock(blk *block.Block) error
- func (idx *Indexer) UpdateActionHistory(blk *block.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateActionToBlock(blk *block.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateExecutionHistory(blk *block.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateExecutionToBlock(blk *block.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateTransferHistory(blk *block.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateTransferToBlock(blk *block.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateVoteHistory(blk *block.Block, tx *sql.Tx) error
- func (idx *Indexer) UpdateVoteToBlock(blk *block.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 ActionHistory ¶
ActionHistory defines the schema of "action history" table
type ActionToBlock ¶
ActionToBlock defines the schema of "action hash to block hash" table
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 handles the index build for blocks
func (*Indexer) BuildIndex ¶
BuildIndex builds the index for a block
func (*Indexer) CreateTablesIfNotExist ¶
CreateTablesIfNotExist creates tables in local database
func (*Indexer) GetActionHistory ¶
GetActionHistory gets action history
func (*Indexer) GetBlockByAction ¶
GetBlockByAction returns block hash by action hash
func (*Indexer) GetBlockByExecution ¶
GetBlockByExecution returns block hash by execution hash
func (*Indexer) GetBlockByTransfer ¶
GetBlockByTransfer returns block hash by transfer hash
func (*Indexer) GetBlockByVote ¶
GetBlockByVote returns block hash by vote hash
func (*Indexer) GetExecutionHistory ¶
GetExecutionHistory gets execution history
func (*Indexer) GetTransferHistory ¶
GetTransferHistory gets transfer history
func (*Indexer) GetVoteHistory ¶
GetVoteHistory gets vote history
func (*Indexer) HandleBlock ¶
HandleBlock is an implementation of interface BlockCreationSubscriber
func (*Indexer) UpdateActionHistory ¶
UpdateActionHistory stores action information into action history table
func (*Indexer) UpdateActionToBlock ¶
UpdateActionToBlock maps action hash to block hash
func (*Indexer) UpdateExecutionHistory ¶
UpdateExecutionHistory stores execution information into execution history table
func (*Indexer) UpdateExecutionToBlock ¶
UpdateExecutionToBlock maps execution hash to block hash
func (*Indexer) UpdateTransferHistory ¶
UpdateTransferHistory stores transfer information into transfer history table
func (*Indexer) UpdateTransferToBlock ¶
UpdateTransferToBlock maps transfer hash to block hash
func (*Indexer) UpdateVoteHistory ¶
UpdateVoteHistory stores vote information into vote history table
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