bc

package
v0.0.0-...-bda353b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//PREFIX_dpos_stake_nodeId the nodeId prefix in the dpos config in the chainconf
	PREFIX_dpos_stake_nodeId string = "stake.nodeID"
)

Variables

View Source
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) Init

func (bc *Blockchain) Init() (err error)

Init all the modules.

func (*Blockchain) InitForRebuildDbs

func (bc *Blockchain) InitForRebuildDbs() (err error)

Init all the modules.

func (*Blockchain) Module

func (bc *Blockchain) Module() string

Module

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) Start

func (bc *Blockchain) Start() error

Start all the modules.

func (*Blockchain) StartForRebuildDbs

func (bc *Blockchain) StartForRebuildDbs() error

func (*Blockchain) Stop

func (bc *Blockchain) Stop()

Stop all the modules.

func (*Blockchain) StopOnRequirements

func (bc *Blockchain) StopOnRequirements()

StopOnRequirements close the module instance which is required to shut down when chain configuration updating.

func (*Blockchain) Watch

func (bc *Blockchain) Watch(_ *configPb.ChainConfig) error

Watch

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) Init

func (server *HerbtServer) Init() error

Init HerbtServer.

func (*HerbtServer) InitForRebuildDbs

func (server *HerbtServer) InitForRebuildDbs(chainId string) error

Init HerbtServer.

func (*HerbtServer) Start

func (server *HerbtServer) Start() error

Start HerbtServer.

func (*HerbtServer) StartForRebuildDbs

func (server *HerbtServer) StartForRebuildDbs(needVerify bool) error

Start HerbtServer for rebuild dbs.

func (*HerbtServer) Stop

func (server *HerbtServer) Stop()

Stop HerbtServer.

func (*HerbtServer) Version

func (server *HerbtServer) Version() string

Version of herbt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL