client

package
v1.14.33 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: BSD-3-Clause Imports: 13 Imported by: 7

Documentation

Overview

Package client implements client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Ping(ctx context.Context) (*rpcpb.PingResponse, error)
	RPCVersion(ctx context.Context) (*rpcpb.RPCVersionResponse, error)
	Start(ctx context.Context, execPath string, opts ...OpOption) (*rpcpb.StartResponse, error)
	// CreateChains creates chains with VMs and genesis (uses rpcpb.CreateBlockchains)
	CreateChains(ctx context.Context, chainSpecs []*rpcpb.BlockchainSpec) (*rpcpb.CreateBlockchainsResponse, error)
	// CreateParticipantGroups creates participant groups (uses rpcpb.CreateChains)
	CreateParticipantGroups(ctx context.Context, participantsSpecs []*rpcpb.ChainSpec) (*rpcpb.CreateChainsResponse, error)
	TransformElasticChains(ctx context.Context, elasticChainSpecs []*rpcpb.ElasticChainSpec) (*rpcpb.TransformElasticChainsResponse, error)
	AddPermissionlessValidator(ctx context.Context, validatorSpec []*rpcpb.PermissionlessValidatorSpec) (*rpcpb.AddPermissionlessValidatorResponse, error)
	RemoveChainValidator(ctx context.Context, validatorSpec []*rpcpb.RemoveChainValidatorSpec) (*rpcpb.RemoveChainValidatorResponse, error)
	Health(ctx context.Context) (*rpcpb.HealthResponse, error)
	WaitForHealthy(ctx context.Context) (*rpcpb.WaitForHealthyResponse, error)
	URIs(ctx context.Context) ([]string, error)
	Status(ctx context.Context) (*rpcpb.StatusResponse, error)
	StreamStatus(ctx context.Context, pushInterval time.Duration) (<-chan *rpcpb.ClusterInfo, error)
	RemoveNode(ctx context.Context, name string) (*rpcpb.RemoveNodeResponse, error)
	PauseNode(ctx context.Context, name string) (*rpcpb.PauseNodeResponse, error)
	ResumeNode(ctx context.Context, name string) (*rpcpb.ResumeNodeResponse, error)
	RestartNode(ctx context.Context, name string, opts ...OpOption) (*rpcpb.RestartNodeResponse, error)
	AddNode(ctx context.Context, name string, execPath string, opts ...OpOption) (*rpcpb.AddNodeResponse, error)
	Stop(ctx context.Context) (*rpcpb.StopResponse, error)
	AttachPeer(ctx context.Context, nodeName string) (*rpcpb.AttachPeerResponse, error)
	SendOutboundMessage(ctx context.Context, nodeName string, peerID string, op uint32, msgBody []byte) (*rpcpb.SendOutboundMessageResponse, error)
	Close() error
	SaveSnapshot(ctx context.Context, snapshotName string) (*rpcpb.SaveSnapshotResponse, error)
	LoadSnapshot(ctx context.Context, snapshotName string, opts ...OpOption) (*rpcpb.LoadSnapshotResponse, error)
	RemoveSnapshot(ctx context.Context, snapshotName string) (*rpcpb.RemoveSnapshotResponse, error)
	GetSnapshotNames(ctx context.Context) ([]string, error)
}

func New

func New(cfg Config, logger log.Logger) (Client, error)

type Config

type Config struct {
	Endpoint    string
	DialTimeout time.Duration
}

type Op

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

type OpOption

type OpOption func(*Op)

func WithChainConfigFiles added in v1.6.1

func WithChainConfigFiles(chainConfigs map[string]string) OpOption

Map from chain id to its configuration json contents.

func WithChainConfigs

func WithChainConfigs(chainConfigs map[string]string) OpOption

Map from chain name to its configuration json contents.

func WithChainSpecs added in v1.6.1

func WithChainSpecs(chainSpecs []*rpcpb.BlockchainSpec) OpOption

WithChainSpecs sets the chain specifications for creating chains with VMs

func WithCustomNodeConfigs

func WithCustomNodeConfigs(customNodeConfigs map[string]string) OpOption

Map from node name to its custom node config

func WithDynamicPorts

func WithDynamicPorts(dynamicPorts bool) OpOption

func WithExecPath

func WithExecPath(execPath string) OpOption

func WithGlobalNodeConfig

func WithGlobalNodeConfig(nodeConfig string) OpOption

func WithNumChains added in v1.6.1

func WithNumChains(numChains uint32) OpOption

func WithNumNodes

func WithNumNodes(numNodes uint32) OpOption

func WithPluginDir

func WithPluginDir(pluginDir string) OpOption

func WithReassignPortsIfUsed

func WithReassignPortsIfUsed(reassignPortsIfUsed bool) OpOption

func WithRootDataDir

func WithRootDataDir(rootDataDir string) OpOption

func WithTrackChains added in v1.6.1

func WithTrackChains(trackChains string) OpOption

func WithUpgradeConfigs

func WithUpgradeConfigs(upgradeConfigs map[string]string) OpOption

Map from chain name to its upgrade json contents.

func WithWhitelistedChains added in v1.6.1

func WithWhitelistedChains(trackChains string) OpOption

Jump to

Keyboard shortcuts

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