Documentation ¶
Index ¶
- type BTCRandom
- func (btc *BTCRandom) GetCurrentChainTimeStamp() (int64, error)
- func (btc *BTCRandom) GetNonceByTimestamp(startTime time.Time, maxTime time.Duration, timestamp int64) (int, int64, int64, error)
- func (btc *BTCRandom) GetTimeStampAndNonceByBlockHeight(blockHeight int) (int64, int64, error)
- func (btc *BTCRandom) VerifyNonceWithTimestamp(startTime time.Time, maxTime time.Duration, timestamp int64, nonce int64) (bool, error)
- type BlockValidation
- type Consensus
- func (c *Consensus) ExtractBridgeValidationData(block types.BlockInterface) ([][]byte, []int, error)
- func (c *Consensus) ExtractPortalV4ValidationData(block types.BlockInterface) ([]*portalprocessv4.PortalSig, error)
- func (c *Consensus) GeValidators() []*consensus.Validator
- func (c *Consensus) GetAllMiningPublicKeys() []string
- func (c *Consensus) GetAllValidatorKeyState() map[string]consensus.MiningState
- func (c *Consensus) GetCurrentMiningPublicKey() (string, string)
- func (c *Consensus) GetOneValidator() *consensus.Validator
- func (c *Consensus) GetOneValidatorForEachConsensusProcess() map[int]*consensus.Validator
- func (c *Consensus) GetUserRole() (string, string, int)
- func (c *Consensus) GetValidators() []*consensus.Validator
- func (c *Consensus) IsCommitteeInChain(sid int) bool
- func (c *Consensus) IsCommitteeInShard(sid byte) bool
- func (c *Consensus) ValidateBlockCommitteSig(block types.BlockInterface, committee []incognitokey.CommitteePublicKey, ...) error
- func (c *Consensus) ValidateProducerPosition(blk types.BlockInterface, lastProposerIdx int, ...) error
- func (c *Consensus) ValidateProducerSig(block types.BlockInterface, consensusType string) error
- type ConsensusInterface
- type Fee
- type Pubsub
- type Server
- func (s *Server) EnableMining(enable bool) error
- func (s *Server) GetChainMiningStatus(chain int) string
- func (s *Server) GetIncognitoPublicKeyRole(publicKey string) (int, bool, int)
- func (s *Server) GetMinerIncognitoPublickey(publicKey string, keyType string) []byte
- func (s *Server) GetNodeRole() string
- func (s *Server) GetPublicKeyRole(publicKey string, keyType string) (int, int)
- func (s *Server) InsertNewShardView(state *blockchain.ShardBestState)
- func (s *Server) IsEnableMining() bool
- func (s *Server) OnTx(p *peer.PeerConn, msg *wire.MessageTx)
- func (s *Server) OnTxPrivacyToken(p *peer.PeerConn, msg *wire.MessageTxPrivacyToken)
- func (s *Server) PushBlockToAll(block types.BlockInterface, previousValidationData string, isBeacon bool) error
- func (s *Server) PushMessageToAll(message wire.Message) error
- func (s *Server) PushMessageToBeacon(msg wire.Message, exclusivePeerIDs map[libp2p.ID]bool) error
- func (s *Server) PushMessageToPeer(message wire.Message, id peer2.ID) error
- func (s *Server) PushMessageToShard(message wire.Message, shardID byte) error
- func (s *Server) RequestMissingViewViaStream(peerID string, hashes [][]byte, fromCID int, chainName string) (err error)
- type Syncker
- func (s *Syncker) GetCrossShardBlocksForShardProducer(view *blockchain.ShardBestState, limit map[byte][]uint64) map[byte][]interface{}
- func (s *Syncker) GetCrossShardBlocksForShardValidator(view *blockchain.ShardBestState, list map[byte][]uint64) (map[byte][]interface{}, error)
- func (s *Syncker) Init(config *syncker.SynckerManagerConfig)
- func (s *Syncker) InsertCrossShardBlock(blk *types.CrossShardBlock)
- func (s *Syncker) SyncMissingBeaconBlock(ctx context.Context, peerID string, fromHash common.Hash)
- func (s *Syncker) SyncMissingShardBlock(ctx context.Context, peerID string, sid byte, fromHash common.Hash)
- type TxPool
- func (tp *TxPool) Count() int
- func (tp *TxPool) EmptyPool() bool
- func (tp *TxPool) GetClonedPoolCandidate() map[common.Hash]string
- func (tp *TxPool) GetTx(txHash *common.Hash) (metadata.Transaction, error)
- func (tp *TxPool) HaveTransaction(hash *common.Hash) bool
- func (tp *TxPool) ListTxs() []string
- func (tp *TxPool) ListTxsDetail() []metadata.Transaction
- func (tp *TxPool) MarkForwardedTransaction(txHash common.Hash)
- func (tp *TxPool) MaxFee() uint64
- func (tp *TxPool) MaybeAcceptBatchTransactionForBlockProducing(shardID byte, txs []metadata.Transaction, beaconHeight int64, ...) ([]*metadata.TxDesc, error)
- func (tp *TxPool) MaybeAcceptTransaction(tx metadata.Transaction, beaconHeight int64) (*common.Hash, *mempool.TxDesc, error)
- func (tp *TxPool) MaybeAcceptTransactionForBlockProducing(tx metadata.Transaction, beaconHeight int64, state *blockchain.ShardBestState) (*metadata.TxDesc, error)
- func (tp *TxPool) RemoveCandidateList([]string)
- func (tp *TxPool) RemoveTx(txs []metadata.Transaction, isInBlock bool)
- func (tp *TxPool) SendTransactionToBlockGen()
- func (tp *TxPool) Size() uint64
- func (tp *TxPool) TriggerCRemoveTxs(tx metadata.Transaction)
- func (tp *TxPool) ValidateSerialNumberHashH(serialNumber []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BTCRandom ¶
type BTCRandom struct{}
func (*BTCRandom) GetCurrentChainTimeStamp ¶
func (*BTCRandom) GetNonceByTimestamp ¶
func (*BTCRandom) GetTimeStampAndNonceByBlockHeight ¶
type BlockValidation ¶
type BlockValidation interface { types.BlockInterface }
type Consensus ¶
type Consensus struct {
// contains filtered or unexported fields
}
func (*Consensus) ExtractBridgeValidationData ¶
func (*Consensus) ExtractPortalV4ValidationData ¶
func (c *Consensus) ExtractPortalV4ValidationData(block types.BlockInterface) ([]*portalprocessv4.PortalSig, error)
func (*Consensus) GeValidators ¶
func (*Consensus) GetAllMiningPublicKeys ¶
func (*Consensus) GetAllValidatorKeyState ¶
func (c *Consensus) GetAllValidatorKeyState() map[string]consensus.MiningState
func (*Consensus) GetCurrentMiningPublicKey ¶
func (*Consensus) GetOneValidator ¶
func (*Consensus) GetOneValidatorForEachConsensusProcess ¶
func (*Consensus) GetValidators ¶
func (*Consensus) IsCommitteeInChain ¶
func (*Consensus) IsCommitteeInShard ¶
func (*Consensus) ValidateBlockCommitteSig ¶
func (c *Consensus) ValidateBlockCommitteSig(block types.BlockInterface, committee []incognitokey.CommitteePublicKey, numFixNode int) error
func (*Consensus) ValidateProducerPosition ¶
func (c *Consensus) ValidateProducerPosition(blk types.BlockInterface, lastProposerIdx int, committee []incognitokey.CommitteePublicKey, minCommitteeSize int, produceTimeSlot int64, proposeTimeSlot int64) error
func (*Consensus) ValidateProducerSig ¶
func (c *Consensus) ValidateProducerSig(block types.BlockInterface, consensusType string) error
type ConsensusInterface ¶
type ConsensusInterface interface { GetOneValidator() *consensus.Validator GetOneValidatorForEachConsensusProcess() map[int]*consensus.Validator ValidateProducerPosition(blk types.BlockInterface, lastProposerIdx int, committee []incognitokey.CommitteePublicKey, minCommitteeSize int) error ValidateProducerSig(block types.BlockInterface, consensusType string) error ValidateBlockCommitteSig(block types.BlockInterface, committee []incognitokey.CommitteePublicKey) error IsCommitteeInChain(int) bool GetValidators() []*consensus.Validator }
type Fee ¶
type Fee struct { }
func (*Fee) RegisterBlock ¶
func (f *Fee) RegisterBlock(block *types.ShardBlock) error
type Server ¶
type Server struct { BlockChain *blockchain.BlockChain TxPool *mempool.TxPool }
func (*Server) EnableMining ¶
func (*Server) GetChainMiningStatus ¶
func (*Server) GetIncognitoPublicKeyRole ¶
func (*Server) GetMinerIncognitoPublickey ¶
func (*Server) GetNodeRole ¶
func (*Server) GetPublicKeyRole ¶
func (*Server) InsertNewShardView ¶
func (s *Server) InsertNewShardView(state *blockchain.ShardBestState)
func (*Server) IsEnableMining ¶
func (*Server) OnTxPrivacyToken ¶
func (s *Server) OnTxPrivacyToken(p *peer.PeerConn, msg *wire.MessageTxPrivacyToken)
func (*Server) PushBlockToAll ¶
func (*Server) PushMessageToBeacon ¶
func (*Server) PushMessageToPeer ¶
func (*Server) PushMessageToShard ¶
type Syncker ¶
type Syncker struct {
Syncker *syncker.SynckerManager
}
func (*Syncker) GetCrossShardBlocksForShardProducer ¶
func (s *Syncker) GetCrossShardBlocksForShardProducer(view *blockchain.ShardBestState, limit map[byte][]uint64) map[byte][]interface{}
func (*Syncker) GetCrossShardBlocksForShardValidator ¶
func (s *Syncker) GetCrossShardBlocksForShardValidator(view *blockchain.ShardBestState, list map[byte][]uint64) (map[byte][]interface{}, error)
func (*Syncker) Init ¶
func (s *Syncker) Init(config *syncker.SynckerManagerConfig)
func (*Syncker) InsertCrossShardBlock ¶
func (s *Syncker) InsertCrossShardBlock(blk *types.CrossShardBlock)
func (*Syncker) SyncMissingBeaconBlock ¶
type TxPool ¶
type TxPool struct {
BlockChain *blockchain.BlockChain
}
func (*TxPool) GetClonedPoolCandidate ¶
func (*TxPool) ListTxsDetail ¶
func (tp *TxPool) ListTxsDetail() []metadata.Transaction
func (*TxPool) MarkForwardedTransaction ¶
func (*TxPool) MaybeAcceptBatchTransactionForBlockProducing ¶
func (tp *TxPool) MaybeAcceptBatchTransactionForBlockProducing(shardID byte, txs []metadata.Transaction, beaconHeight int64, shardView *blockchain.ShardBestState) ([]*metadata.TxDesc, error)
func (*TxPool) MaybeAcceptTransaction ¶
func (*TxPool) MaybeAcceptTransactionForBlockProducing ¶
func (tp *TxPool) MaybeAcceptTransactionForBlockProducing(tx metadata.Transaction, beaconHeight int64, state *blockchain.ShardBestState) (*metadata.TxDesc, error)
func (*TxPool) RemoveCandidateList ¶
func (*TxPool) SendTransactionToBlockGen ¶
func (tp *TxPool) SendTransactionToBlockGen()
func (*TxPool) TriggerCRemoveTxs ¶
func (tp *TxPool) TriggerCRemoveTxs(tx metadata.Transaction)
func (*TxPool) ValidateSerialNumberHashH ¶
Click to show internal directories.
Click to hide internal directories.