Documentation
¶
Index ¶
- Variables
- type Config
- type DependencyGraphConfig
- type Service
- func (c *Service) BlockProcessing(stream protocoordinatorservice.Coordinator_BlockProcessingServer) error
- func (c *Service) GetConfigTransaction(ctx context.Context, _ *emptypb.Empty) (*protoblocktx.ConfigTransaction, error)
- func (c *Service) GetLastCommittedBlockNumber(ctx context.Context, _ *emptypb.Empty) (*protoblocktx.LastCommittedBlock, error)
- func (c *Service) GetNextExpectedBlockNumber(ctx context.Context, _ *emptypb.Empty) (*protoblocktx.BlockInfo, error)
- func (c *Service) GetTransactionsStatus(ctx context.Context, q *protoblocktx.QueryStatus) (*protoblocktx.TransactionsStatus, error)
- func (c *Service) NumberOfWaitingTransactionsForStatus(context.Context, *emptypb.Empty) (*protocoordinatorservice.WaitingTransactions, error)
- func (c *Service) RegisterService(server *grpc.Server)
- func (c *Service) Run(ctx context.Context) error
- func (c *Service) SetLastCommittedBlockNumber(ctx context.Context, lastBlock *protoblocktx.BlockInfo) (*emptypb.Empty, error)
- func (c *Service) WaitForReady(ctx context.Context) bool
Constants ¶
This section is empty.
Variables ¶
var ( // ErrActiveStreamWaitingTransactions is returned when NumberOfWaitingTransactionsForStatus is called // while a stream is active. This value cannot be reliably determined in this state. ErrActiveStreamWaitingTransactions = errors.New("cannot determine number of waiting transactions for " + "status while stream is active") // ErrActiveStreamBlockNumber is returned when GetNextExpectedBlockNumber is called while a stream is active. // The next expected block number cannot be reliably determined in this state. ErrActiveStreamBlockNumber = errors.New("cannot determine next expected block number while stream is active") // ErrExistingStreamOrConflictingOp indicates that a stream cannot be created because a stream already exists // or a conflicting gRPC API call is being made concurrently. ErrExistingStreamOrConflictingOp = errors.New("stream already exists or conflicting operation in progress") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Server *connection.ServerConfig `mapstructure:"server"`
Verifier connection.MultiClientConfig `mapstructure:"verifier"`
ValidatorCommitter connection.MultiClientConfig `mapstructure:"validator-committer"`
DependencyGraph *DependencyGraphConfig `mapstructure:"dependency-graph"`
Monitoring monitoring.Config `mapstructure:"monitoring"`
// ChannelBufferSizePerGoroutine defines the buffer size per go-routine.
ChannelBufferSizePerGoroutine int `mapstructure:"per-channel-buffer-size-per-goroutine"`
}
Config is the configuration for coordinator service. It contains configurations for all managers.
type DependencyGraphConfig ¶
type DependencyGraphConfig struct {
NumOfLocalDepConstructors int `mapstructure:"num-of-local-dep-constructors"`
WaitingTxsLimit int `mapstructure:"waiting-txs-limit"`
}
DependencyGraphConfig is the configuration for dependency graph manager. It contains resource limits.
type Service ¶
type Service struct {
protocoordinatorservice.UnimplementedCoordinatorServer
// contains filtered or unexported fields
}
Service is responsible for coordinating signature verification, dependency tracking, and validation and commit of each transaction.
func NewCoordinatorService ¶
NewCoordinatorService creates a new coordinator service.
func (*Service) BlockProcessing ¶
func (c *Service) BlockProcessing( stream protocoordinatorservice.Coordinator_BlockProcessingServer, ) error
BlockProcessing receives a stream of blocks from the client and processes them.
func (*Service) GetConfigTransaction ¶
func (c *Service) GetConfigTransaction( ctx context.Context, _ *emptypb.Empty, ) (*protoblocktx.ConfigTransaction, error)
GetConfigTransaction get the config transaction from the state DB.
func (*Service) GetLastCommittedBlockNumber ¶
func (c *Service) GetLastCommittedBlockNumber( ctx context.Context, _ *emptypb.Empty, ) (*protoblocktx.LastCommittedBlock, error)
GetLastCommittedBlockNumber get the last committed block number in the database/ledger.
func (*Service) GetNextExpectedBlockNumber ¶
func (c *Service) GetNextExpectedBlockNumber( ctx context.Context, _ *emptypb.Empty, ) (*protoblocktx.BlockInfo, error)
GetNextExpectedBlockNumber returns the next expected block number to be received by the coordinator.
func (*Service) GetTransactionsStatus ¶
func (c *Service) GetTransactionsStatus( ctx context.Context, q *protoblocktx.QueryStatus, ) (*protoblocktx.TransactionsStatus, error)
GetTransactionsStatus returns the status of given transactions identifiers.
func (*Service) NumberOfWaitingTransactionsForStatus ¶
func (c *Service) NumberOfWaitingTransactionsForStatus( context.Context, *emptypb.Empty, ) (*protocoordinatorservice.WaitingTransactions, error)
NumberOfWaitingTransactionsForStatus returns the number of transactions waiting to get the final status.
func (*Service) RegisterService ¶ added in v0.1.5
RegisterService registers for the coordinator's GRPC services.
func (*Service) SetLastCommittedBlockNumber ¶
func (c *Service) SetLastCommittedBlockNumber( ctx context.Context, lastBlock *protoblocktx.BlockInfo, ) (*emptypb.Empty, error)
SetLastCommittedBlockNumber set the last committed block number in the database/ledger through a vcservice.