4

Follow up on this post Does parity include a console?

It is possible to have a JS script -with web3 nodejs library- running in a linux machine which only has installed parity as a client (no geth)?

Thanks!

5

Sure.

$ npm install web3
$ node test.js

... where test.js looks like this:

const Web3 = require('web3');
const web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));
console.log(web3.eth.accounts);
  • thanks! so it does not matter if the client is geth or parity (or other) the web3 will work either way? – donpresente Nov 12 '16 at 10:23
  • Correct, web3 uses the JSONRPC interface which both clients expose. (See github.com/ethereum/wiki/wiki/JSON-RPC) – Jamie Hale Nov 16 '16 at 1:27
  • 1
    Piles, but not that would fit or be appropriate here. But keep an eye on the --geth command-line parameter for parity. I've found that there are issues with gas estimates for contract deployment that only get resolved with you run parity --geth. See github.com/ethcore/parity/issues/2434 – Jamie Hale Nov 18 '16 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.