There is nothing like parity console.
How to open the JavaScript console on Parity?
There is nothing like parity console.
How to open the JavaScript console on Parity?
Either use the geth console attached to parity or use the Parity UI application Parity/Web3 Console.
To attach Geth console to Parity, (on Linux) use:
geth attach ~/.local/share/io.parity.ethereum/jsonrpc.ipc
On MacOS use:
geth attach ~/Library/Application Support/io.parity.ethereum/jsonrpc.ipc
To access the Parity/Web3 Console, open the UI, go to Applications and open the Parity/Web3 Console:
A Node.js CLI Console can be used per the Parity wiki:
You can install node/NPM and use its console. Once you have node/NPM installed, you'll just need to install the latest web3 module:
$ npm install web3
From then on you just need to run node and require the web3 module:
$ node
> Web3 = require("web3")
> web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
After this point, you'll be able to use the web3 API from with this environment, e.g.:
> web3.eth.blockNumber
743397
api.parity.addReservedPeer('enode://0000..0007@<IP>:<Port#>') under node? Since I was not able to run it, parity could not connect to my private network and web.eth.blockNumber returns 0. @eth
– alper
Mar 20 '17 at 08:05
api.parity isn't part of web3. Maybe ask a separate question and someone can answer.
– eth
Mar 31 '17 at 10:01
In addition to @eth's response; if you like to have Parity's api calls; just install parity's api package instead of web3.
$ npm install @parity/api
$ node
On node console :
>// import the actual Api class
>const Api = require("@parity/api");
>// do the setup
>const provider = new Api.Provider.Http('http://localhost:8545');
>const api = new Api(provider);
// use api.parity.addReservedPeer
api.parity.addReservedPeer("enode://d64d5f74b1715c525dc88e87a52eca1574c09593ed29401d205ecfef9fbfe52fa308f966bab3a5966da1bb74212fecdb328cddceb572c38b536c597166784347@203080240034.static.ctinets.com:35423").then((data)=> {console.log(data)})
~/.local/share/io.parity.ethereumdoes not seem to exist on my case. I guess because I tried it on mac. Also Insidegethit says'api' is not defined.@5chdn – alper Mar 18 '17 at 05:13~/Library/Application Support/io.parity.ethereum/folder,jsonrpc.ipcdoes not show up. Could it be/Users/avatar/Library/Application Support/io.parity.ethereum/ipc/parity-chain.ipc? @5chdn. – alper Mar 18 '17 at 11:03[~]$ sudo geth attach /Users/alper/Library/Application\ Support/io.parity.ethereum/ipc/parity-chain.ipcgives an error as =Fatal: Unable to attach to remote geth: dial unix /Users/alper/Library/Application Support/io.parity.ethereum/ipc/parity-chain.ipc: connect: connection refused@5chdn – alper Mar 19 '17 at 05:33