adminjson

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package adminjson defines the admin service's method names, request objects, and response objects.

Index

Constants

View Source
const (
	MethodHealth            jsonrpc.Method = "admin.health"
	MethodVersion           jsonrpc.Method = "admin.version"
	MethodStatus            jsonrpc.Method = "admin.status"
	MethodPeers             jsonrpc.Method = "admin.peers"
	MethodConfig            jsonrpc.Method = "admin.config"
	MethodValApprove        jsonrpc.Method = "admin.val_approve"
	MethodValJoin           jsonrpc.Method = "admin.val_join"
	MethodValRemove         jsonrpc.Method = "admin.val_remove"
	MethodValLeave          jsonrpc.Method = "admin.val_leave"
	MethodValJoinStatus     jsonrpc.Method = "admin.val_join_status"
	MethodValList           jsonrpc.Method = "admin.val_list"
	MethodValListJoins      jsonrpc.Method = "admin.val_list_joins"
	MethodAddPeer           jsonrpc.Method = "admin.add_peer"
	MethodRemovePeer        jsonrpc.Method = "admin.remove_peer"
	MethodListPeers         jsonrpc.Method = "admin.list_peers"
	MethodCreateResolution  jsonrpc.Method = "admin.create_resolution"
	MethodApproveResolution jsonrpc.Method = "admin.approve_resolution"
	MethodResolutionStatus  jsonrpc.Method = "admin.resolution_status"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApproveRequest

type ApproveRequest struct {
	PubKey []byte `json:"pubkey"`
}

type ApproveResolutionRequest added in v0.3.0

type ApproveResolutionRequest struct {
	ResolutionID *types.UUID `json:"resolution_id"` // Id is the resolution ID
}

type CreateResolutionRequest added in v0.3.0

type CreateResolutionRequest struct {
	Resolution     []byte `json:"resolution"`
	ResolutionType string `json:"resolution_type"`
}

type GetConfigRequest

type GetConfigRequest struct{}

type GetConfigResponse

type GetConfigResponse struct {
	Config []byte `json:"config,omitempty"`
}

type HealthResponse added in v0.3.0

type HealthResponse struct {
	Version       string         `json:"version"`
	Healthy       bool           `json:"healthy"`
	Validator     bool           `json:"is_validator"`
	PubKey        types.HexBytes `json:"pubkey"`
	NumValidators int            `json:"num_validators"`
}

HealthResponse is the health check response.

type JoinRequest

type JoinRequest struct{}

type JoinStatusRequest

type JoinStatusRequest struct {
	PubKey []byte `json:"pubkey"`
}

type JoinStatusResponse

type JoinStatusResponse struct {
	JoinRequest *PendingJoin `json:"join_request,omitempty"`
}

type LeaveRequest

type LeaveRequest struct{}

type ListJoinRequestsRequest

type ListJoinRequestsRequest struct{}

type ListJoinRequestsResponse

type ListJoinRequestsResponse struct {
	JoinRequests []*PendingJoin `json:"join_requests,omitempty"`
}

type ListPeersRequest added in v0.3.0

type ListPeersRequest struct{}

type ListPeersResponse added in v0.3.0

type ListPeersResponse struct {
	Peers []string `json:"peers,omitempty"`
}

List of peers in the node's whitelist. These are the peers the node will accept connections from.

type ListValidatorsRequest

type ListValidatorsRequest struct{}

type ListValidatorsResponse

type ListValidatorsResponse struct {
	Validators []*Validator `json:"validators,omitempty"`
}

type NodeInfo

type NodeInfo = adminTypes.NodeInfo

type PeerRequest added in v0.3.0

type PeerRequest struct {
	PeerID string `json:"peerid"`
}

type PeerResponse added in v0.3.0

type PeerResponse struct{}

type PeersRequest

type PeersRequest struct{}

type PeersResponse

type PeersResponse struct {
	Peers []*adminTypes.PeerInfo `json:"peers"`
}

type PendingJoin

type PendingJoin = types.JoinRequest

type RemoveRequest

type RemoveRequest struct {
	PubKey []byte `json:"pubkey"`
}

type ResolutionStatusRequest added in v0.3.0

type ResolutionStatusRequest struct {
	ResolutionID *types.UUID `json:"resolution_id"` // Id is the resolution ID
}

type ResolutionStatusResponse added in v0.3.0

type ResolutionStatusResponse struct {
	Status *types.PendingResolution `json:"status,omitempty"`
}

type StatusRequest

type StatusRequest struct{}

type StatusResponse

type StatusResponse struct {
	Node      *NodeInfo             `json:"node,omitempty"`
	Sync      *SyncInfo             `json:"sync,omitempty"`
	Validator *Validator            `json:"validator,omitempty"`
	Migration *types.MigrationState `json:"migration,omitempty"`
}

type SyncInfo

type SyncInfo struct {
	AppHash         string `json:"app_hash,omitempty"`
	BestBlockHash   string `json:"best_block_hash,omitempty"`
	BestBlockHeight int64  `json:"best_block_height,omitempty"`
	BestBlockTime   int64  `json:"best_block_time,omitempty"` // epoch *milliseconds*
	Syncing         bool   `json:"syncing,omitempty"`
}

SyncInfo is modified from adminTypes to have BestBlockTime be a unix epoch in milliseconds.

type Validator

type Validator = types.Validator

type SyncInfo = adminTypes.SyncInfo type Validator = adminTypes.ValidatorInfo

Jump to

Keyboard shortcuts

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