Documentation ¶
Index ¶
- Constants
- Variables
- func CountTransactions(db *bolt.DB) int
- func CreateBlockBucket(db *bolt.DB) error
- func CreateBlockIndexBucket(db *bolt.DB) error
- func GetBlock(db *bolt.DB, blockHash []byte) (blockData []byte, err error)
- func GetDBFileName(nodeID string) string
- func GetLashBlockHash(db *bolt.DB) (lastHash []byte, err error)
- func GetLastBlock(db *bolt.DB) (lastHash, lastBlockData []byte, err error)
- func GetTXMemPool(db *bolt.DB) ([]byte, error)
- func RemoveBlock(db *bolt.DB, blockHash []byte) error
- func SaveBlock(db *bolt.DB, blockHash, blockData []byte) error
- func SaveBlockIndex(db *bolt.DB, key, blockIndex []byte) error
- func SaveTXMemPool(db *bolt.DB, txPool []byte) error
Constants ¶
View Source
const ( BoltLastHashKey = "l" BoltFileFormat = "dotchain_%s.db" BoltBlocksBucket = "blocks" BoltUTXOBucket = "chainstate" BoltTXMemPool = "txmempool" BoltBlockIndexBucket = "blockindex" )
Variables ¶
View Source
var ErrorBlockNotFount = errors.New("Block is not found")
Functions ¶
func CountTransactions ¶
func CreateBlockIndexBucket ¶
func GetDBFileName ¶
getDBFileName get dbfile's name with NodeID like dotchain_XXXXXX.db
func SaveBlockIndex ¶
SaveBlockIndex save block index to db
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.