コード例 #1
0
ファイル: helpers.go プロジェクト: huangjiehua/tendermint
// create a new node and sleep forever
func newNode(ready chan struct{}) {
	// Create & start node
	node = nm.NewNode()
	l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"))
	node.AddListener(l)
	node.Start()

	// Run the RPC server.
	node.StartRPC()
	ready <- struct{}{}

	// Sleep forever
	ch := make(chan struct{})
	<-ch
}
コード例 #2
0
ファイル: helpers.go プロジェクト: eris-ltd/tendermint
// create a new node and sleep forever
func newNode(ready chan struct{}) {
	// Create & start node
	privValidatorFile := config.GetString("priv_validator_file")
	privValidator := types.LoadOrGenPrivValidator(privValidatorFile)
	node = nm.NewNode(config, privValidator, nm.GetProxyApp)
	l := p2p.NewDefaultListener("tcp", config.GetString("node_laddr"), true)
	node.AddListener(l)
	node.Start()

	// Run the RPC server.
	node.StartRPC()
	ready <- struct{}{}

	// Sleep forever
	ch := make(chan struct{})
	<-ch
}