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

Backporting to beta #3229

Merged
merged 2 commits into from
Nov 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# [Parity](https://ethcore.io/parity.html)
### Fast, light, and robust Ethereum implementation

[![Join the chat at https://gitter.im/ethcore/parity.js](https://badges.gitter.im/ethcore/parity.js.svg)](https://gitter.im/ethcore/parity.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status][travis-image]][travis-url] [![build status](https://gitlab.ethcore.io/Mirrors/ethcore-parity/badges/master/build.svg)](https://gitlab.ethcore.io/Mirrors/ethcore-parity/commits/master) [![Coverage Status][coveralls-image]][coveralls-url] [![GPLv3][license-image]][license-url]

[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Join the chat at https://gitter.im/ethcore/parity][gitter-image]][gitter-url] [![GPLv3][license-image]][license-url]
### Join the chat!

Parity [![Join the chat at https://gitter.im/ethcore/parity][gitter-image]][gitter-url] and
parity.js [![Join the chat at https://gitter.im/ethcore/parity.js](https://badges.gitter.im/ethcore/parity.js.svg)](https://gitter.im/ethcore/parity.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

[Internal Documentation][doc-url]

Expand All @@ -21,7 +24,7 @@ Be sure to check out [our wiki][wiki-url] for more information.
[doc-url]: https://ethcore.github.io/parity/ethcore/index.html
[wiki-url]: https://github.com/ethcore/parity/wiki

**Requires Rust version 1.12.0 to build**
**Parity requires Rust version 1.12.0 to build**

----

Expand All @@ -31,12 +34,15 @@ Be sure to check out [our wiki][wiki-url] for more information.
Parity's goal is to be the fastest, lightest, and most secure Ethereum client. We are developing Parity using the sophisticated and
cutting-edge Rust programming language. Parity is licensed under the GPLv3, and can be used for all your Ethereum needs.

By default, Parity will run a JSONRPC server on `127.0.0.1:8545`. This is fully configurable and supports a number
of RPC APIs.
Parity comes with a built-in wallet. To access [Parity Wallet](http://127.0.0.1:8080/) this simply go to http://127.0.0.1:8080/. It
includes various functionality allowing you to:
- create and manage your Ethereum accounts;
- manage your Ether and any Ethereum tokens;
- create and register your own tokens;
- and much more.

Parity also runs a server for running decentralized apps, or "Dapps", on `http://127.0.0.1:8080`.
This includes a few useful Dapps, including Ethereum Wallet, Maker OTC, and a node status page.
In a near-future release, it will be easy to install Dapps and use them through this web interface.
By default, Parity will also run a JSONRPC server on `127.0.0.1:8545`. This is fully configurable and supports a number
of RPC APIs.

If you run into an issue while using parity, feel free to file one in this repository
or hop on our [gitter chat room][gitter-url] to ask a question. We are glad to help!
Expand Down
3 changes: 2 additions & 1 deletion js/src/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ APIs implement the calls as exposed in the [Ethcore JSON Ethereum RPC](https://g

- [ethapi.db](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#db)
- [ethapi.eth](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#eth)
- [ethapi.ethcore](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#ethcore)
- [ethapi.parity](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#parity)
- [ethapi.net](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#net)
- [ethapi.personal](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#personal)
- [ethapi.shh](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#shh)
- [ethapi.signer](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#signer)
- [ethapi.trace](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#trace)
- [ethapi.web3](https://github.com/ethcore/ethereum-rpc-json/blob/master/interfaces.md#web3)

Expand Down
13 changes: 9 additions & 4 deletions js/src/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { Http, Ws } from './transport';
import Contract from './contract';

import { Db, Eth, Ethcore, Net, Personal, Shh, Trace, Web3 } from './rpc';
import { Db, Eth, Parity, Net, Personal, Shh, Signer, Trace, Web3 } from './rpc';
import Subscriptions from './subscriptions';
import util from './util';
import { isFunction } from './util/types';
Expand All @@ -32,10 +32,11 @@ export default class Api {

this._db = new Db(transport);
this._eth = new Eth(transport);
this._ethcore = new Ethcore(transport);
this._net = new Net(transport);
this._parity = new Parity(transport);
this._personal = new Personal(transport);
this._shh = new Shh(transport);
this._signer = new Signer(transport);
this._trace = new Trace(transport);
this._web3 = new Web3(transport);

Expand All @@ -50,8 +51,8 @@ export default class Api {
return this._eth;
}

get ethcore () {
return this._ethcore;
get parity () {
return this._parity;
}

get net () {
Expand All @@ -66,6 +67,10 @@ export default class Api {
return this._shh;
}

get signer () {
return this._signer;
}

get trace () {
return this._trace;
}
Expand Down
6 changes: 3 additions & 3 deletions js/src/api/contract/contract.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default class Contract {
options.gas = gas.toFixed(0);

setState({ state: 'postTransaction', gas });
return this._api.eth.postTransaction(this._encodeOptions(this.constructors[0], options, values));
return this._api.parity.postTransaction(this._encodeOptions(this.constructors[0], options, values));
})
.then((requestId) => {
setState({ state: 'checkRequest', requestId });
Expand Down Expand Up @@ -166,7 +166,7 @@ export default class Contract {
}

_pollCheckRequest = (requestId) => {
return this._api.pollMethod('eth_checkRequest', requestId);
return this._api.pollMethod('parity_checkRequest', requestId);
}

_pollTransactionReceipt = (txhash, gas) => {
Expand Down Expand Up @@ -208,7 +208,7 @@ export default class Contract {

if (!func.constant) {
func.postTransaction = (options, values = []) => {
return this._api.eth
return this._api.parity
.postTransaction(this._encodeOptions(func, this._addOptionsTo(options), values));
};

Expand Down
22 changes: 11 additions & 11 deletions js/src/api/contract/contract.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ describe('api/contract/Contract', () => {
before(() => {
scope = mockHttp([
{ method: 'eth_estimateGas', reply: { result: 1000 } },
{ method: 'eth_postTransaction', reply: { result: '0x678' } },
{ method: 'eth_checkRequest', reply: { result: null } },
{ method: 'eth_checkRequest', reply: { result: '0x890' } },
{ method: 'parity_postTransaction', reply: { result: '0x678' } },
{ method: 'parity_checkRequest', reply: { result: null } },
{ method: 'parity_checkRequest', reply: { result: '0x890' } },
{ method: 'eth_getTransactionReceipt', reply: { result: null } },
{ method: 'eth_getTransactionReceipt', reply: { result: RECEIPT_PEND } },
{ method: 'eth_getTransactionReceipt', reply: { result: RECEIPT_DONE } },
Expand All @@ -266,7 +266,7 @@ describe('api/contract/Contract', () => {
});

it('passes the options through to postTransaction (incl. gas calculation)', () => {
expect(scope.body.eth_postTransaction.params).to.deep.equal([
expect(scope.body.parity_postTransaction.params).to.deep.equal([
{ data: '0x123', gas: '0x4b0' }
]);
});
Expand All @@ -280,8 +280,8 @@ describe('api/contract/Contract', () => {
it('fails when gasUsed == gas', () => {
mockHttp([
{ method: 'eth_estimateGas', reply: { result: 1000 } },
{ method: 'eth_postTransaction', reply: { result: '0x678' } },
{ method: 'eth_checkRequest', reply: { result: '0x789' } },
{ method: 'parity_postTransaction', reply: { result: '0x678' } },
{ method: 'parity_checkRequest', reply: { result: '0x789' } },
{ method: 'eth_getTransactionReceipt', reply: { result: RECEIPT_EXCP } }
]);

Expand All @@ -295,8 +295,8 @@ describe('api/contract/Contract', () => {
it('fails when no code was deployed', () => {
mockHttp([
{ method: 'eth_estimateGas', reply: { result: 1000 } },
{ method: 'eth_postTransaction', reply: { result: '0x678' } },
{ method: 'eth_checkRequest', reply: { result: '0x789' } },
{ method: 'parity_postTransaction', reply: { result: '0x678' } },
{ method: 'parity_checkRequest', reply: { result: '0x789' } },
{ method: 'eth_getTransactionReceipt', reply: { result: RECEIPT_DONE } },
{ method: 'eth_getCode', reply: { result: '0x' } }
]);
Expand Down Expand Up @@ -360,15 +360,15 @@ describe('api/contract/Contract', () => {

describe('postTransaction', () => {
beforeEach(() => {
scope = mockHttp([{ method: 'eth_postTransaction', reply: { result: ['hashId'] } }]);
scope = mockHttp([{ method: 'parity_postTransaction', reply: { result: ['hashId'] } }]);
});

it('encodes options and mades an eth_postTransaction call', () => {
it('encodes options and mades an parity_postTransaction call', () => {
return func
.postTransaction({ someExtras: 'foo' }, VALUES)
.then(() => {
expect(scope.isDone()).to.be.true;
expect(scope.body.eth_postTransaction.params[0]).to.deep.equal({
expect(scope.body.parity_postTransaction.params[0]).to.deep.equal({
someExtras: 'foo',
to: ADDR,
data: ENCODED
Expand Down
10 changes: 0 additions & 10 deletions js/src/api/rpc/eth/eth.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ export default class Eth {
.execute('eth_call', inOptions(options), inBlockNumber(blockNumber));
}

checkRequest (requestId) {
return this._transport
.execute('eth_checkRequest', inNumber16(requestId));
}

coinbase () {
return this._transport
.execute('eth_coinbase')
Expand Down Expand Up @@ -267,11 +262,6 @@ export default class Eth {
.execute('eth_pendingTransactions');
}

postTransaction (options) {
return this._transport
.execute('eth_postTransaction', inOptions(options));
}

protocolVersion () {
return this._transport
.execute('eth_protocolVersion');
Expand Down
Loading