Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Add eth_chainId RPC endpoint #339

Closed
davidmurdoch opened this issue Feb 26, 2019 · 8 comments · Fixed by #419
Closed

Add eth_chainId RPC endpoint #339

davidmurdoch opened this issue Feb 26, 2019 · 8 comments · Fixed by #419

Comments

@davidmurdoch
Copy link
Member

https://github.com/ethereumproject/go-ethereum/wiki/JSON-RPC#eth_chainid

@fireblockdev
Copy link

fireblockdev commented Mar 25, 2019

After discussion with nivida from web3js, this method is needed to use ganache with web3js.

@fireblockdev
Copy link

fireblockdev commented Mar 26, 2019

I did the same but he didn't fix the problem for me. I changed the web3 version in package.json and try to run the tests but the Web3() constructor crashes.

@biocrypto730
Copy link

Thank you @tcichowicz for not being a psycho capitalist

@biocrypto730
Copy link

biocrypto730 commented Jun 13, 2019

@davidmurdoch Is this issue closed now with the push today? Tcichowicz code should be merged right? It is bad that ganache and the latest version of Web3 Don't work together

@lucashenning
Copy link

Any update on this? The issue in the web3.js repo has been closed (web3/web3.js#2610) but I'm still getting the same error in web3 1.0.0-beta.55 and Ganache 2.0.2-beta.0 (2.0.2-beta.0.648).

{"message":"Method eth_chainId not supported.","code":-32000,"data":{"stack":"Error: Method eth_chainId not supported.\n    at GethApiDouble.handleRequest (/Applications/Ganache.app/Contents/Resources/app.asar/node_modules/ganache-core/lib/subproviders/geth_api_double.js:67:16)\n    at next (/Applications/Ganache.app/Contents/Resources/app.asar/node_modules/ganache-core/node_modules/web3-provider-engine/index.js:116:18)

@imbenwolf
Copy link

@davidmurdoch please review #419 so we can finally use latest web3 and ganache versions together

@davidmurdoch
Copy link
Member Author

I've hesitated adding this as the value it returns should be configurable. I'll go ahead and merge this into develop now regardless and follow up with a new Issue to add a chain_id configuration option to core, cli, and UI.

Thanks for keeping on top of this @imbenwolf and @lucashenning!

Aside, it may be worth it to know that [email protected] is the version of web3 that will be released as stable. PR here: web3/web3.js#2905

davidmurdoch pushed a commit that referenced this issue Jul 2, 2019
@davidmurdoch
Copy link
Member Author

Followup issue: #441

Thanks again!

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

Successfully merging a pull request may close this issue.

5 participants