1

I am launching a semi-decentralized webapp using AWS and was wondering if I must continually run a node on AWS for it to work. Currently, if I don't run a Rinkeby node and compile/migrate the contract in my AWS instance then it won't work, but I may just be doing something wrong.

Thank you.

2

You will need to have a connection to a node to deploy your smart contract, but this does not mean that you need to run your own node. You can choose to use a 3rd party ETH node service such as Alchemy or Infura with Truffle or your own ETH node. See this document on how to change your ETH node connection in Truffle. You will need to set your deployment parameters on Truffle to the corresponding node provider that you are using.

Once you have deployed your smart contract, you do not need to run a node to serve this smart contract. The smart contract has been deployed to the Ethereum network and will be added to the state of all other nodes in the Ethereum ecosystem.

If you would like to build a web app to interact with this smart contract, you can choose to use one of the ETH node services noted above or connect to a node your are hosting yourself. See this article by Zeppelin Solutions to understand how to connect a javascript app to an ETH node

1

Yes, to interact with the blockchain, you need to run a node.

  • But if you are just launching a web app why can't you migrate the contract to the blockchain from my local machine and just attach to it from AWS without having to run a node on AWS – connorvo Mar 2 '18 at 1:14
1

You don't really need it in case you're just deploying contracts and interacting with it. You can migrate your contracts in the mainnet and use web3.js to call them from the webapp. All you need is your Contract ABI and the Contract address (which will be given to you after the deploy)

If your webapp doesn't add any specific functionality other than smart contract invocation you might consider to deploy it in IPFS and make it fully decentralized.

  • The issue I run into is that I am setting the provider for my contract as localhost:8545. So when I start-up the DApp, it connects to the contract but then is unable to interact with it because it wants to set the provider to localhost but if I am not running a node on my EC2 instance it can't do that – connorvo Mar 5 '18 at 21:13
  • You need to get the provider that is injected by Mist or Metamask so you don't need to connect locally. github.com/ethereum/wiki/wiki/JavaScript-API#adding-web3 or if you use the new version: web3js.readthedocs.io/en/1.0/… – mirg Mar 6 '18 at 2:42

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.