cohort

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cohort

type Cohort interface {
	Propose(ctx context.Context, req *entity.ProposeRequest) (*entity.CohortResponse, error)
	Precommit(ctx context.Context, index uint64, votes []*entity.Vote) (*entity.CohortResponse, error)
	Commit(ctx context.Context, in *entity.CommitRequest) (*entity.CohortResponse, error)
	Height() uint64
}

type CohortImpl

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

func NewCohort

func NewCohort(
	tracer *zipkin.Tracer,
	committer *commitalgo.Committer,
	commitType Mode) *CohortImpl

func (*CohortImpl) Commit

func (c *CohortImpl) Commit(ctx context.Context, in *entity.CommitRequest) (resp *entity.CohortResponse, err error)

func (*CohortImpl) Height

func (c *CohortImpl) Height() uint64

func (*CohortImpl) Precommit

func (s *CohortImpl) Precommit(ctx context.Context, index uint64, votes []*entity.Vote) (*entity.CohortResponse, error)

func (*CohortImpl) Propose

type Mode

type Mode string
const THREE_PHASE Mode = "three-phase"

type PrecommitRequest

type PrecommitRequest struct {
	Index uint64         `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Votes []*entity.Vote `protobuf:"bytes,2,rep,name=votes,proto3" json:"votes,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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