grpcserver

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 41 Imported by: 0

Documentation

Overview

Package config provides configuration for GRPC and HTTP api servers

Package grpcserver is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var ServerOptions = []grpc.ServerOption{

	grpc.KeepaliveParams(keepalive.ServerParameters{
		MaxConnectionIdle:     time.Minute * 120,
		MaxConnectionAge:      time.Minute * 180,
		MaxConnectionAgeGrace: time.Minute * 10,
		Time:                  time.Minute,
		Timeout:               time.Minute * 3,
	}),
}

ServerOptions are shared by all grpc servers.

Functions

func NewActivationService added in v1.0.0

func NewActivationService(atxProvider atxProvider, goldenAtx types.ATXID, lg log.Logger) *activationService

Types

type AdminService added in v1.0.0

type AdminService struct {
	// contains filtered or unexported fields
}

AdminService exposes endpoints for node administration.

func NewAdminService added in v1.0.0

func NewAdminService(db *sql.Database, dataDir string, lg log.Logger) *AdminService

NewAdminService creates a new admin grpc service.

func (AdminService) CheckpointStream added in v1.0.0

func (AdminService) EventsStream added in v1.0.0

func (AdminService) Recover added in v1.0.0

func (AdminService) RegisterService added in v1.0.0

func (a AdminService) RegisterService(server *Server)

RegisterService registers this service with a grpc server instance.

type Config added in v1.0.0

type Config struct {
	PublicServices  []Service `mapstructure:"grpc-public-services"`
	PublicListener  string    `mapstructure:"grpc-public-listener"`
	PrivateServices []Service `mapstructure:"grpc-private-services"`
	PrivateListener string    `mapstructure:"grpc-private-listener"`
	GrpcSendMsgSize int       `mapstructure:"grpc-send-msg-size"`
	GrpcRecvMsgSize int       `mapstructure:"grpc-recv-msg-size"`
	JSONListener    string    `mapstructure:"grpc-json-listener"`

	SmesherStreamInterval time.Duration
}

func DefaultConfig added in v1.0.0

func DefaultConfig() Config

DefaultConfig defines the default configuration options for api.

func DefaultTestConfig added in v1.0.0

func DefaultTestConfig() Config

DefaultTestConfig returns the default config for tests.

type DebugService added in v0.1.16

type DebugService struct {
	// contains filtered or unexported fields
}

DebugService exposes global state data, output from the STF.

func NewDebugService added in v0.1.16

func NewDebugService(db *sql.Database, conState conservativeState, host networkIdentity, oracle oracle, lg log.Logger) *DebugService

NewDebugService creates a new grpc service using config data.

func (DebugService) Accounts added in v0.1.16

Accounts returns current counter and balance for all accounts.

func (DebugService) ActiveSet added in v1.0.0

ActiveSet query provides hare active set for the specified epoch.

func (DebugService) NetworkInfo added in v1.0.0

func (d DebugService) NetworkInfo(ctx context.Context, _ *empty.Empty) (*pb.NetworkInfoResponse, error)

NetworkInfo query provides NetworkInfoResponse.

func (DebugService) ProposalsStream added in v1.0.0

func (d DebugService) ProposalsStream(_ *emptypb.Empty, stream pb.DebugService_ProposalsStreamServer) error

ProposalsStream streams all proposals confirmed by hare.

func (DebugService) RegisterService added in v0.1.16

func (d DebugService) RegisterService(server *Server)

RegisterService registers this service with a grpc server instance.

type GlobalStateService

type GlobalStateService struct {
	// contains filtered or unexported fields
}

GlobalStateService exposes global state data, output from the STF.

func NewGlobalStateService

func NewGlobalStateService(msh meshAPI, conState conservativeState, lg log.Logger) *GlobalStateService

NewGlobalStateService creates a new grpc service using config data.

func (GlobalStateService) Account

Account returns current and projected counter and balance for one account.

func (GlobalStateService) AccountDataQuery

AccountDataQuery returns historical account data such as rewards and receipts.

