Connecting Web3.js to Ethereum Node

ytriusytrius Member Posts: 26
I have an ethereum full node running on my pc, I'm trying to connect web3.js to it, how do I know what port it is running on?

Comments

  • ytriusytrius Member Posts: 26
    Updted info. I have geth running with following command line options "geth.exe --rpc --rpcaddr 'localhost' --rpcport '8545' --rpcapi 'web3' --rpccorsdomain 'mydomain.net'" however I still am denied access using web3 on mydomain.net, any help?
  • ytriusytrius Member Posts: 26
    I solved it! I had typos.
  • 2xPress2xPress Member Posts: 16
    I'm about to do the same thing json rpc via js what do i put in for mydomain.net ? any domain where my js is loaded?
    An you help me on this broh?
  • ytriusytrius Member Posts: 26
    2xPress said:

    I'm about to do the same thing json rpc via js what do i put in for mydomain.net ? any domain where my js is loaded?
    An you help me on this broh?

    Yeah so if your JS is running on "blah.com" then you want to allow access from that domain when you start geth via --rpccorsdomain "blah.com"
  • 2xPress2xPress Member Posts: 16
    Thanks.. actually i found a json rpc in php that im using now.. trying to figure out how to get new receiving addresses for accepting ether payments as a merchant but this is not as straightforward as the bitcoin way .. creating new address etc .. I'm sure there is a way to do it.
Sign In or Register to comment.