各组件配置

blockchainconfig codes:

type BlockchainConf struct {
	ChainDB         SqlDbConf `toml:"chain_db"`
}
  • ChainDB: The sql database used to store the blockchain.

txdbconfig codes:

type txdbConf struct {
	BaseDB SqlDbConf `toml:"base_db"`
}
  • BaseDB: The sql database used to store txdb.

txpoolconfig codes:

type TxpoolConf struct {
	PoolSize   uint64    `toml:"pool_size"`
	TxnMaxSize int       `toml:"txn_max_size"`
}
  • PoolSize: The size of the transaction pool, if it exceeds this size, subsequent transactions will not be put into the transaction pool.
  • TxnMaxSize:The data size of the maximum transaction, if a transaction exceeds this configuration, it will not be put into the transaction pool.

stateconfig codes:

type StateConf struct {
	KV StateKvConf `toml:"kv"`
}

At present, state only supports kvdb storage method, and more storage forms will be opened in the future

Config Example:

[block_chain.chain_db]
sql_db_type = "sqlite"
dsn = "chain.db"



[yu_db.base_db]
sql_db_type = "sqlite"
dsn = "txdb.db"

[txpool]
pool_size = 2048
txn_max_size = 1024000

[state.kv.index_db]
kv_type = "bolt"
path = "./state_index.db"

[state.kv.node_base]
kv_type = "bolt"
path = "./state_base.db"