Documentation
¶
Index ¶
- Variables
- type Account
- type AccountType
- type App
- type Block
- type Indexer
- func (i *Indexer) IndexAccount(address string, blockHeight int, accountType AccountType) 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 ( // 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 Account ¶ added in v0.3.0
type Account struct {
Address string
Height int
AccountType AccountType
Balance *big.Int
BalanceDenomination string
}
Account struct handler of all account fields to be indexed
type AccountType ¶ added in v0.4.0
type AccountType string
AccountType enum of possible account types
const ( // AccountTypeNode represents node account type AccountTypeNode AccountType = "node" // AccountTypeApp represents app account type AccountTypeApp AccountType = "app" )
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) IndexAccount ¶ added in v0.3.0
func (i *Indexer) IndexAccount(address string, blockHeight int, accountType AccountType) error
IndexAccount converts account details to a known structure and saves them
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)
GetAccount(address string, options *provider.GetAccountOptions) (*provider.GetAccountOutput, 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