Documentation ¶
Index ¶
- func CalQuorum(N uint64) uint64
- type MinifileAdaptor
- type RBFTAdaptor
- func (a *RBFTAdaptor) Broadcast(ctx context.Context, msg *consensus.ConsensusMessage) (err error)
- func (a *RBFTAdaptor) DelState(key string) error
- func (a *RBFTAdaptor) Execute(requests []*types.Transaction, localList []bool, seqNo uint64, timestamp int64, ...)
- func (a *RBFTAdaptor) GetBlockMeta(num uint64) (*rbfttypes.BlockMeta, error)
- func (a *RBFTAdaptor) GetCommitChannel() chan *common.CommitEvent
- func (a *RBFTAdaptor) GetCurrentEpochInfo() (*rbft.EpochInfo, error)
- func (a *RBFTAdaptor) GetEpochInfo(epoch uint64) (*rbft.EpochInfo, error)
- func (a *RBFTAdaptor) PostCommitEvent(commitEvent *common.CommitEvent)
- func (a *RBFTAdaptor) ReadEpochState(key string) ([]byte, error)
- func (a *RBFTAdaptor) ReadState(key string) ([]byte, error)
- func (a *RBFTAdaptor) ReadStateSet(prefix string) (map[string][]byte, error)
- func (a *RBFTAdaptor) SendFilterEvent(_ rbfttypes.InformType, _ ...any)
- func (a *RBFTAdaptor) SetMsgPipes(msgPipes map[int32]p2p.Pipe, globalMsgPipe p2p.Pipe)
- func (a *RBFTAdaptor) Sign(msg []byte) ([]byte, error)
- func (a *RBFTAdaptor) StateUpdate(lowWatermark, seqNo uint64, digest string, ...)
- func (a *RBFTAdaptor) StoreEpochState(key string, value []byte) error
- func (a *RBFTAdaptor) StoreState(key string, value []byte) error
- func (a *RBFTAdaptor) Unicast(ctx context.Context, msg *consensus.ConsensusMessage, to string) error
- func (a *RBFTAdaptor) UpdateEpoch() error
- func (a *RBFTAdaptor) Verify(address string, signature []byte, msg []byte) error
- type Ready
- type RosedbAdaptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MinifileAdaptor ¶
type MinifileAdaptor struct {
// contains filtered or unexported fields
}
func OpenMinifile ¶
func OpenMinifile(path string) (*MinifileAdaptor, error)
func (*MinifileAdaptor) DelState ¶
func (a *MinifileAdaptor) DelState(key string) error
func (*MinifileAdaptor) ReadStateSet ¶
func (a *MinifileAdaptor) ReadStateSet(prefix string) (map[string][]byte, error)
ReadStateSet retrieves all key-value pairs where the key starts with prefix from the database with the given namespace
func (*MinifileAdaptor) StoreState ¶
func (a *MinifileAdaptor) StoreState(key string, value []byte) error
type RBFTAdaptor ¶
type RBFTAdaptor struct { ReadyC chan *Ready BlockC chan *common.CommitEvent StateUpdating bool StateUpdateHeight uint64 Cancel context.CancelFunc EpochInfo *rbft.EpochInfo MockBlockFeed event.Feed // contains filtered or unexported fields }
func NewRBFTAdaptor ¶
func NewRBFTAdaptor(config *common.Config) (*RBFTAdaptor, error)
func (*RBFTAdaptor) Broadcast ¶
func (a *RBFTAdaptor) Broadcast(ctx context.Context, msg *consensus.ConsensusMessage) (err error)
func (*RBFTAdaptor) DelState ¶
func (a *RBFTAdaptor) DelState(key string) error
DelState removes a key,value pair from the database with the given namespace
func (*RBFTAdaptor) Execute ¶
func (a *RBFTAdaptor) Execute(requests []*types.Transaction, localList []bool, seqNo uint64, timestamp int64, proposerAccount string, proposerNodeID uint64)
func (*RBFTAdaptor) GetBlockMeta ¶
func (a *RBFTAdaptor) GetBlockMeta(num uint64) (*rbfttypes.BlockMeta, error)
func (*RBFTAdaptor) GetCommitChannel ¶
func (a *RBFTAdaptor) GetCommitChannel() chan *common.CommitEvent
func (*RBFTAdaptor) GetCurrentEpochInfo ¶
func (a *RBFTAdaptor) GetCurrentEpochInfo() (*rbft.EpochInfo, error)
func (*RBFTAdaptor) GetEpochInfo ¶
func (a *RBFTAdaptor) GetEpochInfo(epoch uint64) (*rbft.EpochInfo, error)
func (*RBFTAdaptor) PostCommitEvent ¶
func (a *RBFTAdaptor) PostCommitEvent(commitEvent *common.CommitEvent)
func (*RBFTAdaptor) ReadEpochState ¶
func (a *RBFTAdaptor) ReadEpochState(key string) ([]byte, error)
func (*RBFTAdaptor) ReadState ¶
func (a *RBFTAdaptor) ReadState(key string) ([]byte, error)
ReadState retrieves a value to a key from the database with the given namespace
func (*RBFTAdaptor) ReadStateSet ¶
func (a *RBFTAdaptor) ReadStateSet(prefix string) (map[string][]byte, error)
ReadStateSet retrieves all key-value pairs where the key starts with prefix from the database with the given namespace
func (*RBFTAdaptor) SendFilterEvent ¶
func (a *RBFTAdaptor) SendFilterEvent(_ rbfttypes.InformType, _ ...any)
func (*RBFTAdaptor) SetMsgPipes ¶
func (*RBFTAdaptor) Sign ¶
func (a *RBFTAdaptor) Sign(msg []byte) ([]byte, error)
TODO: use edd25519 improve performance
func (*RBFTAdaptor) StateUpdate ¶
func (a *RBFTAdaptor) StateUpdate(lowWatermark, seqNo uint64, digest string, checkpoints []*consensus.SignedCheckpoint, epochChanges ...*consensus.EpochChange)
func (*RBFTAdaptor) StoreEpochState ¶
func (a *RBFTAdaptor) StoreEpochState(key string, value []byte) error
func (*RBFTAdaptor) StoreState ¶
func (a *RBFTAdaptor) StoreState(key string, value []byte) error
StoreState stores a key,value pair to the database with the given namespace
func (*RBFTAdaptor) Unicast ¶
func (a *RBFTAdaptor) Unicast(ctx context.Context, msg *consensus.ConsensusMessage, to string) error
func (*RBFTAdaptor) UpdateEpoch ¶
func (a *RBFTAdaptor) UpdateEpoch() error
type RosedbAdaptor ¶
type RosedbAdaptor struct {
// contains filtered or unexported fields
}
func OpenRosedb ¶
func OpenRosedb(path string) (*RosedbAdaptor, error)
func (*RosedbAdaptor) DelState ¶
func (a *RosedbAdaptor) DelState(key string) error
func (*RosedbAdaptor) ReadStateSet ¶
func (a *RosedbAdaptor) ReadStateSet(prefix string) (map[string][]byte, error)
ReadStateSet retrieves all key-value pairs where the key starts with prefix from the database with the given namespace
func (*RosedbAdaptor) StoreState ¶
func (a *RosedbAdaptor) StoreState(key string, value []byte) error
Click to show internal directories.
Click to hide internal directories.