Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI interface Api functionality #651

Open
InoMurko opened this issue Nov 21, 2018 · 3 comments
Open

CLI interface Api functionality #651

InoMurko opened this issue Nov 21, 2018 · 3 comments

Comments

@InoMurko
Copy link
Member

InoMurko commented Nov 21, 2018

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 InoMurko changed the title CLI Api functionality CLI interface Api functionality Nov 21, 2018
@InoMurko InoMurko reopened this Nov 21, 2018
@InoMurko
Copy link
Member Author

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

@hayesgm
Copy link
Contributor

hayesgm commented Nov 21, 2018

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).

@cleishm
Copy link
Contributor

cleishm commented Nov 22, 2018

Sounds reasonable, @hayesgm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants