I want to create a new account over IPC so I have started private chain with the below command

geth --networkid=5 --datadir DataDir --ipcapi "db,eth,net,web3,personal" --ipcpath "/Users/smartSense/.ethereum/geth.ipc"
--rpc -rpcapi "eth,web3" --rpcaddr=localhost --rpcport=8545 --rpccorsdomain "*" console 2>geth.log 

now I'm trying to create new account with web3 api Ref. Link : Link

var options = {
    host: '/Users/smartSense/.ethereum/geth.ipc',
    personal: true,
    admin: false,
    debug: false

var web3Extended = web3_extended.create(options);
        if (!error)

but I got below error:

errorError: Invalid JSON RPC response: "Error: connect ECONNREFUSED\n    at Object.exports._errnoException (util.js:1022:11)
\n    at exports._exceptionWithHostPort (util.js:1045:20)\n    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)"

over RPC I have created successfully but over IPC i got error so any one have idea about that?

  • 1
    Try using this var web3 = new Web3(new Web3.providers.IpcProvider('/Users/myuser/Library/Ethereum/geth.ipc', net)); – Aniket Jul 20 '18 at 18:03

Require web3_ipc instead of web3_extended.

const web3_extended = require('web3_ipc');

Also, make sure your geth.ipc location is right. Mine (Mac OS X) was on ~/Library/Ethereum/geth.ipc.

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.