func (GlobalStateService) AccountDataStream

AccountDataStream exposes a stream of account-related data.

func (GlobalStateService) AppEventStream

AppEventStream exposes a stream of emitted app events.

func (GlobalStateService) GlobalStateHash

GlobalStateHash returns the latest layer and its computed global state hash.

func (GlobalStateService) GlobalStateStream

GlobalStateStream exposes a stream of global data data items: rewards, receipts, account info, global state hash.

func (GlobalStateService) RegisterService

func (s GlobalStateService) RegisterService(server *Server)

RegisterService registers this service with a grpc server instance.

func (GlobalStateService) SmesherDataQuery

SmesherDataQuery returns historical info on smesher rewards.

func (GlobalStateService) SmesherRewardStream

SmesherRewardStream exposes a stream of smesher rewards.

type JSONHTTPServer

type JSONHTTPServer struct {
	// contains filtered or unexported fields
}

JSONHTTPServer is a JSON http server providing the Spacemesh API. It is implemented using a grpc-gateway. See https://github.com/grpc-ecosystem/grpc-gateway .

func NewJSONHTTPServer

func NewJSONHTTPServer(listener string, lg log.Logger) *JSONHTTPServer

NewJSONHTTPServer creates a new json http server.

func (*JSONHTTPServer) Shutdown added in v1.0.0

func (s *JSONHTTPServer) Shutdown(ctx context.Context) error

Shutdown stops the server.

func (*JSONHTTPServer) StartService

func (s *JSONHTTPServer) StartService(
	ctx context.Context,
	services ...ServiceAPI,
) <-chan struct{}

StartService starts the json api server and listens for status (started, stopped).

type MeshService

type MeshService struct {
	// contains filtered or unexported fields
}

MeshService exposes mesh data such as accounts, blocks, and transactions.

func NewMeshService

func NewMeshService(
	cdb *datastore.CachedDB,
	msh meshAPI,
	cstate conservativeState,
	genTime genesisTimeAPI,
	layersPerEpoch uint32,
	genesisID types.Hash20,
	layerDuration time.Duration,
	layerAvgSize,
	txsPerProposal uint32,
	lg log.Logger,
) *MeshService

NewMeshService creates a new service using config data.

func (MeshService) AccountMeshDataQuery

AccountMeshDataQuery returns account data.

func (MeshService) AccountMeshDataStream

AccountMeshDataStream exposes a stream of transactions and activations for an account.

func (MeshService) CurrentEpoch

CurrentEpoch returns the current epoch number.

func (MeshService) CurrentLayer

CurrentLayer returns the current layer number.

func (MeshService) EpochNumLayers

EpochNumLayers returns the number of layers per epoch (a network parameter).

func (MeshService) EpochStream added in v1.0.0

func (MeshService) GenesisID added in v1.0.0

GenesisID returns the network ID.

func (MeshService) GenesisTime

GenesisTime returns the network genesis time as UNIX time.

func (MeshService) LayerDuration

LayerDuration returns the layer duration in seconds (a network parameter).

func (MeshService) LayerStream

LayerStream exposes a stream of all mesh data per layer.

func (MeshService) LayersQuery

LayersQuery returns all mesh data, layer by layer.

func (MeshService) MaxTransactionsPerSecond

MaxTransactionsPerSecond returns the max number of tx per sec (a network parameter).

func (MeshService) RegisterService

func (s MeshService) RegisterService(server *Server)

RegisterService registers this service with a grpc server instance.

type MockatxProvider added in v1.0.0

type MockatxProvider struct {
	// contains filtered or unexported fields
}

MockatxProvider is a mock of atxProvider interface.

func NewMockatxProvider added in v1.0.0

func NewMockatxProvider(ctrl *gomock.Controller) *MockatxProvider

NewMockatxProvider creates a new mock instance.

func (*MockatxProvider) EXPECT added in v1.0.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockatxProvider) GetFullAtx added in v1.0.0

GetFullAtx mocks base method.

