Documentation ¶
Index ¶
- Constants
- type CacheConfig
- type Database
- type ForwardCache
- type LevelDB
- func (ds *LevelDB) Close() error
- func (ds *LevelDB) GetBlockJSONByHeight(height int, pre bool) ([]byte, error)
- func (ds *LevelDB) GetBlockJSONByID(bid []byte) ([]byte, error)
- func (ds *LevelDB) GetLastBlockJSON() ([]byte, error)
- func (ds *LevelDB) GetReceiptJSON(id []byte) ([]byte, error)
- func (ds *LevelDB) GetRepsJSONByHash(id []byte) ([]byte, error)
- func (ds *LevelDB) GetResultJSON(id []byte) ([]byte, error)
- func (ds *LevelDB) GetTPS() float32
- func (ds *LevelDB) GetTransactionJSON(id []byte) ([]byte, error)
- type NodeDB
- func (s *NodeDB) Close() error
- func (s *NodeDB) Do(method string, param interface{}, res interface{}) (*client.Response, error)
- func (s *NodeDB) GetBlockJSONByHeight(height int, unconfirmed bool) ([]byte, error)
- func (s *NodeDB) GetBlockJSONByID(id []byte) ([]byte, error)
- func (s *NodeDB) GetLastBlockJSON() ([]byte, error)
- func (s *NodeDB) GetReceiptJSON(id []byte) ([]byte, error)
- func (s *NodeDB) GetRepsJSONByHash(id []byte) ([]byte, error)
- func (s *NodeDB) GetResultJSON(id []byte) ([]byte, error)
- func (s *NodeDB) GetTPS() float32
- func (s *NodeDB) GetTransactionJSON(id []byte) ([]byte, error)
- type Store
- func (lc *Store) GetBlockByHeight(height int) (blockv0.Block, error)
- func (lc *Store) GetLastBlock() (blockv0.Block, error)
- func (lc *Store) GetReceipt(id []byte) (module.Receipt, error)
- func (lc *Store) GetRepsByHash(id []byte) (*blockv0.RepsList, error)
- func (lc *Store) GetResult(id []byte) (*TransactionInfo, error)
- func (lc *Store) GetTransaction(id []byte) (*blockv0.Transaction, error)
- func (lc *Store) GetVotesByHeight(height int) (*blockv0.BlockVoteList, error)
- func (lc *Store) SetReceiptParameter(dbase db.Database, rev module.Revision)
- type TransactionInfo
Constants ¶
View Source
const ( MaxTrials = 5 DelayBeforeRetry = 500 * time.Millisecond )
View Source
const GetBlockMaxDuration = time.Minute * 2
View Source
const GetBlockRetryDelay = time.Second * 2
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheConfig ¶
type Database ¶
type Database interface { GetBlockJSONByHeight(h int, unconfirmed bool) ([]byte, error) GetBlockJSONByID(id []byte) ([]byte, error) GetLastBlockJSON() ([]byte, error) GetResultJSON(id []byte) ([]byte, error) GetTransactionJSON(id []byte) ([]byte, error) GetRepsJSONByHash(id []byte) ([]byte, error) GetReceiptJSON(id []byte) ([]byte, error) GetTPS() float32 Close() error }
func NewMergedDB ¶ added in v0.9.10
func OpenLevelDB ¶
type ForwardCache ¶
type ForwardCache struct { *Store // contains filtered or unexported fields }
func NewForwardCache ¶
func NewForwardCache(store *Store, logger log.Logger, config *CacheConfig) *ForwardCache
func (*ForwardCache) GetBlockByHeight ¶
func (cs *ForwardCache) GetBlockByHeight(height int) (blockv0.Block, error)
func (*ForwardCache) GetReceipt ¶
func (cs *ForwardCache) GetReceipt(id []byte) (module.Receipt, error)
func (*ForwardCache) GetTPS ¶
func (cs *ForwardCache) GetTPS() float32
type LevelDB ¶
type LevelDB struct {
// contains filtered or unexported fields
}
func (*LevelDB) GetBlockJSONByHeight ¶
func (*LevelDB) GetLastBlockJSON ¶
type NodeDB ¶
type NodeDB struct {
// contains filtered or unexported fields
}
func (*NodeDB) GetBlockJSONByHeight ¶
func (*NodeDB) GetLastBlockJSON ¶
type Store ¶
func (*Store) GetBlockByHeight ¶
func (*Store) GetTransaction ¶
func (lc *Store) GetTransaction(id []byte) (*blockv0.Transaction, error)
func (*Store) GetVotesByHeight ¶ added in v0.9.10
func (lc *Store) GetVotesByHeight(height int) (*blockv0.BlockVoteList, error)
type TransactionInfo ¶
type TransactionInfo struct { BlockID common.HexBytes `json:"block_hash"` BlockHeight int `json:"block_height"` TxIndex common.HexInt32 `json:"tx_index"` Transaction blockv0.Transaction `json:"transaction"` Receipt json.RawMessage `json:"receipt"` Result json.RawMessage `json:"result"` }
Click to show internal directories.
Click to hide internal directories.