Documentation ¶
Overview ¶
Package gorums implements a backend for HotStuff using the gorums framework.
Index ¶
- type Config
- func (cfg *Config) Close()
- func (cfg *Config) Connect(connectTimeout time.Duration) error
- func (cfg *Config) Fetch(ctx context.Context, hash hotstuff.Hash)
- func (cfg *Config) ID() hotstuff.ID
- func (cfg *Config) Len() int
- func (cfg *Config) PrivateKey() hotstuff.PrivateKey
- func (cfg *Config) Propose(block *hotstuff.Block)
- func (cfg *Config) QuorumSize() int
- func (cfg *Config) Replica(id hotstuff.ID) (replica hotstuff.Replica, ok bool)
- func (cfg *Config) Replicas() map[hotstuff.ID]hotstuff.Replica
- type Server
- func (srv *Server) Deliver(_ context.Context, block *proto.Block)
- func (srv *Server) Fetch(ctx context.Context, pb *proto.BlockHash)
- func (srv *Server) NewView(ctx context.Context, msg *proto.NewViewMsg)
- func (srv *Server) Propose(ctx context.Context, block *proto.Block)
- func (srv *Server) Start(hs hotstuff.Consensus) error
- func (srv *Server) StartOnListener(hs hotstuff.Consensus, listener net.Listener)
- func (srv *Server) Stop()
- func (srv *Server) Vote(_ context.Context, cert *proto.PartialCert)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds information about the current configuration of replicas that participate in the protocol, and some information about the local replica. It also provides methods to send messages to the other replicas.
func NewConfig ¶
func NewConfig(replicaCfg config.ReplicaConfig) *Config
NewConfig creates a new configuration.
func (*Config) Close ¶
func (cfg *Config) Close()
Close closes all connections made by this configuration.
func (*Config) PrivateKey ¶
func (cfg *Config) PrivateKey() hotstuff.PrivateKey
PrivateKey returns the id of this replica.
func (*Config) QuorumSize ¶
QuorumSize returns the size of a quorum
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the server-side of the gorums backend. It is responsible for calling handler methods on the consensus instance.
func NewServer ¶
func NewServer(replicaConfig config.ReplicaConfig) *Server
NewServer creates a new Server.
func (*Server) NewView ¶
func (srv *Server) NewView(ctx context.Context, msg *proto.NewViewMsg)
NewView handles the leader's response to receiving a NewView rpc from a replica.
func (*Server) StartOnListener ¶
StartOnListener starts the server on the given listener.