10

I can run geth console to get a command line interface spawned after launching geth. Similar also works for eth.

I tried parity console but that didn't work out.

 ~ $ parity console
Invalid arguments.

Usage:
  parity daemon <pid-file> [options]
  parity account (new | list) [options]
  parity [options]

Is there anything like that available for parity?

Matthew Schmidt
  • 7,290
  • 1
  • 24
  • 35
q9f
  • 32,913
  • 47
  • 156
  • 395

4 Answers4

5

In March 2016, Gav Wood wrote:

we don't yet have a javascript interface, however it should be possible to use eth console or geth console to connect to a running parity client

i haven't tried that yet, though...

niksmac
  • 9,673
  • 2
  • 40
  • 72
eth
  • 85,679
  • 53
  • 285
  • 406
5

running parity --geth allows to use eth attach or geth attach to spawn a console.

q9f
  • 32,913
  • 47
  • 156
  • 395
  • Please note that you do not need to run parity --geth. You can attach console to a vanilla parity without geth compatibility mode, at least in 1.6.5. – Mikko Ohtamaa Apr 11 '17 at 20:35
  • Doesn't seem to work, it complains: Fatal: Unable to attach to remote geth: dial unix /Users/jikkujose/Library/Ethereum/geth.ipc: connect: no such file or directory. Do I need to specify custom path? – Jikku Jose Jun 19 '17 at 04:09
  • Yes, you need to add the parity IPC path after geth attach. – q9f Jun 19 '17 at 08:01
4

Not yet possible as this issue here suggests.

ethconsole depends on IPC, which will be available as of Civility (1.1).

Dawny33
  • 2,007
  • 2
  • 16
  • 27
luclu
  • 141
  • 1
  • 4
2

geth attach only lets you use webjs methods at the moment. By using nodejs console with @parity/api package you can access parity methods.

Install package globally and launch concole :

$ npm install @parity/api
$ node

On node console use parity package :

>// 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);

// eg. use api.parity.addReservedPeer method
>api.parity.addReservedPeer("enode://d64d5f74b1715c525dc88e87a52eca1574c09593ed29401d205ecfef9fbfe52fa308f966bab3a5966da1bb74212fecdb328cddceb572c38b536c597166784347@203080240034.static.ctinets.com:35423").then((data)=> {console.log(data)})
Kerem atam
  • 402
  • 3
  • 13