Versions in this module Expand all Collapse all v1 v1.1.1 Oct 29, 2019 Changes in this version + const BaMsg + const BlockBodiesMsg + const BlockCertificateMsg + const BlockHeadersMsg + const BpMsg + const CsMsg + const ErrDecode + const ErrExtraStatusMsg + const ErrGenesisBlockMismatch + const ErrInvalidMsgCode + const ErrMsgTooLarge + const ErrNetworkIdMismatch + const ErrNoStatusMsg + const ErrProtocolVersionMismatch + const ErrSuspendedPeer + const GetBlockBodiesMsg + const GetBlockCertificateMsg + const GetBlockHeadersMsg + const GetNodeDataMsg + const GetReceiptsMsg + const NewBlockHashesMsg + const NewBlockMsg + const NodeDataMsg + const ProtocolMaxMsgSize + const ReceiptsMsg + const StatusMsg + const TxMsg + var DefaultConfig = Config + var ProtocolLengths = []uint64 + var ProtocolName = "bchain" + var ProtocolVersions = []uint + func CreateConsensusEngine(bchain *Bchain) consensus.Engine + func CreateDB(ctx *node.ServiceContext, config *Config, name string) (database.IDatabase, error) + func UpgradeDeduplicateData(db database.IDatabase) func() error + type Bchain struct + ApiBackend *BchainApiBackend + func New(ctx *node.ServiceContext) (*Bchain, error) + func (s *Bchain) APIs() []rpc.API + func (s *Bchain) AccountManager() *accounts.Manager + func (s *Bchain) AddLesServer(ls LesServer) + func (s *Bchain) BchainVersion() int + func (s *Bchain) BlockChain() *blockchain.BlockChain + func (s *Bchain) Blockproducer() *blockproducer.Blockproducer + func (s *Bchain) ChainDb() database.IDatabase + func (s *Bchain) Coinbase() (eb accounts.Account, err error) + func (s *Bchain) Downloader() *downloader.Downloader + func (s *Bchain) Engine() consensus.Engine + func (s *Bchain) EventMux() *event.TypeMux + func (s *Bchain) IsListening() bool + func (s *Bchain) IsProducing() bool + func (s *Bchain) NetVersion() uint64 + func (s *Bchain) Protocols() []p2p.Protocol + func (s *Bchain) ResetWithGenesisBlock(gb *block.Block) + func (s *Bchain) SetEngineKey(pri *ecdsa.PrivateKey) + func (s *Bchain) Start(srvr *p2p.Server) error + func (s *Bchain) StartProducing(local bool, password string) error + func (s *Bchain) Stop() error + func (s *Bchain) StopProducing() + func (s *Bchain) TxPool() *txprocessor.TxPool + func (self *Bchain) SetCoinbase(coinbase types.Address) + type BchainApiBackend struct + func (b *BchainApiBackend) AccountManager() *accounts.Manager + func (b *BchainApiBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*block.Block, error) + func (b *BchainApiBackend) BloomStatus() (uint64, uint64) + func (b *BchainApiBackend) ChainConfig() *params.ChainConfig + func (b *BchainApiBackend) ChainDb() database.IDatabase + func (b *BchainApiBackend) CurrentBlock() *block.Block + func (b *BchainApiBackend) CurrentBlockNum() uint64 + func (b *BchainApiBackend) Downloader() *downloader.Downloader + func (b *BchainApiBackend) EventMux() *event.TypeMux + func (b *BchainApiBackend) GetBlock(ctx context.Context, blockHash types.Hash) (*block.Block, error) + func (b *BchainApiBackend) GetBlockCertificate(ctx context.Context, blockNr rpc.BlockNumber) apos.BlockCertificate + func (b *BchainApiBackend) GetPoolNonce(ctx context.Context, addr types.Address) (uint64, error) + func (b *BchainApiBackend) GetPoolTransaction(hash types.Hash) *transaction.Transaction + func (b *BchainApiBackend) GetPoolTransactions() (transaction.Transactions, error) + func (b *BchainApiBackend) GetReceipts(ctx context.Context, blockHash types.Hash) (transaction.Receipts, error) + func (b *BchainApiBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*block.Header, error) + func (b *BchainApiBackend) ProtocolVersion() int + func (b *BchainApiBackend) SendTx(ctx context.Context, signedTx *transaction.Transaction) error + func (b *BchainApiBackend) ServiceFilter(ctx context.Context, session *bloom.MatcherSession) + func (b *BchainApiBackend) SetHead(number uint64) + func (b *BchainApiBackend) StatInfoByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*blockchain.BlockStat, error) + func (b *BchainApiBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.StateDB, *block.Header, error) + func (b *BchainApiBackend) Stats() (pending int, queued int) + func (b *BchainApiBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription + func (b *BchainApiBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription + func (b *BchainApiBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription + func (b *BchainApiBackend) SubscribeLogsEvent(ch chan<- []*transaction.Log) event.Subscription + func (b *BchainApiBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription + func (b *BchainApiBackend) SubscribeTxPreEvent(ch chan<- core.TxPreEvent) event.Subscription + func (b *BchainApiBackend) TxPoolContent() (map[types.Address]transaction.Transactions, ...) + type BchaindConfig struct + Bchain Config + Node node.Config + type BlockBodiesData struct + Bodys []*block.Body + func (z *BlockBodiesData) DecodeMsg(dc *msgp.Reader) (err error) + func (z *BlockBodiesData) EncodeMsg(en *msgp.Writer) (err error) + func (z *BlockBodiesData) MarshalMsg(b []byte) (o []byte, err error) + func (z *BlockBodiesData) Msgsize() (s int) + func (z *BlockBodiesData) UnmarshalMsg(bts []byte) (o []byte, err error) + type BlockCertificateData struct + Certificates [][]byte + func (z *BlockCertificateData) DecodeMsg(dc *msgp.Reader) (err error) + func (z *BlockCertificateData) EncodeMsg(en *msgp.Writer) (err error) + func (z *BlockCertificateData) MarshalMsg(b []byte) (o []byte, err error) + func (z *BlockCertificateData) Msgsize() (s int) + func (z *BlockCertificateData) UnmarshalMsg(bts []byte) (o []byte, err error) + type Config struct + BlockproducerThreads int + Coinbase types.Address + DatabaseCache int + DatabaseHandles int + DocRoot string + EnablePreimageRecording bool + ExtraData []byte + Genesis *genesis.Genesis + LightPeers int + LightServ int + MaxBlockTxSize uint64 + NetworkId uint64 + SkipBcVersionCheck bool + StartBlockproducerAtStart bool + SyncMode downloader.SyncMode + TxPool txprocessor.TxPoolConfig + func (c *Config) SetDefaultConfig() error + func (c *Config) SetSpecialConfig() error + func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error + func (c Config) MarshalTOML() (interface{}, error) + type GetBlockHeadersData struct + Amount uint64 + Origin HashOrNumber + Reverse bool + Skip uint64 + func (z *GetBlockHeadersData) DecodeMsg(dc *msgp.Reader) (err error) + func (z *GetBlockHeadersData) EncodeMsg(en *msgp.Writer) (err error) + func (z *GetBlockHeadersData) MarshalMsg(b []byte) (o []byte, err error) + func (z *GetBlockHeadersData) Msgsize() (s int) + func (z *GetBlockHeadersData) UnmarshalMsg(bts []byte) (o []byte, err error) + type HashOrNumber struct + Hash types.Hash + Number uint64 + func (z *HashOrNumber) DecodeMsg(dc *msgp.Reader) (err error) + func (z *HashOrNumber) EncodeMsg(en *msgp.Writer) (err error) + func (z *HashOrNumber) MarshalMsg(b []byte) (o []byte, err error) + func (z *HashOrNumber) Msgsize() (s int) + func (z *HashOrNumber) UnmarshalMsg(bts []byte) (o []byte, err error) + type LesServer interface + Protocols func() []p2p.Protocol + SetBloomBitsIndexer func(bbIndexer *chainindexer.ChainIndexer) + Start func(srvr *p2p.Server) + Stop func() + type Meta struct + BlockHash types.Hash + BlockIndex uint64 + Index uint64 + func (z *Meta) DecodeMsg(dc *msgp.Reader) (err error) + func (z *Meta) EncodeMsg(en *msgp.Writer) (err error) + func (z *Meta) MarshalMsg(b []byte) (o []byte, err error) + func (z *Meta) Msgsize() (s int) + func (z *Meta) UnmarshalMsg(bts []byte) (o []byte, err error) + type NewBlockData struct + Block *block.Block + Number *types.BigInt + func (z *NewBlockData) DecodeMsg(dc *msgp.Reader) (err error) + func (z *NewBlockData) EncodeMsg(en *msgp.Writer) (err error) + func (z *NewBlockData) MarshalMsg(b []byte) (o []byte, err error) + func (z *NewBlockData) Msgsize() (s int) + func (z *NewBlockData) UnmarshalMsg(bts []byte) (o []byte, err error) + type NewBlockHashesData []struct + func (z *NewBlockHashesData) DecodeMsg(dc *msgp.Reader) (err error) + func (z *NewBlockHashesData) UnmarshalMsg(bts []byte) (o []byte, err error) + func (z NewBlockHashesData) EncodeMsg(en *msgp.Writer) (err error) + func (z NewBlockHashesData) MarshalMsg(b []byte) (o []byte, err error) + func (z NewBlockHashesData) Msgsize() (s int) + type NodeData struct + Nodes [][]byte + func (z *NodeData) DecodeMsg(dc *msgp.Reader) (err error) + func (z *NodeData) EncodeMsg(en *msgp.Writer) (err error) + func (z *NodeData) MarshalMsg(b []byte) (o []byte, err error) + func (z *NodeData) Msgsize() (s int) + func (z *NodeData) UnmarshalMsg(bts []byte) (o []byte, err error) + type NodeInfo struct + Config *params.ChainConfig + Genesis types.Hash + Head types.Hash + Network uint64 + Number *big.Int + type PeerInfo struct + Head string + Number *big.Int + Version int + type PrivateAdminAPI struct + func NewPrivateAdminAPI(bchain *Bchain) *PrivateAdminAPI + func (api *PrivateAdminAPI) ExportChain(file string) (bool, error) + func (api *PrivateAdminAPI) ImportChain(file string) (bool, error) + type PrivateBlockproducerAPI struct + func NewPrivateBlockproducerAPI(e *Bchain) *PrivateBlockproducerAPI + func (api *PrivateBlockproducerAPI) GetHashrate() uint64 + func (api *PrivateBlockproducerAPI) SetCoinbase(coinbase types.Address) bool + func (api *PrivateBlockproducerAPI) SetExtra(extra string) (bool, error) + func (api *PrivateBlockproducerAPI) Start(threads *int, password string) error + func (api *PrivateBlockproducerAPI) Stop() bool + type ProtocolManager struct + SubProtocols []p2p.Protocol + func NewProtocolManager(config *params.ChainConfig, mode downloader.SyncMode, networkId uint64, ...) (*ProtocolManager, error) + func (pm *ProtocolManager) BroadcastBa(hash types.Hash, ba *apos.ByzantineAgreementStar) + func (pm *ProtocolManager) BroadcastBlock(block *block.Block, propagate bool) + func (pm *ProtocolManager) BroadcastBp(hash types.Hash, bp *apos.BlockProposal) + func (pm *ProtocolManager) BroadcastCs(hash types.Hash, cs *apos.CredentialSign) + func (pm *ProtocolManager) BroadcastTx(hash types.Hash, tx *transaction.Transaction) + func (pm *ProtocolManager) Start(maxPeers int) + func (pm *ProtocolManager) Stop() + func (self *ProtocolManager) NodeInfo() *NodeInfo + type PublicBchainAPI struct + func NewPublicBchainAPI(e *Bchain) *PublicBchainAPI + func (api *PublicBchainAPI) Coinbase() (types.Address, error) + func (api *PublicBchainAPI) Hashrate() types.Uint64ForJson + type SetupGenesisResult struct + ChainConfig *params.ChainConfig + ChainDb *database.IDatabase + GenesisErr error + GennesisHash *types.Hash + type StatusData struct + CurrentBlock types.Hash + GenesisBlock types.Hash + NetworkId uint64 + Number *types.BigInt + ProtocolVersion uint32 + func (z *StatusData) DecodeMsg(dc *msgp.Reader) (err error) + func (z *StatusData) EncodeMsg(en *msgp.Writer) (err error) + func (z *StatusData) MarshalMsg(b []byte) (o []byte, err error) + func (z *StatusData) Msgsize() (s int) + func (z *StatusData) UnmarshalMsg(bts []byte) (o []byte, err error) + type StorageRangeResult struct + NextKey *types.Hash + Storage storageMap