Documentation ¶
Index ¶
- Constants
- Variables
- type Blockchain
- func (bc *Blockchain) GetAccessControl() protocol.AccessControlProvider
- func (bc *Blockchain) Init() (err error)
- func (bc *Blockchain) InitForRebuildDbs() (err error)
- func (bc *Blockchain) Module() string
- func (bc *Blockchain) OnMessage(msg *msgbus.Message)
- func (bc *Blockchain) OnQuit()
- func (bc *Blockchain) RebuildDbs(needVerify bool)
- func (bc *Blockchain) Start() error
- func (bc *Blockchain) StartForRebuildDbs() error
- func (bc *Blockchain) Stop()
- func (bc *Blockchain) StopOnRequirements()
- func (bc *Blockchain) Watch(_ *configPb.ChainConfig) error
- type HerbtServer
- func (server *HerbtServer) AddTx(chainId string, tx *common.Transaction, source protocol.TxSource) error
- func (server *HerbtServer) GetAllAC() ([]protocol.AccessControlProvider, error)
- func (server *HerbtServer) GetAllChainConf() ([]protocol.ChainConf, error)
- func (server *HerbtServer) GetBlockchain(chainId string) (*Blockchain, error)
- func (server *HerbtServer) GetChainConf(chainId string) (protocol.ChainConf, error)
- func (server *HerbtServer) GetEventSubscribe(chainId string) (*subscriber.EventSubscriber, error)
- func (server *HerbtServer) GetNetService(chainId string) (protocol.NetService, error)
- func (server *HerbtServer) GetPoolStatus(chainId string) (*txpool.TxPoolStatus, error)
- func (server *HerbtServer) GetStore(chainId string) (protocol.BlockchainStore, error)
- func (server *HerbtServer) GetTxIdsByTypeAndStage(chainId string, txType, txStage int32) ([]string, error)
- func (server *HerbtServer) GetTxsInPoolByTxIds(chainId string, txIds []string) ([]*common.Transaction, []string, error)
- func (server *HerbtServer) GetVmManager(chainId string) (protocol.VmManager, error)
- func (server *HerbtServer) Init() error
- func (server *HerbtServer) InitForRebuildDbs(chainId string) error
- func (server *HerbtServer) Start() error
- func (server *HerbtServer) StartForRebuildDbs(needVerify bool) error
- func (server *HerbtServer) Stop()
- func (server *HerbtServer) Version() string
Constants ¶
const ( //PREFIX_dpos_stake_nodeId the nodeId prefix in the dpos config in the chainconf PREFIX_dpos_stake_nodeId string = "stake.nodeID" )
Variables ¶
var ( //CurrentVersion current version CurrentVersion = "v2.3.0" // CurrentCommit current git commit hash GitCommit = "" // CurrentBranch current git branch GitBranch = "" // BuildDateTime compile datetime BuildDateTime = "" )
Functions ¶
This section is empty.
Types ¶
type Blockchain ¶
type Blockchain struct {
// contains filtered or unexported fields
}
Blockchain is a block chain service. It manage all the modules of the chain.
func NewBlockchain ¶
func NewBlockchain(genesis string, chainId string, msgBus msgbus.MessageBus, net protocol.Net) *Blockchain
NewBlockchain create a new Blockchain instance.
func (*Blockchain) GetAccessControl ¶
func (bc *Blockchain) GetAccessControl() protocol.AccessControlProvider
GetAccessControl get the protocol.AccessControlProvider of instance.
func (*Blockchain) InitForRebuildDbs ¶
func (bc *Blockchain) InitForRebuildDbs() (err error)
Init all the modules.
func (*Blockchain) OnMessage ¶
func (bc *Blockchain) OnMessage(msg *msgbus.Message)
OnMessage contract event data is a []string, hexToString(proto.Marshal(data))
func (*Blockchain) OnQuit ¶
func (bc *Blockchain) OnQuit()
func (*Blockchain) RebuildDbs ¶
func (bc *Blockchain) RebuildDbs(needVerify bool)
Start all the modules.
func (*Blockchain) StartForRebuildDbs ¶
func (bc *Blockchain) StartForRebuildDbs() error
func (*Blockchain) StopOnRequirements ¶
func (bc *Blockchain) StopOnRequirements()
StopOnRequirements close the module instance which is required to shut down when chain configuration updating.
type HerbtServer ¶
type HerbtServer struct {
// contains filtered or unexported fields
}
HerbtServer manage all blockchains
func NewHerbtServer ¶
func NewHerbtServer() *HerbtServer
NewHerbtServer create a new HerbtServer instance.
func (*HerbtServer) AddTx ¶
func (server *HerbtServer) AddTx(chainId string, tx *common.Transaction, source protocol.TxSource) error
AddTx add a transaction.
func (*HerbtServer) GetAllAC ¶
func (server *HerbtServer) GetAllAC() ([]protocol.AccessControlProvider, error)
GetAllAC get all protocol.AccessControlProvider of all the chains.
func (*HerbtServer) GetAllChainConf ¶
func (server *HerbtServer) GetAllChainConf() ([]protocol.ChainConf, error)
GetAllChainConf get all protocol.ChainConf of all the chains.
func (*HerbtServer) GetBlockchain ¶
func (server *HerbtServer) GetBlockchain(chainId string) (*Blockchain, error)
GetBlockchain get Blockchain of chain which id is the given.
func (*HerbtServer) GetChainConf ¶
func (server *HerbtServer) GetChainConf(chainId string) (protocol.ChainConf, error)
GetChainConf get protocol.ChainConf of chain which id is the given.
func (*HerbtServer) GetEventSubscribe ¶
func (server *HerbtServer) GetEventSubscribe(chainId string) (*subscriber.EventSubscriber, error)
GetEventSubscribe get subscriber.EventSubscriber of chain which id is the given.
func (*HerbtServer) GetNetService ¶
func (server *HerbtServer) GetNetService(chainId string) (protocol.NetService, error)
GetNetService get protocol.NetService of chain which id is the given.
func (*HerbtServer) GetPoolStatus ¶
func (server *HerbtServer) GetPoolStatus(chainId string) (*txpool.TxPoolStatus, error)
GetPoolStatus Returns the max size of config transaction pool and common transaction pool, the num of config transaction in queue and pendingCache, and the the num of common transaction in queue and pendingCache.
func (*HerbtServer) GetStore ¶
func (server *HerbtServer) GetStore(chainId string) (protocol.BlockchainStore, error)
GetStore get the store instance of chain which id is the given.
func (*HerbtServer) GetTxIdsByTypeAndStage ¶
func (server *HerbtServer) GetTxIdsByTypeAndStage(chainId string, txType, txStage int32) ([]string, error)
GetTxIdsByTypeAndStage Returns config or common txIds in different stage. txType may be TxType_CONFIG_TX, TxType_COMMON_TX, (TxType_CONFIG_TX|TxType_COMMON_TX) txStage may be TxStage_IN_QUEUE, TxStage_IN_PENDING, (TxStage_IN_QUEUE|TxStage_IN_PENDING)
func (*HerbtServer) GetTxsInPoolByTxIds ¶
func (server *HerbtServer) GetTxsInPoolByTxIds(chainId string, txIds []string) ([]*common.Transaction, []string, error)
GetTxsInPoolByTxIds Retrieve the transactions by the txIds from the txPool, return transactions in the txPool and txIds not in txPool. default query upper limit is 1w transaction, and error is returned if the limit is exceeded.
func (*HerbtServer) GetVmManager ¶
func (server *HerbtServer) GetVmManager(chainId string) (protocol.VmManager, error)
GetVmManager get protocol.VmManager of chain which id is the given.
func (*HerbtServer) InitForRebuildDbs ¶
func (server *HerbtServer) InitForRebuildDbs(chainId string) error
Init HerbtServer.
func (*HerbtServer) StartForRebuildDbs ¶
func (server *HerbtServer) StartForRebuildDbs(needVerify bool) error
Start HerbtServer for rebuild dbs.