Documentation
¶
Index ¶
- func IsStatusStoredInDB(status protoblocktx.Status) bool
- func LoadBootstrapConfig(conf *Config) error
- func MalformedTxTestCases(txb *workload.TxBuilder) (txs []*protoloadgen.TX, expectedStatuses []protoblocktx.Status)
- func OverwriteConfigFromBlock(conf *Config, configBlock *common.Block) error
- func OverwriteConfigFromBlockFile(conf *Config) error
- func OverwriteConfigFromEnvelope(conf *Config, envelope *common.Envelope) error
- func RequireNotifications(t *testing.T, notifyStream protonotify.Notifier_OpenNotificationStreamClient, ...)
- type Bootstrap
- type Config
- type LedgerConfig
- type NotificationServiceConfig
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsStatusStoredInDB ¶ added in v0.1.5
func IsStatusStoredInDB(status protoblocktx.Status) bool
IsStatusStoredInDB returns true if the given status code can be stored in the state DB.
func LoadBootstrapConfig ¶
LoadBootstrapConfig loads the bootstrap config according to the bootstrap method.
func MalformedTxTestCases ¶ added in v0.1.5
func MalformedTxTestCases(txb *workload.TxBuilder) ( txs []*protoloadgen.TX, expectedStatuses []protoblocktx.Status, )
MalformedTxTestCases are valid and invalid TXs due to malformed.
func OverwriteConfigFromBlock ¶
OverwriteConfigFromBlock overwrites the orderer connection with fields from a config block.
func OverwriteConfigFromBlockFile ¶
OverwriteConfigFromBlockFile overwrites the orderer connection with fields from the bootstrap config block.
func OverwriteConfigFromEnvelope ¶
OverwriteConfigFromEnvelope overwrites the orderer connection with fields from a config transaction. For now, it fetches the following: - Orderer endpoints. TODO: Fetch Root CAs.
func RequireNotifications ¶ added in v0.1.5
func RequireNotifications( t *testing.T, notifyStream protonotify.Notifier_OpenNotificationStreamClient, expectedBlockNumber uint64, txIDs []string, status []protoblocktx.Status, )
RequireNotifications verifies that the expected notification were received.
Types ¶
type Bootstrap ¶
type Bootstrap struct {
// GenesisBlockFilePath is the path for the genesis block.
// If omitted, the local configuration will be used.
GenesisBlockFilePath string `mapstructure:"genesis-block-file-path" yaml:"genesis-block-file-path,omitempty"`
}
Bootstrap configures how to obtain the bootstrap configuration.
type Config ¶
type Config struct {
Server *connection.ServerConfig `mapstructure:"server"`
Monitoring monitoring.Config `mapstructure:"monitoring"`
Committer *connection.ClientConfig `mapstructure:"committer"`
Orderer ordererconn.Config `mapstructure:"orderer"`
Ledger LedgerConfig `mapstructure:"ledger"`
Notification NotificationServiceConfig `mapstructure:"notification"`
LastCommittedBlockSetInterval time.Duration `mapstructure:"last-committed-block-set-interval"`
WaitingTxsLimit int `mapstructure:"waiting-txs-limit"`
// ChannelBufferSize is the buffer size that will be used to queue blocks, requests, and statuses.
ChannelBufferSize int `mapstructure:"channel-buffer-size"`
Bootstrap Bootstrap `mapstructure:"bootstrap"`
}
Config holds the configuration of the sidecar service. This includes sidecar endpoint, committer endpoint to which the sidecar pushes the block and pulls statuses, and the config of ledger service, and the orderer setup. It may contain the orderer endpoint from which the sidecar pulls blocks.
type LedgerConfig ¶
type LedgerConfig struct {
Path string `mapstructure:"path"`
}
LedgerConfig holds the ledger path.
type NotificationServiceConfig ¶ added in v0.1.5
type NotificationServiceConfig struct {
// MaxTimeout is an upper limit on the request's timeout to prevent resource exhaustion.
// If a request doesn't specify a timeout, this value will be used.
MaxTimeout time.Duration `mapstructure:"max-timeout"`
}
NotificationServiceConfig holds the parameters for notifications.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a relay service which relays the block from orderer to committer. Further, it aggregates the transaction status and forwards the validated block to clients who have registered on the ledger server.
func (*Service) RegisterService ¶ added in v0.1.5
RegisterService registers for the sidecar's GRPC services.