cluster

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: GPL-3.0, GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster represent a set of nodes (validators) that are managed together

func New

func New(env *env.Environment, cfg Config) *Cluster

New creates a new cluster instance

func (*Cluster) Init

func (cl *Cluster) Init() error

Init will initialize the nodes This implies running `geth init` but also configuring static nodes and node accounts

func (*Cluster) PrintNodeInfo

func (cl *Cluster) PrintNodeInfo() error

PrintNodeInfo prints debug information about nodes

func (*Cluster) Run

func (cl *Cluster) Run(ctx context.Context) error

Run will run all the cluster nodes

type Config

type Config struct {
	GethPath   string
	ExtraFlags string
}

type Node

type Node struct {
	*NodeConfig
}

Node represents a Node runner

func NewNode

func NewNode(cfg *NodeConfig) *Node

NewNode creates a node runner

func (*Node) AccountAddresses

func (n *Node) AccountAddresses() []common.Address

AccountAddresses retrieves the list of accounts currently configured in the node

func (*Node) EnodeURL

func (n *Node) EnodeURL() (string, error)

EnodeURL returns the enode url used by the node

func (*Node) Init

func (n *Node) Init(GenesisJSON string) error

Init will run `geth init` on the node along other initialization procedures that need to happen before we run the node

func (*Node) Run

func (n *Node) Run(ctx context.Context) error

Run will run the node

func (*Node) SetStaticNodes

func (n *Node) SetStaticNodes(enodeUrls ...string) error

SetStaticNodes configures static nodes to be used on the node

type NodeConfig

type NodeConfig struct {
	GethPath              string
	ExtraFlags            string
	ChainID               *big.Int
	Number                int
	Account               env.Account
	TxFeeRecipientAccount env.Account
	OtherAccounts         []env.Account
	Datadir               string
}

NodeConfig represents the configuration of a atlas-blockchain node runner

func (*NodeConfig) NodePort

func (nc *NodeConfig) NodePort() int64

NodePort is the node port this node will use

func (*NodeConfig) RPCPort

func (nc *NodeConfig) RPCPort() int64

RPCPort is the rpc port this node will use

Jump to

Keyboard shortcuts

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