Documentation ¶
Overview ¶
Package replica provides the required code for starting and running a replica and handling client requests.
Index ¶
- type Config
- type Replica
- func (srv *Replica) Close()
- func (srv *Replica) Connect(replicas *config.ReplicaConfig) error
- func (srv *Replica) GetHash() (b []byte)
- func (srv *Replica) Run(ctx context.Context)
- func (srv *Replica) Start()
- func (srv *Replica) StartServers(replicaListen, clientListen net.Listener)
- func (srv *Replica) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // The id of the replica. ID hotstuff.ID // The private key of the replica. PrivateKey consensus.PrivateKey // Controls whether TLS is used. TLS bool // The TLS certificate. Certificate *tls.Certificate // The root certificates trusted by the replica. RootCAs *x509.CertPool // The number of client commands that should be batched together in a block. BatchSize uint32 // Options for the client server. ClientServerOptions []gorums.ServerOption // Options for the replica server. ReplicaServerOptions []gorums.ServerOption // Options for the replica manager. ManagerOptions []gorums.ManagerOption }
Config configures a replica.
type Replica ¶
type Replica struct {
// contains filtered or unexported fields
}
Replica is a participant in the consensus protocol.
func (*Replica) Close ¶
func (srv *Replica) Close()
Close closes the connections and stops the servers used by the replica.
func (*Replica) Connect ¶
func (srv *Replica) Connect(replicas *config.ReplicaConfig) error
Connect connects to the other replicas.
func (*Replica) StartServers ¶
StartServers starts the client and replica servers.
Click to show internal directories.
Click to hide internal directories.