Documentation ¶
Index ¶
- type AdminSvcOpt
- type BlockchainTransactor
- type Service
- func (s *Service) Approve(ctx context.Context, req *admpb.ApproveRequest) (*txpb.BroadcastResponse, error)
- func (s *Service) GetConfig(ctx context.Context, req *admpb.GetConfigRequest) (*admpb.GetConfigResponse, error)
- func (s *Service) Join(ctx context.Context, req *admpb.JoinRequest) (*txpb.BroadcastResponse, error)
- func (s *Service) JoinStatus(ctx context.Context, req *admpb.JoinStatusRequest) (*admpb.JoinStatusResponse, error)
- func (s *Service) Leave(ctx context.Context, req *admpb.LeaveRequest) (*txpb.BroadcastResponse, error)
- func (s *Service) ListPendingJoins(ctx context.Context, req *admpb.ListJoinRequestsRequest) (*admpb.ListJoinRequestsResponse, error)
- func (s *Service) ListValidators(ctx context.Context, req *admpb.ListValidatorsRequest) (*admpb.ListValidatorsResponse, error)
- func (svc *Service) Peers(ctx context.Context, req *admpb.PeersRequest) (*admpb.PeersResponse, error)
- func (s *Service) Remove(ctx context.Context, req *admpb.RemoveRequest) (*txpb.BroadcastResponse, error)
- func (svc *Service) Status(ctx context.Context, req *admpb.StatusRequest) (*admpb.StatusResponse, error)
- func (svc *Service) Version(ctx context.Context, req *admpb.VersionRequest) (*admpb.VersionResponse, error)
- type TxApp
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 (s *Service) Approve(ctx context.Context, req *admpb.ApproveRequest) (*txpb.BroadcastResponse, error)
func (*Service) GetConfig ¶
func (s *Service) GetConfig(ctx context.Context, req *admpb.GetConfigRequest) (*admpb.GetConfigResponse, error)
func (*Service) Join ¶
func (s *Service) Join(ctx context.Context, req *admpb.JoinRequest) (*txpb.BroadcastResponse, error)
func (*Service) JoinStatus ¶
func (s *Service) JoinStatus(ctx context.Context, req *admpb.JoinStatusRequest) (*admpb.JoinStatusResponse, error)
func (*Service) Leave ¶
func (s *Service) Leave(ctx context.Context, req *admpb.LeaveRequest) (*txpb.BroadcastResponse, error)
func (*Service) ListPendingJoins ¶
func (s *Service) ListPendingJoins(ctx context.Context, req *admpb.ListJoinRequestsRequest) (*admpb.ListJoinRequestsResponse, error)
func (*Service) ListValidators ¶
func (s *Service) ListValidators(ctx context.Context, req *admpb.ListValidatorsRequest) (*admpb.ListValidatorsResponse, error)
func (*Service) Peers ¶
func (svc *Service) Peers(ctx context.Context, req *admpb.PeersRequest) (*admpb.PeersResponse, error)
func (*Service) Remove ¶
func (s *Service) Remove(ctx context.Context, req *admpb.RemoveRequest) (*txpb.BroadcastResponse, error)
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) }
Click to show internal directories.
Click to hide internal directories.