Documentation ¶
Index ¶
- Variables
- func GenGenesis(db db.MVCCDB, witnessInfo []string) (*block.Block, error)
- type BaseVariable
- type BaseVariableImpl
- func (g *BaseVariableImpl) BlockChain() block.Chain
- func (g *BaseVariableImpl) Config() *common.Config
- func (g *BaseVariableImpl) Mode() TMode
- func (g *BaseVariableImpl) SetMode(m TMode)
- func (g *BaseVariableImpl) StateDB() db.MVCCDB
- func (g *BaseVariableImpl) TxDB() TxDB
- func (g *BaseVariableImpl) WitnessList() []string
- type TMode
- type TxDB
- type TxDBImpl
- func (tdb *TxDBImpl) Close()
- func (tdb *TxDBImpl) GetReceipt(hash []byte) (*tx.TxReceipt, error)
- func (tdb *TxDBImpl) GetReceiptByTxHash(hash []byte) (*tx.TxReceipt, error)
- func (tdb *TxDBImpl) GetTx(hash []byte) (*tx.Tx, error)
- func (tdb *TxDBImpl) HasReceipt(hash []byte) (bool, error)
- func (tdb *TxDBImpl) HasTx(hash []byte) (bool, error)
- func (tdb *TxDBImpl) Push(txs []*tx.Tx, receipts []*tx.TxReceipt) error
Constants ¶
This section is empty.
Variables ¶
View Source
var GenesisTxExecTime = 1 * time.Second
GenesisTxExecTime is the maximum execution time of a transaction in genesis block
View Source
var VoteContractPath = "../../config/"
VoteContractPath is config of vote
Functions ¶
Types ¶
type BaseVariable ¶
type BaseVariable interface { TxDB() TxDB StateDB() db.MVCCDB Config() *common.Config BlockChain() block.Chain WitnessList() []string Mode() TMode SetMode(m TMode) }
BaseVariable defines BaseVariable's API.
type BaseVariableImpl ¶
type BaseVariableImpl struct {
// contains filtered or unexported fields
}
BaseVariableImpl is the implementation of BaseVariable
func New ¶
func New(conf *common.Config) (*BaseVariableImpl, error)
New return a BaseVariable instance
func (*BaseVariableImpl) BlockChain ¶
func (g *BaseVariableImpl) BlockChain() block.Chain
BlockChain return the block chain
func (*BaseVariableImpl) Config ¶
func (g *BaseVariableImpl) Config() *common.Config
Config return the config
func (*BaseVariableImpl) SetMode ¶
func (g *BaseVariableImpl) SetMode(m TMode)
SetMode is set the mode
func (*BaseVariableImpl) StateDB ¶
func (g *BaseVariableImpl) StateDB() db.MVCCDB
StateDB return the state database
func (*BaseVariableImpl) TxDB ¶
func (g *BaseVariableImpl) TxDB() TxDB
TxDB return the transaction database
func (*BaseVariableImpl) WitnessList ¶
func (g *BaseVariableImpl) WitnessList() []string
WitnessList return the witness list
type TxDB ¶
type TxDB interface { Push(txs []*tx.Tx, receipts []*tx.TxReceipt) error GetTx(hash []byte) (*tx.Tx, error) HasTx(hash []byte) (bool, error) GetReceipt(Hash []byte) (*tx.TxReceipt, error) GetReceiptByTxHash(Hash []byte) (*tx.TxReceipt, error) HasReceipt(hash []byte) (bool, error) Close() }
TxDB defines the functions of tx database.
type TxDBImpl ¶
type TxDBImpl struct {
// contains filtered or unexported fields
}
TxDBImpl is the implementation of TxDB.
func (*TxDBImpl) GetReceipt ¶
GetReceipt gets receipt with receipt's hash
func (*TxDBImpl) GetReceiptByTxHash ¶
GetReceiptByTxHash gets receipt with tx's hash
func (*TxDBImpl) HasReceipt ¶
HasReceipt checks if database has receipt.
Click to show internal directories.
Click to hide internal directories.