mana icon indicating copy to clipboard operation
mana copied to clipboard

CLI interface Api functionality

Open InoMurko opened this issue 5 years ago • 3 comments

GETH

API AND CONSOLE OPTIONS:
  --rpc                  Enable the HTTP-RPC server
  --rpcaddr value        HTTP-RPC server listening interface (default: "localhost")
  --rpcport value        HTTP-RPC server listening port (default: 8545)
  --rpcapi value         API's offered over the HTTP-RPC interface
  --ws                   Enable the WS-RPC server
  --wsaddr value         WS-RPC server listening interface (default: "localhost")
  --wsport value         WS-RPC server listening port (default: 8546)
  --wsapi value          API's offered over the WS-RPC interface
  --wsorigins value      Origins from which to accept websockets requests
  --ipcdisable           Disable the IPC-RPC server
  --ipcpath              Filename for IPC socket/pipe within the datadir (explicit paths escape it)
  --rpccorsdomain value  Comma separated list of domains from which to accept cross origin requests (browser enforced)
  --rpcvhosts value      Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: "localhost")
  --jspath loadScript    JavaScript root path for loadScript (default: ".")
  --exec value           Execute JavaScript statement
  --preload value        Comma separated list of JavaScript files to preload into the console

Parity

API and Console Options – HTTP JSON-RPC:
    --no-jsonrpc
        Disable the HTTP JSON-RPC API server.
    --jsonrpc-port=[PORT]
        Specify the port portion of the HTTP JSON-RPC API server. (default: 8545)
    --jsonrpc-interface=[IP]
        Specify the hostname portion of the HTTP JSON-RPC API server, IP should be an interface's IP address, or all
        (all interfaces) or local. (default: local)
    --jsonrpc-apis=[APIS]
        Specify the APIs available through the HTTP JSON-RPC interface using a comma-delimited list of API names.
        Possible names are: all, safe, debug, web3, net, eth, pubsub, personal, signer, parity, parity_pubsub,
        parity_accounts, parity_set, traces, rpc, secretstore, shh, shh_pubsub. You can also disable a specific API by
        putting '-' in the front, example: all,-personal. 'safe' enables the following APIs: web3, net, eth, pubsub,
        parity, parity_pubsub, traces, rpc, shh, shh_pubsub (default:
        web3,eth,pubsub,net,parity,private,parity_pubsub,traces,rpc,shh,shh_pubsub)
    --jsonrpc-hosts=[HOSTS]
        List of allowed Host header values. This option will validate the Host header sent by the browser, it is
        additional security against some attack vectors. Special options: "all", "none",. (default: none)
    --jsonrpc-threads=[THREADS]
        Turn on additional processing threads in all HTTP JSON-RPC servers. Setting this to non-zero value allows
        parallel execution of cpu-heavy queries. (default: 4)
    --jsonrpc-cors=[URL]
        Specify CORS header for HTTP JSON-RPC API responses. Special options: "all", "none". (default: none)
    --jsonrpc-server-threads=[NUM]
        Enables multiple threads handling incoming connections for HTTP JSON-RPC server.
    --jsonrpc-max-payload=[MB]
        Specify maximum size for HTTP JSON-RPC requests in megabytes.

API and Console Options – WebSockets:
    --no-ws
        Disable the WebSockets JSON-RPC server.
    --ws-port=[PORT]
        Specify the port portion of the WebSockets JSON-RPC server. (default: 8546)
    --ws-interface=[IP]
        Specify the hostname portion of the WebSockets JSON-RPC server, IP should be an interface's IP address, or all
        (all interfaces) or local. (default: local)
    --ws-apis=[APIS]
        Specify the JSON-RPC APIs available through the WebSockets interface using a comma-delimited list of API names.
        Possible names are: all, safe, web3, net, eth, pubsub, personal, signer, parity, parity_pubsub, parity_accounts,
        parity_set, traces, rpc, secretstore, shh, shh_pubsub. You can also disable a specific API by putting '-' in the
        front, example: all,-personal. 'safe' enables the following APIs: web3, net, eth, pubsub, parity, parity_pubsub,
        traces, rpc, shh, shh_pubsub (default:
        web3,eth,pubsub,net,parity,parity_pubsub,private,traces,rpc,shh,shh_pubsub)
    --ws-origins=[URL]
        Specify Origin header values allowed to connect. Special options: "all", "none". (default: parity://*,chrome
        -extension://*,moz-extension://*)
    --ws-hosts=[HOSTS]
        List of allowed Host header values. This option will validate the Host header sent by the browser, it is
        additional security against some attack vectors. Special options: "all", "none". (default: none)
    --ws-max-connections=[CONN]
        Maximum number of allowed concurrent WebSockets JSON-RPC connections. (default: 100)

API and Console Options – IPC:
    --no-ipc
        Disable JSON-RPC over IPC service.
    --ipc-path=[PATH]
        Specify custom path for JSON-RPC over IPC service. (default: $BASE/jsonrpc.ipc)
    --ipc-apis=[APIS]
        Specify custom API set available via JSON-RPC over IPC using a comma-delimited list of API names. Possible names
        are: all, safe, web3, net, eth, pubsub, personal, signer, parity, parity_pubsub, parity_accounts, parity_set,
        traces, rpc, secretstore, shh, shh_pubsub. You can also disable a specific API by putting '-' in the front,
        example: all,-personal. 'safe' enables the following APIs: web3, net, eth, pubsub, parity, parity_pubsub,
        traces, rpc, shh, shh_pubsub (default:
        web3,eth,pubsub,net,parity,parity_pubsub,parity_accounts,private,traces,rpc,shh,shh_pubsub)

What do we plan to support and which interface standard should we follow?

InoMurko avatar Nov 21 '18 13:11 InoMurko

Let's follow Parity api specs, this is a good first issue for @cleishm

InoMurko avatar Nov 21 '18 15:11 InoMurko

In general, I'd argue that the best path is to follow the CLI options that are shared between Parity and Geth, and then go our own way on the ones that are not (which, may be the same as Parity or Geth's). The reason being that I expect mana --no-sync --nat none --bootnodes enodes://... to work since it does for both geth and parity, but mana --jspath is kind of geth-specific.

That said, as it looks like RPC doesn't line, choose the one you think is best. I think default on (e.g. --no-sync) is probably the correct decision so long as the rpc server is default protected (e.g. no unlocked accounts, etc).

hayesgm avatar Nov 21 '18 19:11 hayesgm

Sounds reasonable, @hayesgm!

cleishm avatar Nov 22 '18 02:11 cleishm