adminclient

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*userClient.Client // expose all user service methods, and CallMethod for admin svc
}

Client is an admin RPC client. It provides all methods of the user RPC service, plus methods that are specific to the admin service.

func NewClient

func NewClient(u *url.URL, opts ...rpcclient.RPCClientOpts) *Client

NewClient constructs a new admin Client.

func WrapUserClient

func WrapUserClient(cl *userClient.Client) *Client

WrapUserClient can be used to construct a new admin Client from an existing user RPC client.

func (*Client) Approve

func (cl *Client) Approve(ctx context.Context, publicKey []byte) ([]byte, error)

Approve approves a validator join request for the validator identified by a public key. The transaction hash for the broadcasted approval transaction is returned.

func (*Client) GetConfig

func (cl *Client) GetConfig(ctx context.Context) ([]byte, error)

GetConfig gets the current config from the node. It returns the config serialized as JSON.

func (*Client) Join

func (cl *Client) Join(ctx context.Context) ([]byte, error)

Join makes a validator join request for the node being administered. The transaction hash for the broadcasted join transaction is returned.

func (*Client) JoinStatus

func (cl *Client) JoinStatus(ctx context.Context, pubkey []byte) (*types.JoinRequest, error)

JoinStatus returns the status of an active join request for the validator identified by the public key.

func (*Client) Leave

func (cl *Client) Leave(ctx context.Context) ([]byte, error)

Leave makes a validator leave request for the node being administered. The transaction hash for the broadcasted leave transaction is returned.

func (*Client) ListPendingJoins

func (cl *Client) ListPendingJoins(ctx context.Context) ([]*types.JoinRequest, error)

ListPendingJoins lists all active validator join requests.

func (*Client) ListValidators

func (cl *Client) ListValidators(ctx context.Context) ([]*types.Validator, error)

ListValidators gets the current validator set.

func (*Client) Peers

func (cl *Client) Peers(ctx context.Context) ([]*adminTypes.PeerInfo, error)

Peers lists the nodes current peers (p2p node connections).

func (*Client) Ping

func (cl *Client) Ping(ctx context.Context) (string, error)

Ping just tests RPC connectivity. The expected response is "pong".

func (*Client) Remove

func (cl *Client) Remove(ctx context.Context, publicKey []byte) ([]byte, error)

Remove votes to remove the validator specified by the given public key.

func (*Client) Status

func (cl *Client) Status(ctx context.Context) (*adminTypes.Status, error)

Status gets the node's status, such as it's name, chain ID, versions, sync status, best block info, and validator identity.

func (*Client) Version

func (cl *Client) Version(ctx context.Context) (string, error)

Version reports the version of the running node.

Jump to

Keyboard shortcuts

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