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.
Asked
Active
Viewed 706 times
0
-
1The first answer to that question includes the use of Metamask, the second does not. – Richard Horrocks Feb 19 '18 at 15:08
1 Answers
0
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
Jitendra Kumar. Balla
- 2,154
- 1
- 8
- 15
-
@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. – Jitendra Kumar. Balla Feb 19 '18 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? – hakusaro Feb 19 '18 at 15:08
-
@hakusaro, If we don't want to run geth client, how will connect eth network? We need to trust sone one. – Jitendra Kumar. Balla Feb 19 '18 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. – hakusaro Feb 19 '18 at 15:24
-
-
Thanks @jitendra but incurs does not have account information like private keys and hence we cannot create contracts. Can you attach a small piece of working code if you know how to add an account to web3 connected via infura. – Nitika Goel Feb 20 '18 at 06:54
-
@hakusaro, indeed metamask is very neat and simple. Just that it results in a popup for each transaction. Too many pop ups annoy the user – Nitika Goel Feb 20 '18 at 06:58
-
1Thanks, I solved it using eth-js-provider-signer which uses a combination of infura and private key. – Nitika Goel Feb 22 '18 at 07:33