func (*MockatxProvider) MaxHeightAtx added in v1.0.0

func (m *MockatxProvider) MaxHeightAtx() (types.ATXID, error)

MaxHeightAtx mocks base method.

type MockatxProviderMockRecorder added in v1.0.0

type MockatxProviderMockRecorder struct {
	// contains filtered or unexported fields
}

MockatxProviderMockRecorder is the mock recorder for MockatxProvider.

func (*MockatxProviderMockRecorder) GetFullAtx added in v1.0.0

func (mr *MockatxProviderMockRecorder) GetFullAtx(id interface{}) *gomock.Call

GetFullAtx indicates an expected call of GetFullAtx.

func (*MockatxProviderMockRecorder) MaxHeightAtx added in v1.0.0

func (mr *MockatxProviderMockRecorder) MaxHeightAtx() *gomock.Call

MaxHeightAtx indicates an expected call of MaxHeightAtx.

type MockconservativeState added in v1.0.0

type MockconservativeState struct {
	// contains filtered or unexported fields
}

MockconservativeState is a mock of conservativeState interface.

func NewMockconservativeState added in v1.0.0

func NewMockconservativeState(ctrl *gomock.Controller) *MockconservativeState

NewMockconservativeState creates a new mock instance.

func (*MockconservativeState) EXPECT added in v1.0.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockconservativeState) GetAllAccounts added in v1.0.0

func (m *MockconservativeState) GetAllAccounts() ([]*types.Account, error)

GetAllAccounts mocks base method.

func (*MockconservativeState) GetBalance added in v1.0.0

func (m *MockconservativeState) GetBalance(arg0 types.Address) (uint64, error)

GetBalance mocks base method.

func (*MockconservativeState) GetLayerStateRoot added in v1.0.0

func (m *MockconservativeState) GetLayerStateRoot(arg0 types.LayerID) (types.Hash32, error)

GetLayerStateRoot mocks base method.

func (*MockconservativeState) GetMeshTransaction added in v1.0.0

func (m *MockconservativeState) GetMeshTransaction(arg0 types.TransactionID) (*types.MeshTransaction, error)

GetMeshTransaction mocks base method.

func (*MockconservativeState) GetMeshTransactions added in v1.0.0

func (m *MockconservativeState) GetMeshTransactions(arg0 []types.TransactionID) ([]*types.MeshTransaction, map[types.TransactionID]struct{})

GetMeshTransactions mocks base method.

func (*MockconservativeState) GetNonce added in v1.0.0

func (m *MockconservativeState) GetNonce(arg0 types.Address) (types.Nonce, error)

GetNonce mocks base method.

func (*MockconservativeState) GetProjection added in v1.0.0

func (m *MockconservativeState) GetProjection(arg0 types.Address) (uint64, uint64)

GetProjection mocks base method.

func (*MockconservativeState) GetStateRoot added in v1.0.0

func (m *MockconservativeState) GetStateRoot() (types.Hash32, error)

GetStateRoot mocks base method.

func (*MockconservativeState) GetTransactionsByAddress added in v1.0.0

func (m *MockconservativeState) GetTransactionsByAddress(arg0, arg1 types.LayerID, arg2 types.Address) ([]*types.MeshTransaction, error)

GetTransactionsByAddress mocks base method.

func (*MockconservativeState) Validation added in v1.0.0

Validation mocks base method.

type MockconservativeStateMockRecorder added in v1.0.0

type MockconservativeStateMockRecorder struct {
	// contains filtered or unexported fields
}

MockconservativeStateMockRecorder is the mock recorder for MockconservativeState.

func (*MockconservativeStateMockRecorder) GetAllAccounts added in v1.0.0

func (mr *MockconservativeStateMockRecorder) GetAllAccounts() *gomock.Call

GetAllAccounts indicates an expected call of GetAllAccounts.

func (*MockconservativeStateMockRecorder) GetBalance added in v1.0.0

func (mr *MockconservativeStateMockRecorder) GetBalance(arg0 interface{}) *gomock.Call

