Documentation ¶
Index ¶
- func GetServiceTLSCred() (credentials.TransportCredentials, error)
- func NewCCSpecValidator(parent *ccSpecValidator) *ccSpecValidator
- func NewTxNetworkHandler(engine *PeerEngine) *txNetworkHandlerImpl
- func StartService(listenAddr string, enableTLS bool, regserv ...func(*grpc.Server)) error
- func StopServices()
- type CCNameTransformer
- type NodeEngine
- func (ne *NodeEngine) AddServicePoint(s ServicePoint)
- func (ne *NodeEngine) AddTxTopic(name string, topic ...litekfk.Topic)
- func (ne *NodeEngine) DefaultLedger() *ledger.Ledger
- func (ne *NodeEngine) DefaultPeer() *PeerEngine
- func (ne *NodeEngine) ExecInit() error
- func (ne *NodeEngine) FinalRelease()
- func (ne *NodeEngine) Init() error
- func (ne *NodeEngine) LedgersList() (ret []*ledger.Ledger)
- func (ne *NodeEngine) PeersList() (ret []*PeerEngine)
- func (ne *NodeEngine) PreInit()
- func (ne *NodeEngine) RunAll() (chan ServicePoint, error)
- func (ne *NodeEngine) RunPeers() error
- func (ne *NodeEngine) RunServices() (chan ServicePoint, error)
- func (ne *NodeEngine) SelectEndorser(name string) (cred.TxEndorserFactory, error)
- func (ne *NodeEngine) SelectLedger(name string) (*ledger.Ledger, error)
- func (ne *NodeEngine) StopServices(notify <-chan ServicePoint)
- type PeerEngine
- func (pe *PeerEngine) GenTxEndorser() cred.TxEndorser
- func (pe *PeerEngine) GetServerPoint() ServicePoint
- func (pe *PeerEngine) Init(vp *viper.Viper, node *NodeEngine, tag string) error
- func (pe *PeerEngine) IsRunning() (bool, error)
- func (pe *PeerEngine) PreInit(node *NodeEngine)
- func (pe *PeerEngine) Run() error
- func (pe *PeerEngine) Stop()
- func (pe *PeerEngine) Syncer() *syncstrategy.SyncEntry
- func (pe *PeerEngine) TxNetwork() *txnetwork.TxNetworkEntry
- type ServicePoint
- func (ep ServicePoint) CleanStatus()
- func (ep ServicePoint) Init(conf *viper.Viper) error
- func (ep ServicePoint) InitWithConfig(conf *config.ServerSpec) error
- func (ep ServicePoint) Release() error
- func (ep ServicePoint) SetPort(listenAddr string) error
- func (ep ServicePoint) Spec() *config.ServerSpec
- func (ep ServicePoint) Start(notify chan<- ServicePoint) error
- func (ep ServicePoint) Status() error
- func (ep ServicePoint) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServiceTLSCred ¶
func GetServiceTLSCred() (credentials.TransportCredentials, error)
we still reserved the global APIs for node-wide services
func NewCCSpecValidator ¶
func NewCCSpecValidator(parent *ccSpecValidator) *ccSpecValidator
func NewTxNetworkHandler ¶
func NewTxNetworkHandler(engine *PeerEngine) *txNetworkHandlerImpl
func StartService ¶
func StopServices ¶
func StopServices()
Types ¶
type CCNameTransformer ¶
type NodeEngine ¶
type NodeEngine struct { Name string Ledgers map[string]*ledger.Ledger Peers map[string]*PeerEngine Cred struct { Endorsers map[string]cred.TxEndorserFactory // contains filtered or unexported fields } CustomFilters []pb.TxPreHandler //all the received transactions can be read out from different topic by its chaincode name, //according to the configuration in transation filter TxTopic map[string]litekfk.Topic TxTopicNameHandler CCNameTransformer Options struct { EnforceSec bool MakeGenesisForLedger bool } // contains filtered or unexported fields }
node engine intregated mutiple PeerEngine, ledgers and credentials, system should access ledger here
func (*NodeEngine) AddServicePoint ¶
func (ne *NodeEngine) AddServicePoint(s ServicePoint)
func (*NodeEngine) AddTxTopic ¶
func (ne *NodeEngine) AddTxTopic(name string, topic ...litekfk.Topic)
func (*NodeEngine) DefaultLedger ¶
func (ne *NodeEngine) DefaultLedger() *ledger.Ledger
func (*NodeEngine) DefaultPeer ¶
func (ne *NodeEngine) DefaultPeer() *PeerEngine
func (*NodeEngine) ExecInit ¶
func (ne *NodeEngine) ExecInit() error
ne will fully respect an old-fashion (fabric 0.6) config file
func (*NodeEngine) FinalRelease ¶
func (ne *NodeEngine) FinalRelease()
func (*NodeEngine) LedgersList ¶
func (ne *NodeEngine) LedgersList() (ret []*ledger.Ledger)
func (*NodeEngine) PeersList ¶
func (ne *NodeEngine) PeersList() (ret []*PeerEngine)
func (*NodeEngine) PreInit ¶
func (ne *NodeEngine) PreInit()
preinit phase simply read all peer's name in the config and create them, user can make settings on node and peer which will be respected in the Init process
func (*NodeEngine) RunAll ¶
func (ne *NodeEngine) RunAll() (chan ServicePoint, error)
run both peers and service
func (*NodeEngine) RunPeers ¶
func (ne *NodeEngine) RunPeers() error
func (*NodeEngine) RunServices ¶
func (ne *NodeEngine) RunServices() (chan ServicePoint, error)
return a manage channel for all running services, for any value s receive from the channel, it MUST call Start of the s, passing this channel to s again, to respawn the rpc service thread, BEFORE StopServices is called. Or user should just never touch the channel
func (*NodeEngine) SelectEndorser ¶
func (ne *NodeEngine) SelectEndorser(name string) (cred.TxEndorserFactory, error)
func (*NodeEngine) SelectLedger ¶
func (ne *NodeEngine) SelectLedger(name string) (*ledger.Ledger, error)
func (*NodeEngine) StopServices ¶
func (ne *NodeEngine) StopServices(notify <-chan ServicePoint)
type PeerEngine ¶
type PeerEngine struct { TxHandlerOpts struct { //validator is applied BEFORE pooling and custom filter applied //AFTER that, if nopooling is set, CustomValidators will be also //omitted Customs []pb.TxPreHandler CustomValidators []pb.TxPreHandler NoPooling bool // contains filtered or unexported fields } peer.Peer // contains filtered or unexported fields }
func (*PeerEngine) GenTxEndorser ¶
func (pe *PeerEngine) GenTxEndorser() cred.TxEndorser
func (*PeerEngine) GetServerPoint ¶
func (pe *PeerEngine) GetServerPoint() ServicePoint
func (*PeerEngine) Init ¶
func (pe *PeerEngine) Init(vp *viper.Viper, node *NodeEngine, tag string) error
func (*PeerEngine) IsRunning ¶
func (pe *PeerEngine) IsRunning() (bool, error)
func (*PeerEngine) PreInit ¶
func (pe *PeerEngine) PreInit(node *NodeEngine)
func (*PeerEngine) Run ¶
func (pe *PeerEngine) Run() error
func (*PeerEngine) Stop ¶
func (pe *PeerEngine) Stop()
func (*PeerEngine) Syncer ¶
func (pe *PeerEngine) Syncer() *syncstrategy.SyncEntry
func (*PeerEngine) TxNetwork ¶
func (pe *PeerEngine) TxNetwork() *txnetwork.TxNetworkEntry
type ServicePoint ¶
type ServicePoint struct {
// contains filtered or unexported fields
}
func CreateServerPoint ¶
func CreateServerPoint(conf *viper.Viper) (ServicePoint, error)
func (ServicePoint) CleanStatus ¶
func (ep ServicePoint) CleanStatus()
func (ServicePoint) Init ¶
standard init read all configurations from viper, inwhich we use a subtree of *peer* in the 0.6's configurations
func (ServicePoint) InitWithConfig ¶
func (ep ServicePoint) InitWithConfig(conf *config.ServerSpec) error
func (ServicePoint) Release ¶
func (ep ServicePoint) Release() error
func (ServicePoint) SetPort ¶
some routines for create a simple grpc server (currently only port, no tls and other options enable)
func (ServicePoint) Spec ¶
func (ep ServicePoint) Spec() *config.ServerSpec
func (ServicePoint) Start ¶
func (ep ServicePoint) Start(notify chan<- ServicePoint) error
func (ServicePoint) Status ¶
func (ep ServicePoint) Status() error