Documentation
¶
Overview ¶
Package indexer has the functions to get node values from a node and save them with a Writer interface
Index ¶
- Variables
- type Account
- type App
- type Block
- type Indexer
- func (i *Indexer) IndexAccounts(blockHeight int) ([]string, error)
- func (i *Indexer) IndexBlock(blockHeight int) error
- func (i *Indexer) IndexBlockApps(blockHeight int) ([]string, error)
- func (i *Indexer) IndexBlockNodes(blockHeight int) ([]string, error)
- func (i *Indexer) IndexBlockTransactions(blockHeight int) error
- type Node
- type Provider
- type Transaction
- type Writer
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBlockHasNoHash error when block hash no hash ErrBlockHasNoHash = errors.New("block to index has no hash") )
var ( // ErrNoAccountsToIndex error when there are no accounts to index ErrNoAccountsToIndex = errors.New("no accounts to index") )
var ( // ErrNoAppsToIndex error when there are no apps to index ErrNoAppsToIndex = errors.New("no apps to index") )
var ( // ErrNoNodesToIndex error when there are no nodes to index ErrNoNodesToIndex = errors.New("no nodes to index") )
var ( // ErrNoTransactionsToIndex error when there are no transactions to index ErrNoTransactionsToIndex = errors.New("no transactions to index") )
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
Hash string
Height int
Time time.Time
ProposerAddress string
TXCount int
TXTotal int
}
Block struct handler of all block fields to be indexed
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer struct handler for Indexer functions
func NewIndexer ¶
NewIndexer returns Indexer instance with given input
func (*Indexer) IndexAccounts ¶ added in v0.5.0
IndexAccounts converts accounts details to known structures and saved them returns all addresses indexed
func (*Indexer) IndexBlock ¶
IndexBlock converts block details to a known structure and saves them
func (*Indexer) IndexBlockApps ¶ added in v0.3.0
IndexBlockApps converts apps details to known structures and saved them returns all addresses indexed
func (*Indexer) IndexBlockNodes ¶ added in v0.3.0
IndexBlockNodes converts nodes details to known structures and saves them returns all addresses indexed
func (*Indexer) IndexBlockTransactions ¶
IndexBlockTransactions converts block transactions to a known structure and saves them
type Node ¶ added in v0.3.0
type Node struct {
Address string
Height int
Jailed bool
PublicKey string
ServiceURL string
Tokens *big.Int
}
Node struct handler of all node fields to be indexed
type Provider ¶
type Provider interface {
GetBlock(blockNumber int) (*provider.GetBlockOutput, error)
GetBlockTransactions(options *provider.GetBlockTransactionsOptions) (*provider.GetBlockTransactionsOutput, error)
GetAccounts(options *provider.GetAccountsOptions) (*provider.GetAccountsOutput, error)
GetNodes(options *provider.GetNodesOptions) (*provider.GetNodesOutput, error)
GetApps(options *provider.GetAppsOptions) (*provider.GetAppsOutput, error)
}
Provider interface of needed provider functions
type Transaction ¶
type Transaction struct {
Hash string
FromAddress string
ToAddress string
AppPubKey string
Blockchains []string
MessageType string
Height int
Index int
StdTx *provider.StdTx
TxResult *provider.TxResult
Tx string
Entropy int
Fee int
FeeDenomination string
Amount *big.Int
}
Transaction struct handler of all transaction fields to be indexed
Directories
¶
| Path | Synopsis |
|---|---|
|
Package postgresdriver is the implementation of Writer interface for the Indexer using postgres SQL as persistance
|
Package postgresdriver is the implementation of Writer interface for the Indexer using postgres SQL as persistance |