byzcoinNtree

package
v0.0.0-...-53feb6c Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2016 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSimulation

func NewSimulation(config string) (sda.Simulation, error)

NewSimulation returns a new Ntree simulation

Types

type BlockAnnounce

type BlockAnnounce struct {
	Block *blockchain.TrBlock
}

BlockAnnounce is used to signal the block to the whole tree.

type Exception

type Exception struct {
	ID sda.TreeNodeID
}

Exception is just representing the notion that a peers does not accept to sign something. It justs passes its TreeNodeId inside. No need for public key or whatever because each signatures is independent.

type NaiveBlockSignature

type NaiveBlockSignature struct {
	Sigs       []crypto.SchnorrSig
	Exceptions []Exception
}

NaiveBlockSignature contains the signatures of a block that goes up the tree using this message

type Ntree

type Ntree struct {
	*sda.TreeNodeInstance
	// contains filtered or unexported fields
}

Ntree is a basic implementation of a byzcoin consensus protocol using a tree and each verifiers will have independent signatures. The messages are then bigger and the verification time is also longer.

func NewNTreeRootProtocol

func NewNTreeRootProtocol(node *sda.TreeNodeInstance, transactions []blkparser.Tx) (*Ntree, error)

NewNTreeRootProtocol returns a NtreeProtocol with a set of transactions to sign for this round.

func NewNtreeProtocol

func NewNtreeProtocol(node *sda.TreeNodeInstance) (*Ntree, error)

NewNtreeProtocol returns the NtreeProtocol initialized

func (*Ntree) Dispatch

func (nt *Ntree) Dispatch() error

Dispatch do nothing yet since we use an implicit listen function in a go routine

func (*Ntree) RegisterOnDone

func (nt *Ntree) RegisterOnDone(fn func(*NtreeSignature))

RegisterOnDone is the callback that will be executed when the final signature is done.

func (*Ntree) Start

func (nt *Ntree) Start() error

Start announces the new block to sign

type NtreeServer

type NtreeServer struct {
	*byzcoin.Server
}

NtreeServer is similar to byzcoin.Server

func NewNtreeServer

func NewNtreeServer(blockSize int) *NtreeServer

NewNtreeServer returns a new block server for Ntree

func (*NtreeServer) Instantiate

func (nt *NtreeServer) Instantiate(node *sda.TreeNodeInstance) (sda.ProtocolInstance, error)

Instantiate returns a new NTree protocol instance

type NtreeSignature

type NtreeSignature struct {
	Block *blockchain.TrBlock
	*RoundSignatureResponse
}

NtreeSignature is the signature that we give back to the simulation or control

type RoundSignatureRequest

type RoundSignatureRequest struct {
	*NaiveBlockSignature
}

RoundSignatureRequest basically is the the block signature broadcasting down the tree.

type RoundSignatureResponse

type RoundSignatureResponse struct {
	*NaiveBlockSignature
}

RoundSignatureResponse is the final signatures

type Simulation

type Simulation struct {
	// sda fields:
	sda.SimulationBFTree
	// your simulation specific fields:
	byzcoin.SimulationConfig
}

Simulation implements da.Simulation interface

func (*Simulation) Run

func (e *Simulation) Run(sdaConf *sda.SimulationConfig) error

Run implements sda.Simulation interface

func (*Simulation) Setup

func (e *Simulation) Setup(dir string, hosts []string) (*sda.SimulationConfig, error)

Setup implements sda.Simulation interface

Jump to

Keyboard shortcuts

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