honeybadgerbft

package module
v0.0.0-...-aaf9671 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: Apache-2.0 Imports: 16 Imported by: 1

README

HoneyBadgerBFT

Go lang implementation of HoneyBadger BFT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(enc reedsolomon.Encoder, data []byte) ([][]byte, error)

Types

type BinaryAgreement

type BinaryAgreement struct {
	Lock sync.Mutex

	In  chan bool
	Out chan bool
	// contains filtered or unexported fields
}

func NewBinaryAgreement

func NewBinaryAgreement(instanceIndex int, total, tolerance int, inchannel chan *ab.HoneyBadgerBFTMessage, broadcastFunc func(msg ab.HoneyBadgerBFTMessage)) *BinaryAgreement

type ChainImpl

type ChainImpl struct {
	Total     int
	Tolerance int
	Index     int
	// contains filtered or unexported fields
}

func NewWrapper

func NewWrapper(batchSize uint64, ConnectionList []string, Index int, total int, tolerance int, random bool, fixed bool, fixedTime int) *ChainImpl

create new insatance of chain

func (*ChainImpl) Consensus

func (ch *ChainImpl) Consensus()

func (*ChainImpl) Enqueue

func (ch *ChainImpl) Enqueue(env *cb.Envelope)

Enqueue txn input and trigger for new block

type CommonSubset

type CommonSubset struct {
	In  chan []byte
	Out chan [][]byte
	// contains filtered or unexported fields
}

func NewCommonSubset

func NewCommonSubset(ordererIndex int, total int, tolerance int, rbc []*ReliableBroadcast, aba []*BinaryAgreement) (result *CommonSubset)

type HoneyBadgerBlock

type HoneyBadgerBlock struct {
	In  chan []*cb.Envelope
	Out chan []*cb.Envelope
	// contains filtered or unexported fields
}

func NewHoneyBadgerBlock

func NewHoneyBadgerBlock(total int, maxMalicious int, acs *CommonSubset) (result *HoneyBadgerBlock)

func NewHoneyBadgerBlock(total int, maxMalicious int, broadcastFunc func(msg ab.HoneyBadgerBFTMessage), acs *CommonSubset) (result *HoneyBadgerBlock) {

type MessageChannels

type MessageChannels struct {
	Send    chan ab.HoneyBadgerBFTMessage
	Receive chan *ab.HoneyBadgerBFTMessage
}

func Register

func Register(chainID string, connectAddresses []string, selfIndex int, rando bool, fix bool, fixedTim int) (MessageChannels, error)

type ReliableBroadcast

type ReliableBroadcast struct {
	In  chan []byte
	Out chan []byte
	// contains filtered or unexported fields
}

func NewReliableBroadcast

func NewReliableBroadcast(instanceIndex int, total int, tolerance int, ordererIndex int, leaderIndex int, receiveMessageChannel chan *ab.HoneyBadgerBFTMessage, sendFunc func(index int, msg ab.HoneyBadgerBFTMessage), broadcastFunc func(msg ab.HoneyBadgerBFTMessage)) (result *ReliableBroadcast)

Directories

Path Synopsis
proto

Jump to

Keyboard shortcuts

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