Executes CLI command on remote node. ### Preliminary stage 1. Find out public key of the node, from which `EXEC_CMD` will be requested. This can be done by using the following command in the cellframe-node-tool: ```actionscript cellframe-node-tool cert pkey show node-addr ``` 2. On the node, which is going to receive requests, make some changes in the [[Cellframe Node General Config#Section [server]|cellframe node configuration]]. ```ini [server] enabled=true exec_cmd=[pkey from previous step] ``` 3. The node, which is going to receive requests, must be in the node list. 4. Restart the node after making changes in the config. ## Request Structure `JSON object:` ```JSON { "method": "exec_cmd", "subcommand": ["exec_cmd"], "arguments": { "net": "network_name", "addr": "node address", "cmd": "command,and,all,args,separated,by,commas" }, "id": "1" } ``` `Parameters:` **`net (network_name)`** - name of the Cellframe Network. The list of networks can be found in the `<Config_dir> \ etc \ network` folder or received using - [[Node Command - NET LIST]] **`addr`** - node address **`cmd`** - command including all arguments separated by commas `Requested command:` ```actionscript cellframe-node-cli get status -net raiden ``` ### Curl Example `Request:` ```actionscript curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d ' { "method": "exec_cmd", "subcommand": ["exec_cmd"], "arguments": { "net": "raiden", "addr": "C5BF::79BA::CC16::8D7C", "cmd": "net,-net,raiden,get,status" }, "id": "1" }' ``` `Response:` ```json { "type": 2, "result": [ { "type": 2, "result": [ { "status": { "net": "raiden", "current_addr": "C5BF::79BA::CC16::8D7C", "links": { "active": 4, "required": 3 }, "processed": { "zerochain": { "status": "synced", "current": 760, "in network": 760, "percent": "100.000 %" }, "main": { "status": "synced", "current": 52517, "in network": 52517, "percent": "100.000 %" } }, "states": { "current": "NET_STATE_ONLINE", "target": "NET_STATE_ONLINE" } } } ], "id": 0 } ], "id": 1 } ```