Documentation
¶
Index ¶
- Variables
- type Config
- type DependencyGraphConfig
- type Service
- func (c *Service) BlockProcessing(stream servicepb.Coordinator_BlockProcessingServer) error
- func (c *Service) GetNextBlockNumberToCommit(ctx context.Context, _ *emptypb.Empty) (*servicepb.BlockRef, error)
- func (c *Service) GetTransactionsStatus(ctx context.Context, q *committerpb.TxIDsBatch) (*committerpb.TxStatusBatch, error)
- func (c *Service) NumberOfWaitingTransactionsForStatus(context.Context, *emptypb.Empty) (*servicepb.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 *servicepb.BlockRef) (*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") // 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 *connection.ServerConfig `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 {
servicepb.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 servicepb.Coordinator_BlockProcessingServer, ) error
BlockProcessing receives a stream of blocks from the client and processes them.
func (*Service) GetNextBlockNumberToCommit ¶ added in v0.1.8
func (c *Service) GetNextBlockNumberToCommit( ctx context.Context, _ *emptypb.Empty, ) (*servicepb.BlockRef, error)
GetNextBlockNumberToCommit returns the next expected block number to be received by the coordinator.
func (*Service) GetTransactionsStatus ¶
func (c *Service) GetTransactionsStatus( ctx context.Context, q *committerpb.TxIDsBatch, ) (*committerpb.TxStatusBatch, error)
GetTransactionsStatus returns the status of given transactions identifiers.
func (*Service) NumberOfWaitingTransactionsForStatus ¶
func (c *Service) NumberOfWaitingTransactionsForStatus( context.Context, *emptypb.Empty, ) (*servicepb.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.