openethereum/js
Wei Tang d8af9f4e7b Add RPC eth_chainId for querying the current blockchain chain ID (#6329)
* Add RPC eth_chainId for querying the current blockchain chain ID

Currently although we can use `net_version` RPC call to get the
current network ID, there's no RPC for querying the chain ID. This
makes it impossible to determine the current actual blockchain using
the RPC. An ETH/ETC client can accidentally connect to an ETC/ETH RPC
endpoint without knowing it unless it tries to sign a transaction or
it fetch a transaction that is known to have signed with a chain
ID. This has since caused trouble for application developers, such as
MetaMask, to add multi-chain support.

The same RPC endpoint is also about to be merged for ETC's
go-ethereum: https://github.com/ethereumproject/go-ethereum/pull/336

* Add eth_chainId to js's web3 interface

* Add a mocked test for eth_chainId

* Add chainId in js's jsonrpc interfaces

* Change return type for eth_chainId to `Option<u64>`

* Change name eth_chainId to parity_chainId

* Wrong test name and missed var for rpc_parity_chain_id test

* Use U256 to return chainId and fix for master

u64 returns decimal integer, and there seems to be no type called
U64. So here I use U256 to return the hex integer.

* Fix chainID test

Before EIP155 fork number, chainID should be null.

* Change both parity_chainId and transaction::chainId to use U64

This makes it consistent that all chain ids returned are hex string.

* Fix wrong U64 serialization
2017-09-26 14:17:07 +02:00
..
assets Refactoring of the Dapp Registry (#4589) 2017-03-10 13:31:57 +01:00
npm Updating paths to repos. (#5330) 2017-03-29 15:17:27 +02:00
scripts Add language selector in production (#6317) 2017-09-05 12:26:29 +01:00
src Add RPC eth_chainId for querying the current blockchain chain ID (#6329) 2017-09-26 14:17:07 +02:00
test PubSub for parity-js (#5830) 2017-07-06 09:50:27 +02:00
wasm updated tiny-keccak to 1.3 2017-08-07 10:06:02 +02:00
webpack Add new md tnc (#5937) 2017-07-10 13:23:59 +02:00
.babelrc Use babel-runtime as opposed to babel-polyfill (#5662) 2017-05-19 16:51:15 +02:00
.codeclimate.yml Initial new UI source code import (#2607) 2016-10-18 11:52:56 +02:00
.editorconfig Initial new UI source code import (#2607) 2016-10-18 11:52:56 +02:00
.eslintrc.json Eslint formatting updates (#4234) 2017-01-23 13:39:52 +01:00
.gitignore YARN (#5395) 2017-04-26 11:33:29 +02:00
.istanbul.yml Initial new UI source code import (#2607) 2016-10-18 11:52:56 +02:00
.npmignore Initial new UI source code import (#2607) 2016-10-18 11:52:56 +02:00
.npmrc Allow signing via Qr (#4881) 2017-03-31 23:36:24 +02:00
.stylelintrc.json Add lint:css 2016-12-14 16:42:26 +01:00
build.rs Fix whitespace (#4299) 2017-01-25 18:51:41 +01:00
Cargo.precompiled.toml Updating syntex et al (#4983) 2017-03-21 23:26:05 +03:00
Cargo.toml Bumped version 2017-07-13 15:52:01 +02:00
LICENSE Initial new UI source code import (#2607) 2016-10-18 11:52:56 +02:00
package-lock.json Debounce sync status. (#6572) 2017-09-26 13:05:41 +02:00
package.json [ci skip] js-precompiled 20170926-093714 2017-09-26 09:43:21 +00:00
README.md Switch --signer- to --ui- 2016-11-12 15:21:51 +01:00
yarn.lock Recover from empty phrase in dev mode (#5698) 2017-05-30 19:28:50 +02:00

parity.js

JavaScript APIs and UIs for Parity.

development

  1. Install Node if not already available
  2. Change to the js directory inside parity/
  3. Install the npm modules via npm install
  4. Parity should be run with parity --ui-no-validation [...options] (where options can be --chain testnet)
  5. Start the development environment via npm start
  6. Connect to the UI