client

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: BSD-3-Clause Imports: 14 Imported by: 26

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)
	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, 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 added in v1.2.0

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

Slice of BlockchainSpec

func WithChainConfigs added in v1.1.3

func WithChainConfigs(chainConfigs map[string]string) OpOption

Map from chain name to its configuration json contents.

func WithCustomNodeConfigs added in v1.0.13

func WithCustomNodeConfigs(customNodeConfigs map[string]string) OpOption

Map from node name to its custom node config

func WithDynamicPorts added in v1.2.3

func WithDynamicPorts(dynamicPorts bool) OpOption

func WithExecPath added in v1.0.11

func WithExecPath(execPath string) OpOption

func WithGlobalNodeConfig added in v1.0.13

func WithGlobalNodeConfig(nodeConfig string) OpOption

func WithNumNodes added in v1.0.9

func WithNumNodes(numNodes uint32) OpOption

func WithNumSubnets added in v1.1.1

func WithNumSubnets(numSubnets uint32) OpOption

func WithPluginDir added in v1.0.11

func WithPluginDir(pluginDir string) OpOption

func WithReassignPortsIfUsed added in v1.2.3

func WithReassignPortsIfUsed(reassignPortsIfUsed bool) OpOption

func WithRootDataDir added in v1.0.11

func WithRootDataDir(rootDataDir string) OpOption

func WithSubnetConfigs added in v1.3.2

func WithSubnetConfigs(subnetConfigs map[string]string) OpOption

Map from subnet id to its configuration json contents.

func WithTrackSubnets added in v1.3.6

func WithTrackSubnets(trackSubnets string) OpOption

func WithUpgradeConfigs added in v1.2.1

func WithUpgradeConfigs(upgradeConfigs map[string]string) OpOption

Map from chain name to its upgrade json contents.

func WithWhitelistedSubnets

func WithWhitelistedSubnets(trackSubnets string) OpOption

Jump to

Keyboard shortcuts

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