I need to create several contracts on the click of a button. I cannot run a geth node. I am successfully able to do it via metamask but that results on too many transaction pop ups. Is there a way to create contract without running geth and without using metamask.
1 Answer
Yes you can do.
I need to create several contracts on the click of a button. I cannot run a geth node.
Use https://infura.io/ for replacement of geth client. infura is free service.
I am successfully able to do it via metamask but that results on too many transaction pop ups. Is there a way to create contract without running geth and without using metamask.
For every method you need to estimate gas and get the current gas price. Use signTransaction() function to sign your transaction and send to eth network.
Contract address.transfer method gas cost
https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethestimategas
-
@Nitika Goel I hope my ans is helped for some direction, If so can you mark as solved. So that new dev's will find ans very quickly. Feb 19, 2018 at 15:05
-
Do you have any guarantee that Infura lets them actually sign and authenticate transactions without confirmation? I'm pretty sure that's what they want to do, and you haven't provided any documentation or links that imply that this service can actually perform the task. If they can't run a geth node, why do you think they can run some other type of node?– hakusaroFeb 19, 2018 at 15:08
-
@hakusaro, If we don't want to run geth client, how will connect eth network? We need to trust sone one. Feb 19, 2018 at 15:15
-
1Look at Metamask as an example. It's a thin client -- it doesn't need any local node to accomplish contract deployments. From an end user perspective "it just works." Someone can install MM and have it working in 30 seconds to deploy contracts. It requires virtually no setup, compared to any node that requires installation and maintenance.– hakusaroFeb 19, 2018 at 15:24
-
1Thanks, I solved it using eth-js-provider-signer which uses a combination of infura and private key. Feb 22, 2018 at 7:33