neo-project / neo

NEO Smart Economy
MIT License
3.47k stars 1.03k forks source link

node: Can we make Neo-cli Single Command Executable #3011

Open cloud8little opened 4 years ago

cloud8little commented 4 years ago

Summary or problem description Currently we can only input command after starting neo-cli, such as create/open wallet, deploy contract, invoke contract, and the same time, neo-cli will sync blocks in one process. The only way we interact with neo-cli client is to input the command in the console.

37a2fb45bb72dadba950550e78191c9

The idea is to split neo-cli into two separate part: (temporary) Node and Interactive Console. Node: sync block when new block comes, deal with p2p connection. this is a process and similar to the "server" side. Interactive Console: accept user command similar to RPC request, such as ./neo-cli openwallet "1.json" and forward the request to the Node and Node will return the response to the Console, then print the output on the console.

Advantage: no need to screen/nohup start neo-cli at the beginning. and it is easier to input a command than a whole RPC request, which will need extra request header and body.

Neo Version

Where in the software does this update applies to?

Tommo-L commented 4 years ago

I think it's a good feature, if so, we can split into three things: An executeable neo-node, which can accept some startup parameters. An interactive and simple neo-cli, which communicate with neo-node by rpc or ipc, can also connect a remote node. An interactive and simple neo-gui, which communicate with neo-node by rpc or ipc, can also connect a remote node.

And when we release neo-node, we can also package neo-cli and neo-gui together.

doubiliu commented 4 years ago

Agree, this can simplify the function of the node.But connecting remote nodes may need to consider some security issues。