adminsvc

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

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 (*Service) GetConfig

func (*Service) Handlers

func (svc *Service) Handlers() map[jsonrpc.Method]rpcserver.MethodHandler

func (*Service) Join

func (*Service) JoinStatus

func (*Service) Leave

func (*Service) Methods

func (svc *Service) Methods() map[jsonrpc.Method]rpcserver.MethodDef

func (*Service) Peers

func (*Service) Remove

func (*Service) Status

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)
}

Jump to

Keyboard shortcuts

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