GetBalance indicates an expected call of GetBalance.

func (*MockconservativeStateMockRecorder) GetLayerStateRoot added in v1.0.0

func (mr *MockconservativeStateMockRecorder) GetLayerStateRoot(arg0 interface{}) *gomock.Call

GetLayerStateRoot indicates an expected call of GetLayerStateRoot.

func (*MockconservativeStateMockRecorder) GetMeshTransaction added in v1.0.0

func (mr *MockconservativeStateMockRecorder) GetMeshTransaction(arg0 interface{}) *gomock.Call

GetMeshTransaction indicates an expected call of GetMeshTransaction.

func (*MockconservativeStateMockRecorder) GetMeshTransactions added in v1.0.0

func (mr *MockconservativeStateMockRecorder) GetMeshTransactions(arg0 interface{}) *gomock.Call

GetMeshTransactions indicates an expected call of GetMeshTransactions.

func (*MockconservativeStateMockRecorder) GetNonce added in v1.0.0

func (mr *MockconservativeStateMockRecorder) GetNonce(arg0 interface{}) *gomock.Call

GetNonce indicates an expected call of GetNonce.

func (*MockconservativeStateMockRecorder) GetProjection added in v1.0.0

func (mr *MockconservativeStateMockRecorder) GetProjection(arg0 interface{}) *gomock.Call

GetProjection indicates an expected call of GetProjection.

func (*MockconservativeStateMockRecorder) GetStateRoot added in v1.0.0

func (mr *MockconservativeStateMockRecorder) GetStateRoot() *gomock.Call

GetStateRoot indicates an expected call of GetStateRoot.

func (*MockconservativeStateMockRecorder) GetTransactionsByAddress added in v1.0.0

func (mr *MockconservativeStateMockRecorder) GetTransactionsByAddress(arg0, arg1, arg2 interface{}) *gomock.Call

GetTransactionsByAddress indicates an expected call of GetTransactionsByAddress.

func (*MockconservativeStateMockRecorder) Validation added in v1.0.0

func (mr *MockconservativeStateMockRecorder) Validation(raw interface{}) *gomock.Call

Validation indicates an expected call of Validation.

type MockgenesisTimeAPI added in v1.0.0

type MockgenesisTimeAPI struct {
	// contains filtered or unexported fields
}

MockgenesisTimeAPI is a mock of genesisTimeAPI interface.

func NewMockgenesisTimeAPI added in v1.0.0

func NewMockgenesisTimeAPI(ctrl *gomock.Controller) *MockgenesisTimeAPI

NewMockgenesisTimeAPI creates a new mock instance.

func (*MockgenesisTimeAPI) CurrentLayer added in v1.0.0

func (m *MockgenesisTimeAPI) CurrentLayer() types.LayerID

CurrentLayer mocks base method.

func (*MockgenesisTimeAPI) EXPECT added in v1.0.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockgenesisTimeAPI) GenesisTime added in v1.0.0

func (m *MockgenesisTimeAPI) GenesisTime() time.Time

GenesisTime mocks base method.

type MockgenesisTimeAPIMockRecorder added in v1.0.0

type MockgenesisTimeAPIMockRecorder struct {
	// contains filtered or unexported fields
}

MockgenesisTimeAPIMockRecorder is the mock recorder for MockgenesisTimeAPI.

func (*MockgenesisTimeAPIMockRecorder) CurrentLayer added in v1.0.0

func (mr *MockgenesisTimeAPIMockRecorder) CurrentLayer() *gomock.Call

CurrentLayer indicates an expected call of CurrentLayer.

func (*MockgenesisTimeAPIMockRecorder) GenesisTime added in v1.0.0

func (mr *MockgenesisTimeAPIMockRecorder) GenesisTime() *gomock.Call

GenesisTime indicates an expected call of GenesisTime.

type MockmeshAPI added in v1.0.0

type MockmeshAPI struct {
	// contains filtered or unexported fields
}

MockmeshAPI is a mock of meshAPI interface.

