Documentation ¶
Index ¶
- type APIProcessor
- type BlockChain
- func (bc *BlockChain) ApplyTransaction(tx *tx.Tx) error
- func (bc *BlockChain) CommitNewBlock(blockSize int, createdAt int64) (*block.BlockStates, error)
- func (bc *BlockChain) CurrentBlock() *block.Block
- func (bc *BlockChain) DB() *sdb.ChainDB
- func (bc *BlockChain) InitNewBlock() (*block.Block, error)
- func (bc *BlockChain) StateDB() *sdb.StateDB
- func (bc *BlockChain) VerifyExpiredAt(expiredAt int64) error
- func (bc *BlockChain) VerifyGas(gasAccountIndex, gasFeeAssetId int64, txType int, gasFeeAmount *big.Int, ...) error
- func (bc *BlockChain) VerifyNonce(accountIndex int64, nonce int64) error
- type ChainConfig
- type CommitProcessor
- type Processor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIProcessor ¶
type APIProcessor struct {
// contains filtered or unexported fields
}
type BlockChain ¶
type BlockChain struct { *sdb.ChainDB Statedb *sdb.StateDB // Cache for current block changes. // contains filtered or unexported fields }
func NewBlockChain ¶
func NewBlockChain(config *ChainConfig, moduleName string) (*BlockChain, error)
func NewBlockChainForDryRun ¶
func NewBlockChainForDryRun(accountModel account.AccountModel, nftModel nft.L2NftModel, txPoolModel tx.TxPoolModel, assetModel asset.AssetModel, sysConfigModel sysconfig.SysConfigModel, redisCache dbcache.Cache) (*BlockChain, error)
NewBlockChainForDryRun - for dry run mode, we can reuse existing models for quick creation , e.g., for sending tx, we can create blockchain for each request quickly
func (*BlockChain) ApplyTransaction ¶
func (bc *BlockChain) ApplyTransaction(tx *tx.Tx) error
func (*BlockChain) CommitNewBlock ¶
func (bc *BlockChain) CommitNewBlock(blockSize int, createdAt int64) (*block.BlockStates, error)
func (*BlockChain) CurrentBlock ¶
func (bc *BlockChain) CurrentBlock() *block.Block
func (*BlockChain) DB ¶
func (bc *BlockChain) DB() *sdb.ChainDB
func (*BlockChain) InitNewBlock ¶ added in v0.0.5
func (bc *BlockChain) InitNewBlock() (*block.Block, error)
func (*BlockChain) StateDB ¶
func (bc *BlockChain) StateDB() *sdb.StateDB
func (*BlockChain) VerifyExpiredAt ¶
func (bc *BlockChain) VerifyExpiredAt(expiredAt int64) error
func (*BlockChain) VerifyNonce ¶
func (bc *BlockChain) VerifyNonce(accountIndex int64, nonce int64) error
type ChainConfig ¶
type ChainConfig struct { Postgres struct { DataSource string } CacheRedis cache.CacheConf //nolint:staticcheck CacheConfig statedb.CacheConfig `json:",optional"` TreeDB struct { Driver tree.Driver //nolint:staticcheck LevelDBOption tree.LevelDBOption `json:",optional"` //nolint:staticcheck RedisDBOption tree.RedisDBOption `json:",optional"` //nolint:staticcheck RoutinePoolSize int `json:",optional"` AssetTreeCacheSize int } }
type CommitProcessor ¶
type CommitProcessor struct {
// contains filtered or unexported fields
}
type Processor ¶
func NewAPIProcessor ¶
func NewAPIProcessor(bc *BlockChain) Processor
func NewCommitProcessor ¶
func NewCommitProcessor(bc *BlockChain) Processor
Click to show internal directories.
Click to hide internal directories.