e2e

package
v0.0.0-...-2be76b0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeValidator Mode = "validator"
	ModeFull      Mode = "full"
	ModeLight     Mode = "light"
	ModeSeed      Mode = "seed"

	ProtocolBuiltin Protocol = "builtin"
	ProtocolFile    Protocol = "file"
	ProtocolGRPC    Protocol = "grpc"
	ProtocolTCP     Protocol = "tcp"
	ProtocolUNIX    Protocol = "unix"

	PerturbationDisconnect Perturbation = "disconnect"
	PerturbationKill       Perturbation = "kill"
	PerturbationPause      Perturbation = "pause"
	PerturbationRestart    Perturbation = "restart"
	PerturbationUpgrade    Perturbation = "upgrade"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InfrastructureData

type InfrastructureData struct {
	Provider  string                  `json:"provider"`
	Instances map[string]InstanceData `json:"instances"`
	Network   string                  `json:"network"`
}

func InfrastructureDataFromFile

func InfrastructureDataFromFile(path string) (InfrastructureData, error)

func NewDockerInfrastructureData

func NewDockerInfrastructureData(m Manifest) (InfrastructureData, error)

type InstanceData

type InstanceData struct {
	IPAddress net.IP `json:"ip_address"`
}

type Manifest

type Manifest struct {
	IPv6                 bool                        `toml:"ipv6"`
	InitialHeight        int64                       `toml:"initial_height"`
	InitialState         map[string]string           `toml:"initial_state"`
	Validators           *map[string]int64           `toml:"validators"`
	ValidatorUpdates     map[string]map[string]int64 `toml:"validator_update"`
	Nodes                map[string]*ManifestNode    `toml:"node"`
	KeyType              string                      `toml:"key_type"`
	Evidence             int                         `toml:"evidence"`
	ABCIProtocol         string                      `toml:"abci_protocol"`
	PrepareProposalDelay time.Duration               `toml:"prepare_proposal_delay"`
	ProcessProposalDelay time.Duration               `toml:"process_proposal_delay"`
	CheckTxDelay         time.Duration               `toml:"check_tx_delay"`
	UpgradeVersion       string                      `toml:"upgrade_version"`
	LoadTxSizeBytes      int                         `toml:"load_tx_size_bytes"`
	LoadTxBatchSize      int                         `toml:"load_tx_batch_size"`
	LoadTxConnections    int                         `toml:"load_tx_connections"`
	Prometheus           bool                        `toml:"prometheus"`
}

func LoadManifest

func LoadManifest(file string) (Manifest, error)

func (*Manifest) Save

func (m *Manifest) Save(file string) error

type ManifestNode

type ManifestNode struct {
	Mode             string   `toml:"mode"`
	Version          string   `toml:"version"`
	Seeds            []string `toml:"seeds"`
	PersistentPeers  []string `toml:"persistent_peers"`
	Database         string   `toml:"database"`
	PrivvalProtocol  string   `toml:"privval_protocol"`
	StartAt          int64    `toml:"start_at"`
	BlockSync        string   `toml:"block_sync"`
	Mempool          string   `toml:"mempool_version"`
	StateSync        bool     `toml:"state_sync"`
	PersistInterval  *uint64  `toml:"persist_interval"`
	SnapshotInterval uint64   `toml:"snapshot_interval"`
	RetainBlocks     uint64   `toml:"retain_blocks"`
	Perturb          []string `toml:"perturb"`
	SendNoLoad       bool     `toml:"send_no_load"`
}

type Mode

type Mode string

type Node

type Node struct {
	Name                string
	Version             string
	Testnet             *Testnet
	Mode                Mode
	PrivvalKey          crypto.PrivKey
	NodeKey             crypto.PrivKey
	IP                  net.IP
	ProxyPort           uint32
	StartAt             int64
	BlockSync           string
	StateSync           bool
	Mempool             string
	Database            string
	ABCIProtocol        Protocol
	PrivvalProtocol     Protocol
	PersistInterval     uint64
	SnapshotInterval    uint64
	RetainBlocks        uint64
	Seeds               []*Node
	PersistentPeers     []*Node
	Perturbations       []Perturbation
	SendNoLoad          bool
	Prometheus          bool
	PrometheusProxyPort uint32
}

func (Node) AddressP2P

func (n Node) AddressP2P(withID bool) string

Address returns a P2P endpoint address for the node.

func (Node) AddressRPC

func (n Node) AddressRPC() string

Address returns an RPC endpoint address for the node.

func (Node) Client

func (n Node) Client() (*rpchttp.HTTP, error)

Client returns an RPC client for a node.

func (Node) Stateless

func (n Node) Stateless() bool

Stateless returns true if the node is either a seed node or a light node

func (Node) Validate

func (n Node) Validate(testnet Testnet) error

Validate validates a node.

type Perturbation

type Perturbation string

type Protocol

type Protocol string

type Testnet

type Testnet struct {
	Name                 string
	File                 string
	Dir                  string
	IP                   *net.IPNet
	InitialHeight        int64
	InitialState         map[string]string
	Validators           map[*Node]int64
	ValidatorUpdates     map[int64]map[*Node]int64
	Nodes                []*Node
	KeyType              string
	Evidence             int
	LoadTxSizeBytes      int
	LoadTxBatchSize      int
	LoadTxConnections    int
	ABCIProtocol         string
	PrepareProposalDelay time.Duration
	ProcessProposalDelay time.Duration
	CheckTxDelay         time.Duration
	UpgradeVersion       string
	Prometheus           bool
}

func LoadTestnet

func LoadTestnet(manifest Manifest, fname string, ifd InfrastructureData) (*Testnet, error)

func (Testnet) ArchiveNodes

func (t Testnet) ArchiveNodes() []*Node

ArchiveNodes returns a list of archive nodes that start at the initial height and contain the entire blockchain history. They are used e.g. as light client RPC servers.

func (Testnet) HasPerturbations

func (t Testnet) HasPerturbations() bool

HasPerturbations returns whether the network has any perturbations.

func (Testnet) IPv6

func (t Testnet) IPv6() bool

IPv6 returns true if the testnet is an IPv6 network.

func (Testnet) LookupNode

func (t Testnet) LookupNode(name string) *Node

LookupNode looks up a node by name. For now, simply do a linear search.

func (Testnet) RandomNode

func (t Testnet) RandomNode() *Node

RandomNode returns a random non-seed node.

func (Testnet) Validate

func (t Testnet) Validate() error

Validate validates a testnet.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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