gorums

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2021 License: MIT Imports: 15 Imported by: 1

Documentation

Index

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
}

func NewConfig

func NewConfig(replicaCfg config.ReplicaConfig) *Config

func (*Config) Close

func (cfg *Config) Close()

func (*Config) Connect

func (cfg *Config) Connect(connectTimeout time.Duration) error

func (*Config) Fetch

func (cfg *Config) Fetch(ctx context.Context, hash hotstuff.Hash)

Fetch requests a block from all the replicas in the configuration

func (*Config) ID

func (cfg *Config) ID() hotstuff.ID

ID returns the id of this replica

func (*Config) Len

func (cfg *Config) Len() int

func (*Config) PrivateKey

func (cfg *Config) PrivateKey() hotstuff.PrivateKey

PrivateKey returns the id of this replica

func (*Config) Propose

func (cfg *Config) Propose(block *hotstuff.Block)

Propose sends the block to all replicas in the configuration

func (*Config) QuorumSize

func (cfg *Config) QuorumSize() int

QuorumSize returns the size of a quorum

func (*Config) Replica

func (cfg *Config) Replica(id hotstuff.ID) (replica hotstuff.Replica, ok bool)

func (*Config) Replicas

func (cfg *Config) Replicas() map[hotstuff.ID]hotstuff.Replica

Replicas returns all of the replicas in the configuration

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(replicaConfig config.ReplicaConfig) *Server

func (*Server) Deliver

func (srv *Server) Deliver(_ context.Context, block *proto.Block)

func (*Server) Fetch

func (srv *Server) Fetch(ctx context.Context, pb *proto.BlockHash)

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) Propose

func (srv *Server) Propose(ctx context.Context, block *proto.Block)

Propose handles a replica's response to the Propose QC from the leader

func (*Server) Start

func (srv *Server) Start(hs hotstuff.Consensus) error

Start creates a listener on the configured address and starts the server

func (*Server) StartOnListener

func (srv *Server) StartOnListener(hs hotstuff.Consensus, listener net.Listener)

StartOnListener starts the server on the given listener

func (*Server) Stop

func (srv *Server) Stop()

func (*Server) Vote

func (srv *Server) Vote(_ context.Context, cert *proto.PartialCert)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL