-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
EIP: Implement eth_chainId
method in JSON-RPC
#695
Conversation
EIPS/eip-rpc_eth_chain_id.md
Outdated
@@ -0,0 +1,80 @@ | |||
## Preamble | |||
|
|||
EIP: <to be assigned> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use 695, and move this file to EIPS/eip-695.md
@whilei are you still around? |
Hi, sure am! Just seeing your message above. Will do. |
|
||
## Specification | ||
|
||
---- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually, we don't have this. It's fine for me though.
EIPS/eip-695.md
Outdated
### eth_chainId | ||
|
||
Returns the currently configured chain id, a value used in replay-protected transaction | ||
signing as introduced by EIP-155. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please link [EIP-155](./eip-155.md)
.
EIPS/eip-695.md
Outdated
|
||
##### Returns | ||
|
||
`QUANTITY` - big integer of the current chain id. Defaults are mainnet=61, morden=62. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON RPC has String, Number, Booleans or Null. I guess it's a String representing an integer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "big integer" is the usual way to say it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, QUANTITY
, for example: https://github.com/ethereum/wiki/wiki/JSON-RPC#net_peercount.
I'll change it to integer of the current chain id. [...]
, ok? (Because integer number
is redundant)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this QUANTITY
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When encoding QUANTITIES (integers, numbers): encode as hex, prefix with "0x", the most compact representation (slight exception: zero should be represented as "0x0"). Examples:
0x41 (65 in decimal)
0x400 (1024 in decimal)
https://github.com/ethereum/wiki/wiki/JSON-RPC#hex-value-encoding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Will you add that link to the PR? Maybe in a Reference
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, 1d1799b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to merge as a draft.
* ethereum/EIPs#695 * Original PR is openethereum#6329
* ethereum/EIPs#695 * Original PR is openethereum#6329
* ethereum/EIPs#695 * Original PR is openethereum#6329
* Support eth_chainId RPC method * ethereum/EIPs#695 * Original PR is #6329 * rpc: remove parity_chainId
Rel ethereum/go-ethereum#15002
/cc @sorpaas @tcz001