client

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: BSD-3-Clause Imports: 14 Imported by: 22

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)
	CreateBlockchains(ctx context.Context, blockchainSpecs []*rpcpb.BlockchainSpec) (*rpcpb.CreateBlockchainsResponse, error)
	CreateSubnets(ctx context.Context, subnetSpecs []*rpcpb.SubnetSpec) (*rpcpb.CreateSubnetsResponse, error)
	TransformElasticSubnets(ctx context.Context, elasticSubnetSpecs []*rpcpb.ElasticSubnetSpec) (*rpcpb.TransformElasticSubnetsResponse, error)
	AddPermissionlessValidator(ctx context.Context, validatorSpec []*rpcpb.PermissionlessStakerSpec) (*rpcpb.AddPermissionlessValidatorResponse, error)
	AddPermissionlessDelegator(ctx context.Context, validatorSpec []*rpcpb.PermissionlessStakerSpec) (*rpcpb.AddPermissionlessDelegatorResponse, error)
	RemoveSubnetValidator(ctx context.Context, validatorSpec []*rpcpb.RemoveSubnetValidatorSpec) (*rpcpb.RemoveSubnetValidatorResponse, error)
	AddSubnetValidators(ctx context.Context, validatorSpec []*rpcpb.SubnetValidatorsSpec) (*rpcpb.AddSubnetValidatorsResponse, error)
	Health(ctx context.Context) (*rpcpb.HealthResponse, error)
	UpdateStatus(ctx context.Context) (*rpcpb.UpdateStatusResponse, 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, force bool, opts ...OpOption) (*rpcpb.SaveSnapshotResponse, error)
	LoadSnapshot(ctx context.Context, snapshotName string, inPlace bool, opts ...OpOption) (*rpcpb.LoadSnapshotResponse, error)
	RemoveSnapshot(ctx context.Context, snapshotName string, opts ...OpOption) (*rpcpb.RemoveSnapshotResponse, error)
	ListSnapshots(ctx context.Context) ([]string, error)
	ListSubnets(ctx context.Context) ([]string, error)
	ListBlockchains(ctx context.Context) ([]*rpcpb.CustomChainInfo, error)
	ListRpcs(ctx context.Context) ([]*rpcpb.BlockchainRpcs, error)
	VMID(ctx context.Context, vmName string) (string, error)
}

func New

func New(cfg Config, log logging.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 WithBlockchainSpecs

func WithBlockchainSpecs(blockchainSpecs []*rpcpb.BlockchainSpec) OpOption

Slice of BlockchainSpec

func WithBootstrapNodeIDs added in v1.9.0

func WithBootstrapNodeIDs(bootstrapNodeIDs []string) OpOption

func WithBootstrapNodeIPPortPairs added in v1.9.0

func WithBootstrapNodeIPPortPairs(bootstrapNodeIPPortPairs []string) OpOption

func WithChainConfigs

func WithChainConfigs(chainConfigs map[string]string) OpOption

Map from chain name to its configuration json contents.

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 WithFreshStakingIds added in v1.9.0

func WithFreshStakingIds(freshStakingIds bool) OpOption

func WithGenesisPath added in v1.9.0

func WithGenesisPath(genesisPath string) OpOption

func WithGlobalNodeConfig

func WithGlobalNodeConfig(nodeConfig string) OpOption

func WithLogRootDir added in v1.9.0

func WithLogRootDir(logRootDir string) OpOption

func WithNetworkID added in v1.9.0

func WithNetworkID(networkID uint32) OpOption

func WithNumNodes

func WithNumNodes(numNodes uint32) OpOption

func WithNumSubnets

func WithNumSubnets(numSubnets uint32) OpOption

func WithPluginDir

func WithPluginDir(pluginDir string) OpOption

func WithReassignPortsIfUsed

func WithReassignPortsIfUsed(reassignPortsIfUsed bool) OpOption

func WithRootDataDir

func WithRootDataDir(rootDataDir string) OpOption

func WithSnapshotPath added in v1.9.0

func WithSnapshotPath(snapshotPath string) OpOption

func WithSubnetConfigs

func WithSubnetConfigs(subnetConfigs map[string]string) OpOption

Map from subnet id to its configuration json contents.

func WithTrackSubnets

func WithTrackSubnets(trackSubnets string) OpOption

func WithUpgradeConfigs

func WithUpgradeConfigs(upgradeConfigs map[string]string) OpOption

Map from chain name to its upgrade json contents.

func WithUpgradePath added in v1.9.0

func WithUpgradePath(upgradePath string) OpOption

func WithWalletPrivateKey added in v1.9.0

func WithWalletPrivateKey(walletPrivateKey string) OpOption

func WithWhitelistedSubnets

func WithWhitelistedSubnets(trackSubnets string) OpOption

func WithZeroIP added in v1.9.0

func WithZeroIP(zeroIP bool) OpOption

Jump to

Keyboard shortcuts

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