Includes contracts, migrations, tests, user interface and webpack build pipeline.
npm installParity requires Rust version 1.19.0 to build
-
Linux:
$ curl https://sh.rustup.rs -sSf | shParity also requires
gcc,g++,libssl-dev/openssl,libudev-devandpkg-configpackages to be installed. -
OSX:
$ curl https://sh.rustup.rs -sSf | sh
# download Parity code
$ git clone https://github.com/paritytech/parity
$ cd parity
# build in release mode
$ cargo build --releaseThis will produce an executable in the ./target/release subdirectory.
Note: if cargo fails to parse manifest try:
$ ~/.cargo/bin/cargo build --releaseTo start Parity manually, just run
$ ./target/release/parityand Parity will begin syncing the Ethereum blockchain.
Add parity to your command list:
cp /target/release/parity /usr/local/bin You can choose of using web3 with Python and Javascript
Install web3
pip install web3
Using Web3
To use the web3 library you will need to instantiate an instance of the
Web3 object.
>>> from web3 import Web3, HTTPProvider, IPCProvider
# Note that you should create only one RPCProvider per
# process, as it recycles underlying TCP/IP network connections between
# your process and Ethereum node
>>> web3 = Web3(HTTPProvider('http://localhost:8545'))
# or for an IPC based connection
>>> web3 = Web3(IPCProvider())
>>> web3.eth.blockNumber
4000000
This web3 instance will now allow you to interact with the Ethereum
blockchain.
npm i -s web3
Create in /app folder an index.js file
Use the web3 object directly from global namespace:
console.log(web3); // {eth: .., shh: ...} // it's here!Set a provider (HttpProvider)
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
// set the provider you want from Web3.providers
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
}Set a provider (HttpProvider using HTTP Basic Authentication)
web3.setProvider(new web3.providers.HttpProvider('http://host.url', 0, BasicAuthUsername, BasicAuthPassword));There you go, now you can use it:
var coinbase = web3.eth.coinbase;
var balance = web3.eth.getBalance(coinbase);You can find more examples in example directory.