func NewMockmeshAPI added in v1.0.0

func NewMockmeshAPI(ctrl *gomock.Controller) *MockmeshAPI

NewMockmeshAPI creates a new mock instance.

func (*MockmeshAPI) EXPECT added in v1.0.0

func (m *MockmeshAPI) EXPECT() *MockmeshAPIMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockmeshAPI) GetATXs added in v1.0.0

func (m *MockmeshAPI) GetATXs(arg0 context.Context, arg1 []types.ATXID) (map[types.ATXID]*types.VerifiedActivationTx, []types.ATXID)

GetATXs mocks base method.

func (*MockmeshAPI) GetLayer added in v1.0.0

func (m *MockmeshAPI) GetLayer(arg0 types.LayerID) (*types.Layer, error)

GetLayer mocks base method.

func (*MockmeshAPI) GetRewards added in v1.0.0

func (m *MockmeshAPI) GetRewards(arg0 types.Address) ([]*types.Reward, error)

GetRewards mocks base method.

func (*MockmeshAPI) LatestLayer added in v1.0.0

func (m *MockmeshAPI) LatestLayer() types.LayerID

LatestLayer mocks base method.

func (*MockmeshAPI) LatestLayerInState added in v1.0.0

func (m *MockmeshAPI) LatestLayerInState() types.LayerID

LatestLayerInState mocks base method.

func (*MockmeshAPI) MeshHash added in v1.0.0

func (m *MockmeshAPI) MeshHash(arg0 types.LayerID) (types.Hash32, error)

MeshHash mocks base method.

func (*MockmeshAPI) ProcessedLayer added in v1.0.0

func (m *MockmeshAPI) ProcessedLayer() types.LayerID

ProcessedLayer mocks base method.

type MockmeshAPIMockRecorder added in v1.0.0

type MockmeshAPIMockRecorder struct {
	// contains filtered or unexported fields
}

MockmeshAPIMockRecorder is the mock recorder for MockmeshAPI.

func (*MockmeshAPIMockRecorder) GetATXs added in v1.0.0

func (mr *MockmeshAPIMockRecorder) GetATXs(arg0, arg1 interface{}) *gomock.Call

GetATXs indicates an expected call of GetATXs.

func (*MockmeshAPIMockRecorder) GetLayer added in v1.0.0

func (mr *MockmeshAPIMockRecorder) GetLayer(arg0 interface{}) *gomock.Call

GetLayer indicates an expected call of GetLayer.

func (*MockmeshAPIMockRecorder) GetRewards added in v1.0.0

func (mr *MockmeshAPIMockRecorder) GetRewards(arg0 interface{}) *gomock.Call

GetRewards indicates an expected call of GetRewards.

func (*MockmeshAPIMockRecorder) LatestLayer added in v1.0.0

func (mr *MockmeshAPIMockRecorder) LatestLayer() *gomock.Call

LatestLayer indicates an expected call of LatestLayer.

func (*MockmeshAPIMockRecorder) LatestLayerInState added in v1.0.0

func (mr *MockmeshAPIMockRecorder) LatestLayerInState() *gomock.Call

LatestLayerInState indicates an expected call of LatestLayerInState.

func (*MockmeshAPIMockRecorder) MeshHash added in v1.0.0

func (mr *MockmeshAPIMockRecorder) MeshHash(arg0 interface{}) *gomock.Call

MeshHash indicates an expected call of MeshHash.

func (*MockmeshAPIMockRecorder) ProcessedLayer added in v1.0.0

func (mr *MockmeshAPIMockRecorder) ProcessedLayer() *gomock.Call

ProcessedLayer indicates an expected call of ProcessedLayer.

type MocknetworkIdentity added in v1.0.0

type MocknetworkIdentity struct {
	// contains filtered or unexported fields
}

MocknetworkIdentity is a mock of networkIdentity interface.

func NewMocknetworkIdentity added in v1.0.0

func NewMocknetworkIdentity(ctrl *gomock.Controller) *MocknetworkIdentity

