Documentation ¶
Index ¶
- Variables
- type BlockchainTransactor
- type Service
- func (svc *Service) Approve(ctx context.Context, req *adminjson.ApproveRequest) (*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) 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) 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) 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) 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 Service ¶
type Service struct { TxApp TxApp // contains filtered or unexported fields }
func NewService ¶
func NewService(db sql.ReadTxMaker, blockchain BlockchainTransactor, txApp TxApp, signer auth.Signer, cfg *config.KwildConfig, chainID string, logger log.Logger) *Service
NewService constructs a new Service.
func (*Service) Approve ¶
func (svc *Service) Approve(ctx context.Context, req *adminjson.ApproveRequest) (*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) 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) 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)
type TxApp ¶
type TxApp interface { Price(ctx context.Context, tx *transactions.Transaction) (*big.Int, error) // 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, identifier []byte, unconfirmed bool) (balance *big.Int, nonce int64, err error) }
Click to show internal directories.
Click to hide internal directories.