common

package
v0.31.5-fix-AN-transac... Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: AGPL-3.0 Imports: 19 Imported by: 15

Documentation

Index

Constants

View Source
const (
	DefaultAccessAPIPort       = "9000"
	DefaultAccessAPISecurePort = "9001"
)
View Source
const (
	DefaultAccessNodeIDSMinimumMainnet = 2
	DefaultAccessNodeIDSMinimum        = 1
)

Variables

This section is empty.

Functions

func DefaultAccessNodeIDS added in v0.23.0

func DefaultAccessNodeIDS(snapshot protocol.Snapshot) ([]flow.Identifier, error)

DefaultAccessNodeIDS will return all the access node IDS in the protocol state for staked access nodes

func FlowClient added in v0.22.8

func FlowClient(conf *FlowClientConfig) (*client.Client, error)

FlowClient will return a secure or insecure flow client depending on *FlowClientConfig.Insecure

func FlowIDFromHexString added in v0.23.0

func FlowIDFromHexString(accessNodeIDS ...string) ([]flow.Identifier, error)

FlowIDFromHexString convert flow node id(s) from hex string(s) to flow identifier(s)

func GetNodeInfoForProposedNodesScript added in v0.25.0

func GetNodeInfoForProposedNodesScript(network string) ([]byte, error)

GetNodeInfoForProposedNodesScript returns a script that will return an array of FlowIDTableStaking.NodeInfo for each node in the proposed table.

func InitProtocolState added in v0.12.0

func InitProtocolState(db *badger.DB, storages *storage.All) (protocol.State, error)

func InitStorage

func InitStorage(datadir string) *badger.DB

func InitStorageWithTruncate added in v0.11.0

func InitStorageWithTruncate(datadir string, truncate bool) *badger.DB

func InitStorages added in v0.12.0

func InitStorages(db *badger.DB) *storage.All

func PrettyPrint added in v0.13.0

func PrettyPrint(entity interface{})

PrettyPrint an interface

func PrettyPrintEntity added in v0.12.0

func PrettyPrintEntity(entity flow.Entity)

PrettyPrintEntity pretty print a flow entity

func ValidateAccessNodeIDSFlag added in v0.23.0

func ValidateAccessNodeIDSFlag(accessNodeIDS []string, chainID flow.ChainID, snapshot protocol.Snapshot) ([]flow.Identifier, error)

ValidateAccessNodeIDSFlag validates flag --access-node-ids and converts all ids to flow.Identifier

Types

type FlowClientConfig added in v0.22.8

type FlowClientConfig struct {
	AccessAddress    string
	AccessNodePubKey string
	AccessNodeID     flow.Identifier
	Insecure         bool
}

func FlowClientConfigs added in v0.22.8

func FlowClientConfigs(accessNodeIDS []flow.Identifier, insecureAccessAPI bool, snapshot protocol.Snapshot) ([]*FlowClientConfig, error)

FlowClientConfigs will assemble connection options for the flow client for each access node id

func NewFlowClientConfig added in v0.22.8

func NewFlowClientConfig(accessAddress, accessApiNodePubKey string, accessNodeID flow.Identifier, insecure bool) (*FlowClientConfig, error)

NewFlowClientConfig returns *FlowClientConfig

func (*FlowClientConfig) String added in v0.22.8

func (f *FlowClientConfig) String() string

Jump to

Keyboard shortcuts

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