NewMocknetworkIdentity creates a new mock instance.

func (*MocknetworkIdentity) EXPECT added in v1.0.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MocknetworkIdentity) ID added in v1.0.0

func (m *MocknetworkIdentity) ID() p2p.Peer

ID mocks base method.

type MocknetworkIdentityMockRecorder added in v1.0.0

type MocknetworkIdentityMockRecorder struct {
	// contains filtered or unexported fields
}

MocknetworkIdentityMockRecorder is the mock recorder for MocknetworkIdentity.

func (*MocknetworkIdentityMockRecorder) ID added in v1.0.0

ID indicates an expected call of ID.

type Mockoracle added in v1.0.0

type Mockoracle struct {
	// contains filtered or unexported fields
}

Mockoracle is a mock of oracle interface.

func NewMockoracle added in v1.0.0

func NewMockoracle(ctrl *gomock.Controller) *Mockoracle

NewMockoracle creates a new mock instance.

func (*Mockoracle) ActiveSet added in v1.0.0

func (m *Mockoracle) ActiveSet(arg0 context.Context, arg1 types.EpochID) ([]types.ATXID, error)

ActiveSet mocks base method.

func (*Mockoracle) EXPECT added in v1.0.0

func (m *Mockoracle) EXPECT() *MockoracleMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

type MockoracleMockRecorder added in v1.0.0

type MockoracleMockRecorder struct {
	// contains filtered or unexported fields
}

MockoracleMockRecorder is the mock recorder for Mockoracle.

func (*MockoracleMockRecorder) ActiveSet added in v1.0.0

func (mr *MockoracleMockRecorder) ActiveSet(arg0, arg1 interface{}) *gomock.Call

ActiveSet indicates an expected call of ActiveSet.

type MockpeerCounter added in v1.0.0

type MockpeerCounter struct {
	// contains filtered or unexported fields
}

MockpeerCounter is a mock of peerCounter interface.

func NewMockpeerCounter added in v1.0.0

func NewMockpeerCounter(ctrl *gomock.Controller) *MockpeerCounter

NewMockpeerCounter creates a new mock instance.

func (*MockpeerCounter) EXPECT added in v1.0.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockpeerCounter) PeerCount added in v1.0.0

func (m *MockpeerCounter) PeerCount() uint64

PeerCount mocks base method.

type MockpeerCounterMockRecorder added in v1.0.0

type MockpeerCounterMockRecorder struct {
	// contains filtered or unexported fields
}

MockpeerCounterMockRecorder is the mock recorder for MockpeerCounter.

func (*MockpeerCounterMockRecorder) PeerCount added in v1.0.0

func (mr *MockpeerCounterMockRecorder) PeerCount() *gomock.Call

PeerCount indicates an expected call of PeerCount.

type MockpostSetupProvider added in v1.0.0

type MockpostSetupProvider struct {
	// contains filtered or unexported fields
}

MockpostSetupProvider is a mock of postSetupProvider interface.

func NewMockpostSetupProvider added in v1.0.0

func NewMockpostSetupProvider(ctrl *gomock.Controller) *MockpostSetupProvider

NewMockpostSetupProvider creates a new mock instance.

func (*MockpostSetupProvider) Benchmark added in v1.0.0

Benchmark mocks base method.

func (*MockpostSetupProvider) Config added in v1.0.0

Config mocks base method.

func (*MockpostSetupProvider) EXPECT added in v1.0.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockpostSetupProvider) Providers added in v1.0.0

Providers mocks base method.

func (*MockpostSetupProvider) Status added in v1.0.0

Status mocks base method.

type MockpostSetupProviderMockRecorder added in v1.0.0

type MockpostSetupProviderMockRecorder struct {
	// contains filtered or unexported fields
}

MockpostSetupProviderMockRecorder is the mock recorder for MockpostSetupProvider.

func (*MockpostSetupProviderMockRecorder) Benchmark added in v1.0.0

func (mr *MockpostSetupProviderMockRecorder) Benchmark(p interface{}) *gomock.Call

