本文整理匯總了Golang中github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/node.Node類的典型用法代碼示例。如果您正苦於以下問題:Golang Node類的具體用法?Golang Node怎麽用?Golang Node使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Node類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: startNode
// Private. Create a new node.
func startNode(nd *node.Node, ready chan struct{}, shutDown <-chan struct{}) {
laddr := tmConfig.GetString("node_laddr")
if laddr != "" {
l := p2p.NewDefaultListener("tcp", laddr)
nd.AddListener(l)
}
nd.Start()
// If seedNode is provided by config, dial out.
if len(tmConfig.GetString("seeds")) > 0 {
nd.DialSeed()
}
if len(tmConfig.GetString("rpc_laddr")) > 0 {
nd.StartRPC()
}
ready <- struct{}{}
// Block until everything is shut down.
<-shutDown
nd.Stop()
}
示例2: NewPipe
// Create a new rpc pipe.
func NewPipe(tNode *node.Node) Pipe {
accounts := newAccounts(tNode.ConsensusState(), tNode.MempoolReactor())
blockchain := newBlockchain(tNode.BlockStore())
consensus := newConsensus(tNode.ConsensusState(), tNode.Switch())
events := newEvents(tNode.EventSwitch())
namereg := newNamereg(tNode.ConsensusState())
net := newNetwork(tNode.Switch())
txs := newTransactor(tNode.EventSwitch(), tNode.ConsensusState(), tNode.MempoolReactor(), events)
return &PipeImpl{
tNode,
accounts,
blockchain,
consensus,
events,
namereg,
net,
txs,
}
}