storage

package
v0.0.0-...-65a0283 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Symbol   string `json:"symbol"`
	User     string `json:"user"`
	Password string `json:"password"`
	Database string `json:"database"`
	Address  string `json:"address"`
}

func (*Config) ConnectionString

func (c *Config) ConnectionString() string

type MongoDB

type MongoDB struct {
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(cfg *Config) (*MongoDB, error)

func (*MongoDB) AccountsByBalance

func (m *MongoDB) AccountsByBalance(limit int64) (map[string]interface{}, error)

func (*MongoDB) AccountsByLastSeen

func (m *MongoDB) AccountsByLastSeen(limit int64) (map[string]interface{}, error)

func (*MongoDB) AddAccount

func (m *MongoDB) AddAccount(a *models.Account) error

func (*MongoDB) AddBlock

func (m *MongoDB) AddBlock(b *models.Block) error

func (*MongoDB) AddContractCall

func (m *MongoDB) AddContractCall(tx *models.Transaction) error

func (*MongoDB) AddDeployedContract

func (m *MongoDB) AddDeployedContract(tx *models.Transaction) error

func (*MongoDB) AddEnodes

func (m *MongoDB) AddEnodes(e *models.Enode) error

func (*MongoDB) AddForkedBlock

func (m *MongoDB) AddForkedBlock(b *models.Block) error

func (*MongoDB) AddInternalTransaction

func (m *MongoDB) AddInternalTransaction(itxn *models.ITransaction) error

func (*MongoDB) AddMultiSeriesChart

func (m *MongoDB) AddMultiSeriesChart(name string, series map[string]map[string]uint, stamps []string) error

func (*MongoDB) AddNumberChart

func (m *MongoDB) AddNumberChart(name string, series []uint64, stamps []string) error

func (*MongoDB) AddNumberStringChart

func (m *MongoDB) AddNumberStringChart(name string, series []string, stamps []string) error

func (*MongoDB) AddTokenTransfer

func (m *MongoDB) AddTokenTransfer(tt *models.TokenTransfer) error

func (*MongoDB) AddTransaction

func (m *MongoDB) AddTransaction(tx *models.Transaction) error

func (*MongoDB) AddUncle

func (m *MongoDB) AddUncle(u *models.Uncle) error

func (*MongoDB) BlockByHash

func (m *MongoDB) BlockByHash(hash string) (models.Block, error)

func (*MongoDB) BlockByNumber

func (m *MongoDB) BlockByNumber(number uint64) (models.Block, error)

func (*MongoDB) C

func (m *MongoDB) C(coll string) *mongo.Collection

func (*MongoDB) ContractTransferCount

func (m *MongoDB) ContractTransferCount(address string) (int64, error)

func (*MongoDB) ForkedBlockByNumber

func (m *MongoDB) ForkedBlockByNumber(number uint64) (models.Block, error)

func (*MongoDB) GetMultiSeriesChart

func (m *MongoDB) GetMultiSeriesChart(name string, limit int) (models.MultiSeriesChart, error)

func (*MongoDB) GetNumberChart

func (m *MongoDB) GetNumberChart(name string, limit int) (models.NumberChart, error)

func (*MongoDB) GetNumberStringChart

func (m *MongoDB) GetNumberStringChart(name string, limit int) (models.NumberStringChart, error)

func (*MongoDB) ITxnCount

func (m *MongoDB) ITxnCount(address string) (int64, error)

func (*MongoDB) Init

func (m *MongoDB) Init(rpc *rpc.RPCClient)

func (*MongoDB) IsEnodePresent

func (m *MongoDB) IsEnodePresent(id string) bool

func (*MongoDB) IsFirstRun

func (m *MongoDB) IsFirstRun() bool

func (*MongoDB) IterBlocks

func (m *MongoDB) IterBlocks(from, to int64) (*mongo.Cursor, error)

func (*MongoDB) IterForkedBlocks

func (m *MongoDB) IterForkedBlocks(from, to int64) (*mongo.Cursor, error)

func (*MongoDB) IterTokenTransfers

func (m *MongoDB) IterTokenTransfers(from, to int64) (*mongo.Cursor, error)

func (*MongoDB) IterTransactions

func (m *MongoDB) IterTransactions(from, to int64) (*mongo.Cursor, error)

func (*MongoDB) IterUncles

func (m *MongoDB) IterUncles(from, to int64) (*mongo.Cursor, error)

func (*MongoDB) LatestBlock

func (m *MongoDB) LatestBlock() (models.Block, error)

func (*MongoDB) LatestBlocks

func (m *MongoDB) LatestBlocks(limit int64) (map[string]interface{}, error)

func (*MongoDB) LatestContractCalls

func (m *MongoDB) LatestContractCalls(limit int64) (map[string]interface{}, error)

func (*MongoDB) LatestContractsDeployed

func (m *MongoDB) LatestContractsDeployed(limit int64) (map[string]interface{}, error)

func (*MongoDB) LatestFailedTransactions

func (m *MongoDB) LatestFailedTransactions(limit int64) (map[string]interface{}, error)

func (*MongoDB) LatestForkedBlocks

func (m *MongoDB) LatestForkedBlocks(limit int64) (map[string]interface{}, error)

func (*MongoDB) LatestITransactionsByAccount

func (m *MongoDB) LatestITransactionsByAccount(hash string) (map[string]interface{}, error)

func (*MongoDB) LatestMinedBlocks

func (m *MongoDB) LatestMinedBlocks(account string, limit int64) (map[string]interface{}, error)

func (*MongoDB) LatestTokenTransfers

func (m *MongoDB) LatestTokenTransfers(limit int64) (map[string]interface{}, error)

func (*MongoDB) LatestTokenTransfersByAccount

func (m *MongoDB) LatestTokenTransfersByAccount(account string) (map[string]interface{}, error)

func (*MongoDB) LatestTransactions

func (m *MongoDB) LatestTransactions(limit int64) (map[string]interface{}, error)

func (*MongoDB) LatestTransactionsByAccount

func (m *MongoDB) LatestTransactionsByAccount(hash string) (map[string]interface{}, error)

func (*MongoDB) LatestTransfersOfToken

func (m *MongoDB) LatestTransfersOfToken(hash string) (map[string]interface{}, error)

func (*MongoDB) LatestTxHashes

func (m *MongoDB) LatestTxHashes(n int, startBlock uint64) ([]string, []int64, error)

TODO: refactor this to accept a param which will be the block number from which to start syncing forward; invert the sorting; when one of these is done store the reached block in sysstore

func (*MongoDB) LatestTxTrace

func (m *MongoDB) LatestTxTrace() (models.ITransaction, error)

func (*MongoDB) LatestUncles

func (m *MongoDB) LatestUncles(limit int64) (map[string]interface{}, error)

func (*MongoDB) ListCharts

func (m *MongoDB) ListCharts() ([]string, error)

func (*MongoDB) Ping

func (m *MongoDB) Ping() error

func (*MongoDB) PurgeBlock

func (m *MongoDB) PurgeBlock(height uint64) error

func (*MongoDB) Status

func (m *MongoDB) Status() (models.Store, error)

func (*MongoDB) TokenTransfersByAccount

func (m *MongoDB) TokenTransfersByAccount(account string) ([]models.TokenTransfer, error)

func (*MongoDB) TokenTransfersByAccountCount

func (m *MongoDB) TokenTransfersByAccountCount(account string) (int64, error)

func (*MongoDB) TotalAccountCount

func (m *MongoDB) TotalAccountCount() (int64, error)

func (*MongoDB) TotalBlockCount

func (m *MongoDB) TotalBlockCount() (int64, error)

func (*MongoDB) TotalContractCallsCount

func (m *MongoDB) TotalContractCallsCount() (int64, error)

func (*MongoDB) TotalContractsDeployedCount

func (m *MongoDB) TotalContractsDeployedCount() (int64, error)

func (*MongoDB) TotalForkedBlockCount

func (m *MongoDB) TotalForkedBlockCount() (int64, error)

func (*MongoDB) TotalTransferCount

func (m *MongoDB) TotalTransferCount() (int64, error)

func (*MongoDB) TotalTxnCount

func (m *MongoDB) TotalTxnCount() (int64, error)

func (*MongoDB) TotalUncleCount

func (m *MongoDB) TotalUncleCount() (int64, error)

func (*MongoDB) TransactionByContractAddress

func (m *MongoDB) TransactionByContractAddress(address string) (models.Transaction, error)

func (*MongoDB) TransactionByHash

func (m *MongoDB) TransactionByHash(hash string) (models.Transaction, error)

Transactions

func (*MongoDB) TransactionsByBlockNumber

func (m *MongoDB) TransactionsByBlockNumber(number uint64) ([]models.Transaction, error)

func (*MongoDB) TransfersByContract

func (m *MongoDB) TransfersByContract(address string) ([]models.TokenTransfer, error)

func (*MongoDB) TransfersOfTokenByAccount

func (m *MongoDB) TransfersOfTokenByAccount(token string, account string) ([]models.TokenTransfer, error)

func (*MongoDB) TransfersOfTokenByAccountCount

func (m *MongoDB) TransfersOfTokenByAccountCount(token string, account string) (int64, error)

func (*MongoDB) TxTrace

func (m *MongoDB) TxTrace(hash string) (models.ITransaction, error)

func (*MongoDB) TxnCount

func (m *MongoDB) TxnCount(address string) (int64, error)

func (*MongoDB) UncleByHash

func (m *MongoDB) UncleByHash(hash string) (models.Uncle, error)

func (*MongoDB) UpdateStore

func (m *MongoDB) UpdateStore() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL