txdb
txdb
存储所有区块中的具体交易数据、 交易执行后的 event
和 error
。
接口
代码在这里
以下为核心功能的接口,开发者如有需求,可自行定制属于自己的txdb
func GetTxn(txnHash Hash) (*SignedTxn, error)
func SetTxn(stxn *SignedTxn) error
func ExistTxn(txnHash Hash) bool
GetTxn(txnHash)
根据交易的哈希值获取交易数据
SetTxn(stxn)
把交易数据存入txdb(以交易哈希为索引)
ExistTxn(txnHash)
查看是否有该交易
func SetResults(results []Result) error
func SetResult(result Result) error
将执行结果(event或者error)存入txdb
中