admin

package
v0.7.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminSvcOpt

type AdminSvcOpt func(*Service)

func WithLogger

func WithLogger(logger log.Logger) AdminSvcOpt

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 {
	admpb.UnimplementedAdminServiceServer

	TxApp TxApp
	// contains filtered or unexported fields
}

Service is the implementation of the admpb.AdminServiceServer methods.

func NewService

func NewService(db sql.ReadTxMaker, blockchain BlockchainTransactor, txApp TxApp, signer auth.Signer, cfg *config.KwildConfig, chainId string, opts ...AdminSvcOpt) *Service

NewService constructs a new Service.

func (*Service) Approve

func (*Service) GetConfig

func (*Service) Join

func (*Service) JoinStatus

func (*Service) Leave

func (*Service) ListPendingJoins

func (*Service) ListValidators

func (*Service) Peers

func (svc *Service) Peers(ctx context.Context, req *admpb.PeersRequest) (*admpb.PeersResponse, error)

func (*Service) Remove

func (*Service) Status

func (svc *Service) Status(ctx context.Context, req *admpb.StatusRequest) (*admpb.StatusResponse, error)

func (*Service) Version

func (svc *Service) Version(ctx context.Context, req *admpb.VersionRequest) (*admpb.VersionResponse, error)

Version reports the compile-time kwild version.

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