Benchmark indicates an expected call of Benchmark.

func (*MockpostSetupProviderMockRecorder) Config added in v1.0.0

Config indicates an expected call of Config.

func (*MockpostSetupProviderMockRecorder) Providers added in v1.0.0

Providers indicates an expected call of Providers.

func (*MockpostSetupProviderMockRecorder) Status added in v1.0.0

Status indicates an expected call of Status.

type Mocksyncer added in v1.0.0

type Mocksyncer struct {
	// contains filtered or unexported fields
}

Mocksyncer is a mock of syncer interface.

func NewMocksyncer added in v1.0.0

func NewMocksyncer(ctrl *gomock.Controller) *Mocksyncer

NewMocksyncer creates a new mock instance.

func (*Mocksyncer) EXPECT added in v1.0.0

func (m *Mocksyncer) EXPECT() *MocksyncerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*Mocksyncer) IsSynced added in v1.0.0

func (m *Mocksyncer) IsSynced(arg0 context.Context) bool

IsSynced mocks base method.

type MocksyncerMockRecorder added in v1.0.0

type MocksyncerMockRecorder struct {
	// contains filtered or unexported fields
}

MocksyncerMockRecorder is the mock recorder for Mocksyncer.

func (*MocksyncerMockRecorder) IsSynced added in v1.0.0

func (mr *MocksyncerMockRecorder) IsSynced(arg0 interface{}) *gomock.Call

IsSynced indicates an expected call of IsSynced.

type MocktxValidator added in v1.0.0

type MocktxValidator struct {
	// contains filtered or unexported fields
}

MocktxValidator is a mock of txValidator interface.

func NewMocktxValidator added in v1.0.0

func NewMocktxValidator(ctrl *gomock.Controller) *MocktxValidator

NewMocktxValidator creates a new mock instance.

func (*MocktxValidator) EXPECT added in v1.0.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MocktxValidator) VerifyAndCacheTx added in v1.0.0

func (m *MocktxValidator) VerifyAndCacheTx(arg0 context.Context, arg1 []byte) error

VerifyAndCacheTx mocks base method.

type MocktxValidatorMockRecorder added in v1.0.0

type MocktxValidatorMockRecorder struct {
	// contains filtered or unexported fields
}

MocktxValidatorMockRecorder is the mock recorder for MocktxValidator.

func (*MocktxValidatorMockRecorder) VerifyAndCacheTx added in v1.0.0

func (mr *MocktxValidatorMockRecorder) VerifyAndCacheTx(arg0, arg1 interface{}) *gomock.Call

VerifyAndCacheTx indicates an expected call of VerifyAndCacheTx.

type NodeService

type NodeService struct {
	// contains filtered or unexported fields
}

NodeService is a grpc server that provides the NodeService, which exposes node-related data such as node status, software version, errors, etc. It can also be used to start the sync process, or to shut down the node.

func NewNodeService

func NewNodeService(
	peers peerCounter,
	msh meshAPI,
	genTime genesisTimeAPI,
	syncer syncer,
	appVersion string,
	appCommit string,
	lg log.Logger,
) *NodeService

NewNodeService creates a new grpc service using config data.

func (NodeService) Build

Build returns the build of the node software.

func (NodeService) Echo

Echo returns the response for an echo api request. It's used for E2E tests.

func (NodeService) ErrorStream

ErrorStream exposes a stream of node errors.

func (NodeService) NodeInfo added in v1.0.0

func (NodeService) RegisterService

func (s NodeService) RegisterService(server *Server)

RegisterService registers this service with a grpc server instance.

func (NodeService) Status

Status returns a status object providing information about the connected peers, sync status, current and verified layer.

func (NodeService) StatusStream

StatusStream exposes a stream of node status updates.

func (NodeService) Version

Version returns the version of the node software as a semver string.

type Server

type Server struct {
	Listener string

	GrpcServer *grpc.Server
	// contains filtered or unexported fields
}

Server is a very basic grpc server.

