hyperdrive

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

README ΒΆ

πŸ€– hyperdrive

GoDoc CircleCI Go Report Coverage Status

A Byzantine fault tolerant consensus algorithm for secure multiparty computation protocols. For more information, checkout the Wiki.

Built with ❀ by Ren.

Documentation ΒΆ

Overview ΒΆ

Package hyperdrive a high-level package for running multiple instances of the Hyperdrive consensus algorithm for over multiple shards. The Hyperdrive interface is the main entry point for users.

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

View Source
var (
	StandardBlockKind = block.Standard
	RebaseBlockKind   = block.Rebase
	BaseBlockKind     = block.Base
	NewBlock          = block.New
	NewBlockHeader    = block.NewHeader
)
View Source
var (
	// NewSignatory returns a Signatory from an ECDSA public key by serializing
	// the ECDSA public key into bytes and hashing it with SHA256.
	NewSignatory = id.NewSignatory
)

Functions ΒΆ

This section is empty.

Types ΒΆ

type Block ΒΆ added in v0.2.0

type Block = block.Block

A Block is an atomic unit of data upon which consensus is reached. Everything upon which consensus is needed should be put into a block, and consensus can only be reached on a block by block basis (there is no finer-grained way to express consensus).

type BlockIterator ΒΆ added in v0.2.0

type BlockIterator = replica.BlockIterator

type BlockPlan ΒΆ added in v0.3.0

type BlockPlan = block.Plan

A BlockPlan represents application-specific data that is needed to execute the transactions in a block. No assumptions are made about the format of this plan.

type BlockState ΒΆ added in v0.2.0

type BlockState = block.State

The BlockState represents application-specific state.

type BlockStorage ΒΆ added in v0.2.0

type BlockStorage = replica.BlockStorage

type BlockTxs ΒΆ added in v0.3.0

type BlockTxs = block.Txs

BlockTxs represent the application-specific transactions that are being proposed as part of a block. An application that wishes to achieve consensus on activity within the application should represent this activity as transactions, serialise them into bytes, and put them into a block. No assumptions are made about the format of these transactions.

type Blockchain ΒΆ added in v0.2.0

type Blockchain = process.Blockchain

type Blocks ΒΆ added in v0.2.0

type Blocks = block.Blocks

Blocks is a wrapper type around the `[]Block` type.

type Broadcaster ΒΆ added in v0.2.0

type Broadcaster = replica.Broadcaster

type Hash ΒΆ added in v0.2.0

type Hash = id.Hash

A Hash is the `[32]byte` output of a hashing function. Hyperdrive uses SHA256 for hashing.

type Hashes ΒΆ added in v0.2.0

type Hashes = id.Hashes

Hashes is a wrapper around the `[]Hash` type.

type Height ΒΆ added in v0.2.0

type Height = block.Height

The Height in a blockchain at which a block was proposed/committed.

type Hyperdrive ΒΆ

type Hyperdrive interface {
	Start()
	Rebase(sigs Signatories)
	HandleMessage(message Message)
}

Hyperdrive manages multiple `Replicas` from different `Shards`.

func New ΒΆ

func New(options Options, pStorage ProcessStorage, blockStorage BlockStorage, blockIterator BlockIterator, validator Validator, observer Observer, broadcaster Broadcaster, shards Shards, privKey ecdsa.PrivateKey) Hyperdrive

New returns a new `Hyperdrive` instance that wraps multiple replica instances. One replica instance will be created per Shard, but all replica instances will use the same interfaces and private key. Replicas will not be created for shards for which the replica is not a signatory. This means that rebasing can shuffle Signatories, but it cannot introduce new ones or remove existing ones (this will be supported in future updates).

hyper := hyperdrive.New(
    hyperdrive.Options{},
    pStorage,
    bStorage,
    bIter,
    validator,
    observer,
    broadcaster,
    shards,
    privKey,
)
hyper.Start()
for {
    select {
    case <-ctx.Done():
        break
    case message, ok := <-messagesFromNetwork:
        if !ok {
            break
        }
        hyper.HandleMessage(message)
    }
}

type Message ΒΆ added in v0.2.0

type Message = replica.Message

type Messages ΒΆ added in v0.2.0

type Messages = replica.Messages

type Observer ΒΆ added in v0.2.0

type Observer = replica.Observer

type Options ΒΆ added in v0.2.0

type Options = replica.Options

type Process ΒΆ added in v0.2.0

type Process = process.Process

type ProcessState ΒΆ added in v0.2.0

type ProcessState = process.State

type ProcessStorage ΒΆ added in v0.2.0

type ProcessStorage = replica.ProcessStorage

type Replica ΒΆ added in v0.2.0

type Replica = replica.Replica

type Replicas ΒΆ added in v0.2.0

type Replicas = replica.Replicas

type Round ΒΆ added in v0.2.0

type Round = block.Round

The Round in a consensus algorithm at which a block was proposed/committed.

type Shard ΒΆ added in v0.2.0

type Shard = replica.Shard

type Shards ΒΆ added in v0.2.0

type Shards = replica.Shards

type Signatories ΒΆ added in v0.2.0

type Signatories = id.Signatories

Signatories is a wrapper around the `[]Signatory` type.

type Signatory ΒΆ added in v0.2.0

type Signatory = id.Signatory

A Signatory is the `[32]byte` resulting from hashing an ECDSA public key. It represents the public identity of a content author and can be used to authenticate content that has been signed.

type Signature ΒΆ added in v0.2.0

type Signature = id.Signature

A Signature is the `[65]byte` output of an ECDSA signing algorithm. Hyperdrive uses the secp256k1 curve for ECDSA signing.

type Signatures ΒΆ added in v0.2.0

type Signatures = id.Signatures

Signatures is a wrapper around the `[]Signature` type.

type Timestamp ΒΆ added in v0.2.0

type Timestamp = block.Timestamp

Timestamp is a wrapper around the `uint64` type.

type Validator ΒΆ added in v0.2.0

type Validator = replica.Validator

Directories ΒΆ

Path Synopsis
Package block defines the `Block` type, and all of the related types.
Package block defines the `Block` type, and all of the related types.

Jump to

Keyboard shortcuts

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