run

package
v0.23.4-rest Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: AGPL-3.0 Imports: 29 Imported by: 2

Documentation

Overview

contains reusable logic that does not know about a CLI. Instead of exiting a program, functions here will return errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateClusterRootQC

func GenerateClusterRootQC(participants []bootstrap.NodeInfo, clusterBlock *cluster.Block) (*flow.QuorumCertificate, error)

func GenerateExecutionState

func GenerateExecutionState(
	dbDir string,
	accountKey flow.AccountPublicKey,
	chain flow.Chain,
	bootstrapOptions ...fvm.BootstrapProcedureOption,
) (flow.StateCommitment, error)

NOTE: this is now unused and should become part of another tool.

func GenerateRootBlock

func GenerateRootBlock(chainID flow.ChainID, parentID flow.Identifier, height uint64, timestamp time.Time) *flow.Block

func GenerateRootBlockVotes added in v0.22.8

func GenerateRootBlockVotes(block *flow.Block, participantData *ParticipantData) ([]*model.Vote, error)

GenerateRootBlockVotes generates votes for root block based on participantData

func GenerateRootClusterBlocks

func GenerateRootClusterBlocks(epoch uint64, clusters flow.ClusterList) []*cluster.Block

func GenerateRootQC

func GenerateRootQC(block *flow.Block, votes []*model.Vote, participantData *ParticipantData, identities flow.IdentityList) (*flow.QuorumCertificate, error)

GenerateRootQC generates QC for root block, caller needs to provide votes for root QC and participantData to build the QC. NOTE: at the moment, we require private keys for one node because we we re-using the full business logic, which assumes that only consensus participants construct QCs, which also have produce votes. TODO: modularize QC construction code (and code to verify QC) to be instantiated without needing private keys.

func GenerateRootResult

func GenerateRootResult(
	block *flow.Block,
	commit flow.StateCommitment,
	epochSetup *flow.EpochSetup,
	epochCommit *flow.EpochCommit,
) *flow.ExecutionResult

func GenerateRootSeal

func GenerateRootSeal(result *flow.ExecutionResult) (*flow.Seal, error)

func GenerateServiceAccountPrivateKey

func GenerateServiceAccountPrivateKey(seed []byte) (flow.AccountPrivateKey, error)

NOTE: this is now unused and should become part of another tool.

func RunDKG

func RunDKG(n int, seeds [][]byte) (model.DKGData, error)

RunDKG simulates a distributed DKG protocol by running the protocol locally and generating the DKG output info

func RunFastKG

func RunFastKG(n int, seed []byte) (model.DKGData, error)

RunFastKG is an alternative to RunDKG that runs much faster by using a centralized threshold signature key generation.

Types

type Participant

type Participant struct {
	bootstrap.NodeInfo
	RandomBeaconPrivKey crypto.PrivateKey
}

type ParticipantData

type ParticipantData struct {
	Participants []Participant
	Lookup       map[flow.Identifier]flow.DKGParticipant
	GroupKey     crypto.PublicKey
}

func GenerateQCParticipantData

func GenerateQCParticipantData(allNodes, internalNodes []bootstrap.NodeInfo, dkgData dkg.DKGData) (*ParticipantData, error)

GenerateQCParticipantData generates QC participant data used to create the random beacon and staking signatures on the QC.

allNodes must be in the same order that was used when running the DKG.

func (*ParticipantData) Identities

func (pd *ParticipantData) Identities() flow.IdentityList

Jump to

Keyboard shortcuts

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