Documentation ¶
Index ¶
- Variables
- type BlockchainTransactor
- type P2P
- type Pricer
- type Service
- func (svc *Service) AddPeer(ctx context.Context, req *adminjson.PeerRequest) (*adminjson.PeerResponse, *jsonrpc.Error)
- func (svc *Service) Approve(ctx context.Context, req *adminjson.ApproveRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
- func (svc *Service) ApproveResolution(ctx context.Context, req *adminjson.ApproveResolutionRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
- func (svc *Service) CreateResolution(ctx context.Context, req *adminjson.CreateResolutionRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
- func (svc *Service) GetConfig(ctx context.Context, req *adminjson.GetConfigRequest) (*adminjson.GetConfigResponse, *jsonrpc.Error)
- func (svc *Service) Handlers() map[jsonrpc.Method]rpcserver.MethodHandler
- func (svc *Service) Health(ctx context.Context) (json.RawMessage, bool)
- func (svc *Service) HealthMethod(ctx context.Context, _ *userjson.HealthRequest) (*adminjson.HealthResponse, *jsonrpc.Error)
- func (svc *Service) Join(ctx context.Context, req *adminjson.JoinRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
- func (svc *Service) JoinStatus(ctx context.Context, req *adminjson.JoinStatusRequest) (*adminjson.JoinStatusResponse, *jsonrpc.Error)
- func (svc *Service) Leave(ctx context.Context, req *adminjson.LeaveRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
- func (svc *Service) ListPeers(ctx context.Context, req *adminjson.PeersRequest) (*adminjson.ListPeersResponse, *jsonrpc.Error)
- func (svc *Service) ListPendingJoins(ctx context.Context, req *adminjson.ListJoinRequestsRequest) (*adminjson.ListJoinRequestsResponse, *jsonrpc.Error)
- func (svc *Service) ListValidators(ctx context.Context, req *adminjson.ListValidatorsRequest) (*adminjson.ListValidatorsResponse, *jsonrpc.Error)
- func (svc *Service) Methods() map[jsonrpc.Method]rpcserver.MethodDef
- func (svc *Service) Name() string
- func (svc *Service) Peers(ctx context.Context, _ *adminjson.PeersRequest) (*adminjson.PeersResponse, *jsonrpc.Error)
- func (svc *Service) Remove(ctx context.Context, req *adminjson.RemoveRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
- func (svc *Service) RemovePeer(ctx context.Context, req *adminjson.PeerRequest) (*adminjson.PeerResponse, *jsonrpc.Error)
- func (svc *Service) ResolutionStatus(ctx context.Context, req *adminjson.ResolutionStatusRequest) (*adminjson.ResolutionStatusResponse, *jsonrpc.Error)
- func (svc *Service) Status(ctx context.Context, req *adminjson.StatusRequest) (*adminjson.StatusResponse, *jsonrpc.Error)
- type TxApp
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SpecInfo = openrpc.Info{ Title: "Kwil DB admin service", Description: `The JSON-RPC admin service for Kwil DB.`, License: &openrpc.License{ Name: "CC0-1.0", URL: "https://creativecommons.org/publicdomain/zero/1.0/legalcode", }, Version: "0.1.0", } )
Functions ¶
This section is empty.
Types ¶
type BlockchainTransactor ¶
type BlockchainTransactor interface { Status(context.Context) (*types.Status, error) Peers(context.Context) ([]*types.PeerInfo, error) BroadcastTx(ctx context.Context, tx []byte, sync uint8) (*cmtCoreTypes.ResultBroadcastTx, error) }
BlockchainTransactor specifies the methods required for the admin service to interact with the blockchain.
type P2P ¶ added in v0.9.0
type P2P interface { // AddPeer adds a peer to the node's peer list and persists it. AddAndPersistPeer(ctx context.Context, nodeID string) error // RemovePeer removes a peer from the node's peer list permanently. RemovePersistedPeer(ctx context.Context, nodeID string) error // ListPeers returns the list of peers in the node's whitelist. ListPeers(ctx context.Context) []string }
type Pricer ¶ added in v0.9.0
type Pricer interface {
Price(ctx context.Context, db sql.DB, tx *transactions.Transaction) (*big.Int, error)
}
type Service ¶
type Service struct { TxApp TxApp // contains filtered or unexported fields }
func NewService ¶
func NewService(db sql.DelayedReadTxMaker, blockchain BlockchainTransactor, txApp TxApp, pricer Pricer, p2p P2P, signer auth.Signer, cfg *config.KwildConfig, chainID string, logger log.Logger) *Service
NewService constructs a new Service.
func (*Service) AddPeer ¶ added in v0.9.0
func (svc *Service) AddPeer(ctx context.Context, req *adminjson.PeerRequest) (*adminjson.PeerResponse, *jsonrpc.Error)
func (*Service) Approve ¶
func (svc *Service) Approve(ctx context.Context, req *adminjson.ApproveRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
func (*Service) ApproveResolution ¶ added in v0.9.0
func (svc *Service) ApproveResolution(ctx context.Context, req *adminjson.ApproveResolutionRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
func (*Service) CreateResolution ¶ added in v0.9.0
func (svc *Service) CreateResolution(ctx context.Context, req *adminjson.CreateResolutionRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
func (*Service) GetConfig ¶
func (svc *Service) GetConfig(ctx context.Context, req *adminjson.GetConfigRequest) (*adminjson.GetConfigResponse, *jsonrpc.Error)
func (*Service) Handlers ¶
func (svc *Service) Handlers() map[jsonrpc.Method]rpcserver.MethodHandler
func (*Service) HealthMethod ¶ added in v0.9.0
func (svc *Service) HealthMethod(ctx context.Context, _ *userjson.HealthRequest) (*adminjson.HealthResponse, *jsonrpc.Error)
HealthMethod is a JSON-RPC method handler for service health.
func (*Service) Join ¶
func (svc *Service) Join(ctx context.Context, req *adminjson.JoinRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
func (*Service) JoinStatus ¶
func (svc *Service) JoinStatus(ctx context.Context, req *adminjson.JoinStatusRequest) (*adminjson.JoinStatusResponse, *jsonrpc.Error)
func (*Service) Leave ¶
func (svc *Service) Leave(ctx context.Context, req *adminjson.LeaveRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
func (*Service) ListPeers ¶ added in v0.9.0
func (svc *Service) ListPeers(ctx context.Context, req *adminjson.PeersRequest) (*adminjson.ListPeersResponse, *jsonrpc.Error)
func (*Service) ListPendingJoins ¶
func (svc *Service) ListPendingJoins(ctx context.Context, req *adminjson.ListJoinRequestsRequest) (*adminjson.ListJoinRequestsResponse, *jsonrpc.Error)
func (*Service) ListValidators ¶
func (svc *Service) ListValidators(ctx context.Context, req *adminjson.ListValidatorsRequest) (*adminjson.ListValidatorsResponse, *jsonrpc.Error)
func (*Service) Peers ¶
func (svc *Service) Peers(ctx context.Context, _ *adminjson.PeersRequest) (*adminjson.PeersResponse, *jsonrpc.Error)
func (*Service) Remove ¶
func (svc *Service) Remove(ctx context.Context, req *adminjson.RemoveRequest) (*userjson.BroadcastResponse, *jsonrpc.Error)
func (*Service) RemovePeer ¶ added in v0.9.0
func (svc *Service) RemovePeer(ctx context.Context, req *adminjson.PeerRequest) (*adminjson.PeerResponse, *jsonrpc.Error)
func (*Service) ResolutionStatus ¶ added in v0.9.0
func (svc *Service) ResolutionStatus(ctx context.Context, req *adminjson.ResolutionStatusRequest) (*adminjson.ResolutionStatusResponse, *jsonrpc.Error)
type TxApp ¶
type TxApp interface { // AccountInfo returns the unconfirmed account info for the given identifier. // If unconfirmed is true, the account found in the mempool is returned. // Otherwise, the account found in the blockchain is returned. AccountInfo(ctx context.Context, db sql.DB, identifier []byte, unconfirmed bool) (balance *big.Int, nonce int64, err error) }
Click to show internal directories.
Click to hide internal directories.