Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Precise HTTP or WebSockets for JSON-RPC options #9027

Merged
merged 2 commits into from Jul 3, 2018
Merged

Conversation

Tbaut
Copy link
Contributor

@Tbaut Tbaut commented Jul 2, 2018

- Align with https://github.com/ethereum/go-ethereum/wiki/Command-Line-Options
- Make sure the JSON-RPC naming is consistent across the CLI options
@Tbaut Tbaut added A0-pleasereview 🤓 Pull request needs code review. A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). M4-core ⛓ Core client code / Rust. labels Jul 2, 2018
@Tbaut Tbaut requested review from folsen and dvdplm July 2, 2018 14:24
@parity-cla-bot
Copy link

It looks like @Tbaut signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@5chdn 5chdn added this to the 1.12 milestone Jul 2, 2018
@@ -315,7 +315,7 @@ usage! {

ARG arg_ports_shift: (u16) = 0u16, or |c: &Config| c.misc.as_ref()?.ports_shift,
"--ports-shift=[SHIFT]",
"Add SHIFT to all port numbers Parity is listening on. Includes network port and all servers (RPC, WebSockets, UI, IPFS, SecretStore).",
"Add SHIFT to all port numbers Parity is listening on. Includes network port and all servers (HTTP JSON-RPC, WebSockets JSON-RPC, UI, IPFS, SecretStore).",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off-topic: Can you remove UI here while we are at it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@@ -646,7 +646,7 @@ usage! {

FLAG flag_tx_queue_no_unfamiliar_locals: (bool) = false, or |c: &Config| c.mining.as_ref()?.tx_queue_no_unfamiliar_locals.clone(),
"--tx-queue-no-unfamiliar-locals",
"Transactions received via local means (RPC, WS, etc) will be treated as external if the sending account is unknown.",
"Transactions received via local means (HTTP JSON-RPC, WS JSON-RPC, etc) will be treated as external if the sending account is unknown.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here: WebSockets or WS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I left it as "ws" was not part of the flag, but you're right, I'll change it to WebSockets.

@Tbaut Tbaut changed the title Precise HTTP or WS for JSON-RPC options Precise HTTP or WebSockets for JSON-RPC options Jul 2, 2018
@5chdn 5chdn added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jul 3, 2018
@5chdn 5chdn merged commit f310721 into master Jul 3, 2018
@5chdn 5chdn deleted the Tbaut-patch-JSON-RPC branch July 3, 2018 09:34
Copy link
Collaborator

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some wording/spelling grumbles.

@@ -315,7 +315,7 @@ usage! {

ARG arg_ports_shift: (u16) = 0u16, or |c: &Config| c.misc.as_ref()?.ports_shift,
"--ports-shift=[SHIFT]",
"Add SHIFT to all port numbers Parity is listening on. Includes network port and all servers (RPC, WebSockets, UI, IPFS, SecretStore).",
"Add SHIFT to all port numbers Parity is listening on. Includes network port and all servers (HTTP JSON-RPC, WebSockets JSON-RPC, IPFS, SecretStore).",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/port/ports/ (plural s)

Also, not sure what is meant by "all servers" – perhaps "services" is better? That is, how is "notwork ports" different from other ports?

Maybe this: "Add SHIFT to all network port numbers used by Parity. This includes ports used by any enabled services (JSON-RPC over HTTP/WS, IPFS and SecretStore)." ?

Copy link
Contributor Author

@Tbaut Tbaut Jul 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the plural is on the "number*s", I think it's correct.
Network as in network discovery (30303 per default). This is the port used to connect to other peers.
Parity run http and ws servers to listen to incoming calls, I think "server" is fine here.

@@ -449,59 +449,59 @@ usage! {
"--reserved-peers=[FILE]",
"Provide a file containing enodes, one per line. These nodes will always have a reserved slot on top of the normal maximum peers.",

["API and Console Options – RPC"]
["API and Console Options – HTTP JSON-RPC"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "…JSON-RPC over HTTP"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep it short.

FLAG flag_no_jsonrpc: (bool) = false, or |c: &Config| c.rpc.as_ref()?.disable.clone(),
"--no-jsonrpc",
"Disable the JSON-RPC API server.",
"Disable the HTTP JSON-RPC API server.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe "JSON-RPC HTTP API server"?


ARG arg_jsonrpc_apis: (String) = "web3,eth,pubsub,net,parity,private,parity_pubsub,traces,rpc,shh,shh_pubsub", or |c: &Config| c.rpc.as_ref()?.apis.as_ref().map(|vec| vec.join(",")),
"--jsonrpc-apis=[APIS]",
"Specify the APIs available through the JSONRPC 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 contains following apis: web3, net, eth, pubsub, parity, parity_pubsub, traces, rpc, shh, shh_pubsub",
"Specify the APIs available through the HTTP JSON-RPC 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 contains following apis: web3, net, eth, pubsub, parity, parity_pubsub, traces, rpc, shh, shh_pubsub",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe . "safe" enables the following APIs: web3, net … …?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


ARG arg_jsonrpc_hosts: (String) = "none", or |c: &Config| c.rpc.as_ref()?.hosts.as_ref().map(|vec| vec.join(",")),
"--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\",.",

ARG arg_jsonrpc_threads: (usize) = 4usize, or |c: &Config| c.rpc.as_ref()?.processing_threads,
"--jsonrpc-threads=[THREADS]",
"Turn on additional processing threads in all RPC servers. Setting this to non-zero value allows parallel cpu-heavy queries execution.",
"Turn on additional processing threads in all HTTP JSON-RPC servers. Setting this to non-zero value allows parallel cpu-heavy queries execution.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/parallel cpu-heavy queries execution./parallel execution of cpu-heavy queries/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


ARG arg_ws_apis: (String) = "web3,eth,pubsub,net,parity,parity_pubsub,private,traces,rpc,shh,shh_pubsub", or |c: &Config| c.websockets.as_ref()?.apis.as_ref().map(|vec| vec.join(",")),
"--ws-apis=[APIS]",
"Specify the 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 contains following apis: web3, net, eth, pubsub, parity, parity_pubsub, traces, rpc, shh, shh_pubsub",
"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 contains following apis: web3, net, eth, pubsub, parity, parity_pubsub, traces, rpc, shh, shh_pubsub",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe . "safe" enables the following APIs: web3, net … …?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -513,7 +513,7 @@ usage! {

ARG arg_ws_max_connections: (usize) = 100usize, or |c: &Config| c.websockets.as_ref()?.max_connections,
"--ws-max-connections=[CONN]",
"Maximal number of allowed concurrent WS connections.",
"Maximal number of allowed concurrent WebSockets JSON-RPC connections.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Maximal/Maximum/ (or just max)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -646,7 +646,7 @@ usage! {

FLAG flag_tx_queue_no_unfamiliar_locals: (bool) = false, or |c: &Config| c.mining.as_ref()?.tx_queue_no_unfamiliar_locals.clone(),
"--tx-queue-no-unfamiliar-locals",
"Transactions received via local means (RPC, WS, etc) will be treated as external if the sending account is unknown.",
"Transactions received via local means (HTTP JSON-RPC, WebSockets JSON-RPC, etc) will be treated as external if the sending account is unknown.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ambiguity of "means" in english makes me stumble when I read this.
How about "Transactions received through JSON-RPC (HTTP or WS) will be treated as external if the sending account is unknown."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -885,7 +885,7 @@ usage! {

FLAG flag_dapps_apis_all: (bool) = false, or |_| None,
"--dapps-apis-all",
"Dapps server is merged with RPC server. Use --jsonrpc-apis.",
"Dapps server is merged with HTTP JSON-RPC server. Use --jsonrpc-apis.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we prefix with "DEPRECATED. Dapps server is merged… …"?

@@ -913,7 +913,7 @@ usage! {

FLAG flag_jsonrpc: (bool) = false, or |_| None,
"-j, --jsonrpc",
"Does nothing; JSON-RPC is on by default now.",
"Does nothing; HTTP JSON-RPC is on by default now.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need DEPRECATED prefix? Also, I for one prefer "JSON-RPC over HTTP".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same below)

@Tbaut
Copy link
Contributor Author

Tbaut commented Jul 3, 2018

Valid comments but out of scope for this PR @dvdplm I'm afraid :(

@5chdn
Copy link
Contributor

5chdn commented Jul 3, 2018

@dvdplm the deprecated prefix is not necessary as those options are not displayed in --help anymore. It's more for historic reasons.

@Tbaut
Copy link
Contributor Author

Tbaut commented Jul 6, 2018

@dvdplm added some of your suggestions #9060

ordian added a commit to ordian/parity that referenced this pull request Jul 9, 2018
…rp_sync_on_light_client

* 'master' of https://github.com/paritytech/parity:
  Never drop local transactions from different senders. (openethereum#9002)
  Precise HTTP or WebSockets for JSON-RPC options (openethereum#9027)
  Recently rejected cache for transaction queue (openethereum#9005)
  Make HashDB generic (openethereum#8739)
  Only return error log for rustls (openethereum#9025)
  Update Changelogs for 1.10.8 and 1.11.5 (openethereum#9012)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A2-insubstantial 👶 Pull request requires no code review (e.g., a sub-repository hash update). A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants