Documentation ¶
Index ¶
- func AddrDecode(addr string) ([]byte, error)
- func AddrEncode(txType uint8, pkey []byte) (string, error)
- func DecodeBlock(br parser.Reader) (b *models.Block, err error)
- func DecodeTx(br parser.Reader) (*models.Tx, error)
- func GetBlockReward(height uint32) uint64
- func GetFlag(db *leveldb.DB, name []byte) (bool, error)
- func GetHeight(target uint64) (h uint32)
- func GetTotalSupply(height uint32) (s uint64)
- func LoadBlock() (func(height uint32) (*models.Block, error), error)
- func LoadBlockToFile(path string, height uint32) error
- func LoadFile(fromh, toh uint32, newFn apply, argFn interface{}) error
- func LoadHeaderIndex() (lookup map[uint32]*models.BlockHeader, err error)
- func OpenIndexDb() (*leveldb.DB, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddrDecode ¶
AddrDecode accepts an encoded address (P2PKH or P2SH, human readable) returns its public key
func AddrEncode ¶
AddrEncode encodes address from pkey
func DecodeBlock ¶
DecodeBlock decodes a block
func GetBlockReward ¶
GetBlockReward returns block reward value from height
func GetTotalSupply ¶
GetSupply returns total supply from height
func LoadBlockToFile ¶
LoadBlockToFile prints block content in a file
func LoadFile ¶
LoadFile allows to traverse the blocks by height order while applying a function argFn
func LoadHeaderIndex ¶
func LoadHeaderIndex() (lookup map[uint32]*models.BlockHeader, err error)
LoadHeaderIndex constructs a map of the form map[BlockHeight] = BlockHeader. In particular, BlockHeader contains DataPos and FileNum
func OpenIndexDb ¶
OpenIndexDb gets transaction index record
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.