Skip to main content
added 290 characters in body
Source Link
Alon
  • 277
  • 1
  • 3
  • 8

I'm trying to create an account through Node.js. This is my code:

export async function createNewAccount() {
    var web3Instance =  new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
    return web3Instance.eth.accounts.create();
}

But I'm getting the following error (from 'create' function):

Invalid JSON RPC response: undefined

I have installed web3.js in my project.

What other step have I missed?

BTW opening the browser on address "http://localhost:8545" returns 404. Is there anything I need to install in order to make it work? Is that the testrpc?

Notice that I want to work against the real blockchain, not a test one.

Edit:

As suggested by Karthikeyan, I downloaded and started geth. I don't know if it's actually working, it looks like this:

enter image description here

But I keep getting the same error when I try to create an account.

I'm trying to create an account through Node.js. This is my code:

export async function createNewAccount() {
    var web3Instance =  new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
    return web3Instance.eth.accounts.create();
}

But I'm getting the following error (from 'create' function):

Invalid JSON RPC response: undefined

I have installed web3.js in my project.

What other step have I missed?

BTW opening the browser on address "http://localhost:8545" returns 404. Is there anything I need to install in order to make it work? Is that the testrpc?

Notice that I want to work against the real blockchain, not a test one.

I'm trying to create an account through Node.js. This is my code:

export async function createNewAccount() {
    var web3Instance =  new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
    return web3Instance.eth.accounts.create();
}

But I'm getting the following error (from 'create' function):

Invalid JSON RPC response: undefined

I have installed web3.js in my project.

What other step have I missed?

BTW opening the browser on address "http://localhost:8545" returns 404. Is there anything I need to install in order to make it work? Is that the testrpc?

Notice that I want to work against the real blockchain, not a test one.

Edit:

As suggested by Karthikeyan, I downloaded and started geth. I don't know if it's actually working, it looks like this:

enter image description here

But I keep getting the same error when I try to create an account.

Source Link
Alon
  • 277
  • 1
  • 3
  • 8

Invalid JSON RPC response: undefined

I'm trying to create an account through Node.js. This is my code:

export async function createNewAccount() {
    var web3Instance =  new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
    return web3Instance.eth.accounts.create();
}

But I'm getting the following error (from 'create' function):

Invalid JSON RPC response: undefined

I have installed web3.js in my project.

What other step have I missed?

BTW opening the browser on address "http://localhost:8545" returns 404. Is there anything I need to install in order to make it work? Is that the testrpc?

Notice that I want to work against the real blockchain, not a test one.