func New added in v1.0.0

func New(listener string, lg log.Logger, opts ...grpc.ServerOption) *Server

New creates and returns a new Server with port and interface.

func (*Server) Close

func (s *Server) Close() error

Close stops the server.

func (*Server) Start

func (s *Server) Start() <-chan struct{}

Start starts the server.

type Service added in v1.0.0

type Service = string
const (
	Admin       Service = "admin"
	Debug       Service = "debug"
	GlobalState Service = "global"
	Mesh        Service = "mesh"
	Transaction Service = "transaction"
	Activation  Service = "activation"
	Smesher     Service = "smesher"
	Node        Service = "node"
)

type ServiceAPI

type ServiceAPI interface {
	RegisterService(*Server)
}

ServiceAPI allows individual grpc services to register the grpc server.

type SmesherService

type SmesherService struct {
	// contains filtered or unexported fields
}

SmesherService exposes endpoints to manage smeshing.

func NewSmesherService

func NewSmesherService(post postSetupProvider, smeshing activation.SmeshingProvider, streamInterval time.Duration, postOpts activation.PostSetupOpts, lg log.Logger) *SmesherService

NewSmesherService creates a new grpc service using config data.

func (SmesherService) Coinbase

Coinbase returns the current coinbase setting of this node.

func (SmesherService) EstimatedRewards added in v0.1.16

EstimatedRewards returns estimated smeshing rewards over the next epoch.

func (SmesherService) IsSmeshing

IsSmeshing reports whether the node is smeshing.

func (SmesherService) MinGas

MinGas returns the current mingas setting of this node.

func (SmesherService) PostConfig added in v1.0.0

PostConfig returns the Post protocol config.

func (SmesherService) PostSetupProviders added in v1.0.0

PostSetupComputeProviders returns a list of available Post setup compute providers.

func (SmesherService) PostSetupStatus added in v1.0.0

PostSetupStatus returns post data status.

func (SmesherService) PostSetupStatusStream added in v1.0.0

func (s SmesherService) PostSetupStatusStream(_ *empty.Empty, stream pb.SmesherService_PostSetupStatusStreamServer) error

PostSetupStatusStream exposes a stream of status updates during post setup.

func (SmesherService) RegisterService

func (s SmesherService) RegisterService(server *Server)

RegisterService registers this service with a grpc server instance.

func (SmesherService) SetCoinbase

SetCoinbase sets the current coinbase setting of this node.

func (SmesherService) SetMinGas

SetMinGas sets the mingas setting of this node.

func (SmesherService) SmesherID

SmesherID returns the smesher ID of this node.

func (SmesherService) StartSmeshing

StartSmeshing requests that the node begin smeshing.

func (SmesherService) StopSmeshing

StopSmeshing requests that the node stop smeshing.

func (SmesherService) UpdatePoetServers added in v1.0.0

UpdatePoetServers update server that is used for generating PoETs.

type TransactionService

type TransactionService struct {
	// contains filtered or unexported fields
}

TransactionService exposes transaction data, and a submit tx endpoint.

func NewTransactionService

func NewTransactionService(
	db *sql.Database,
	publisher pubsub.Publisher,
	msh meshAPI,
	conState conservativeState,
	syncer syncer,
	txHandler txValidator,
	lg log.Logger,
) *TransactionService

NewTransactionService creates a new grpc service using config data.

func (TransactionService) ParseTransaction added in v1.0.0

func (TransactionService) RegisterService

func (s TransactionService) RegisterService(server *Server)

RegisterService registers this service with a grpc server instance.

func (TransactionService) StreamResults added in v1.0.0

StreamResults allows to query historical results and subscribe to live data using the same filter.

func (TransactionService) SubmitTransaction

SubmitTransaction allows a new tx to be submitted.

func (TransactionService) TransactionsState

TransactionsState returns current tx data for one or more txs.

func (TransactionService) TransactionsStateStream

TransactionsStateStream exposes a stream of tx data.

Jump to

Keyboard shortcuts

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