fabric: github.com/hyperledger/fabric/core/deliverservice Index | Files | Directories

package deliverservice

import "github.com/hyperledger/fabric/core/deliverservice"

Index

Package Files

config.go deliveryclient.go

Constants

const (
    DefaultReConnectBackoffThreshold   = float64(time.Hour)
    DefaultReConnectTotalTimeThreshold = time.Second * 60 * 60
    DefaultConnectionTimeout           = time.Second * 3
)

func LoadOverridesMap Uses

func LoadOverridesMap() (map[string]*orderers.Endpoint, error)

type AddressOverride Uses

type AddressOverride struct {
    From        string `mapstructure:"from"`
    To          string `mapstructure:"to"`
    CACertsFile string `mapstructure:"caCertsFile"`
}

type Config Uses

type Config struct {
    IsStaticLeader bool
    // CryptoSvc performs cryptographic actions like message verification and signing
    // and identity validation.
    CryptoSvc blocksprovider.BlockVerifier
    // Gossip enables to enumerate peers in the channel, send a message to peers,
    // and add a block to the gossip state transfer layer.
    Gossip blocksprovider.GossipServiceAdapter
    // OrdererSource provides orderer endpoints, complete with TLS cert pools.
    OrdererSource *orderers.ConnectionSource
    // Signer is the identity used to sign requests.
    Signer identity.SignerSerializer
    // GRPC Client
    DeliverGRPCClient *comm.GRPCClient
    // Configuration values for deliver service.
    // TODO: merge 2 Config struct
    DeliverServiceConfig *DeliverServiceConfig
}

Config dictates the DeliveryService's properties, namely how it connects to an ordering service endpoint, how it verifies messages received from it, and how it disseminates the messages to other peers

type DeliverAdapter Uses

type DeliverAdapter struct{}

func (DeliverAdapter) Deliver Uses

func (DeliverAdapter) Deliver(ctx context.Context, clientConn *grpc.ClientConn) (orderer.AtomicBroadcast_DeliverClient, error)

type DeliverService Uses

type DeliverService interface {
    // StartDeliverForChannel dynamically starts delivery of new blocks from ordering service
    // to channel peers.
    // When the delivery finishes, the finalizer func is called
    StartDeliverForChannel(chainID string, ledgerInfo blocksprovider.LedgerInfo, finalizer func()) error

    // StopDeliverForChannel dynamically stops delivery of new blocks from ordering service
    // to channel peers.
    StopDeliverForChannel(chainID string) error

    // Stop terminates delivery service and closes the connection
    Stop()
}

DeliverService used to communicate with orderers to obtain new blocks and send them to the committer service

func NewDeliverService Uses

func NewDeliverService(conf *Config) DeliverService

NewDeliverService construction function to create and initialize delivery service instance. It tries to establish connection to the specified in the configuration ordering service, in case it fails to dial to it, return nil

type DeliverServiceConfig Uses

type DeliverServiceConfig struct {
    // PeerTLSEnabled enables/disables Peer TLS.
    PeerTLSEnabled bool
    // ReConnectBackoffThreshold sets the delivery service maximal delay between consencutive retries.
    ReConnectBackoffThreshold float64
    // ReconnectTotalTimeThreshold sets the total time the delivery service may spend in reconnection attempts
    // until its retry logic gives up and returns an error.
    ReconnectTotalTimeThreshold time.Duration
    // ConnectionTimeout sets the delivery service <-> ordering service node connection timeout
    ConnectionTimeout time.Duration
    // Keepalive option for deliveryservice
    KeepaliveOptions comm.KeepaliveOptions
    // SecOpts provides the TLS info for connections
    SecOpts comm.SecureOptions

    // OrdererEndpointOverrides is a map of orderer addresses which should be
    // re-mapped to a different orderer endpoint.
    OrdererEndpointOverrides map[string]*orderers.Endpoint
}

DeliverServiceConfig is the struct that defines the deliverservice configuration.

func GlobalConfig Uses

func GlobalConfig() *DeliverServiceConfig

GlobalConfig obtains a set of configuration from viper, build and returns the config struct.

type DialerAdapter Uses

type DialerAdapter struct {
    Client *comm.GRPCClient
}

func (DialerAdapter) Dial Uses

func (da DialerAdapter) Dial(address string, certPool *x509.CertPool) (*grpc.ClientConn, error)

Directories

PathSynopsis
fakeCode generated by counterfeiter.

Package deliverservice imports 18 packages (graph) and is imported by 8 packages. Updated 2020-01-25. Refresh now. Tools for package owners.