How to get Ether in private blockchain?
How to get Ether in private blockchain?
Loading saved threads...
Mauro MCO · External communityPost link
External question — Ethereum Stack Exchange
Author: Mauro MCO
Original post: https://ethereum.stackexchange.com/questions/98046
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
Fast summary
:
Need a faucet-like funcionality in my private blockchain to give Ether to the newly on-demand created wallets from Android Dapp.
I'm working in a project where I've deployed a totally private and customized blockchain, with a bunch of smart contracts to interact with and an Android Dapp to manage the communciation with both (SC and BC).
The problem comes with: When I firstly sign-up in my Dapp, a wallet account in the blockchain is created (with
WalletUtils
and
loadCredentials
), but to start interacting with the Smart Contracts I need (fake) Ether, so I'm looking for a solution where either kind of
private faucet
or any way to
get Ether
from the brand new created wallet is implemented. I tried without success the next approaches:
Set the mining
coinbase
to the Smart Contract with the goal of having a big supply of Ether in the contract, and a function into it called
giveMeEther()
where 10 Eth is transferred to
msg.sender
. I configured
--miner.gasPrice '0'
to be able to call this function from Android without Ether but is not working:
java.lang.RuntimeException: Intrinsic gas too low
(although from geth console I managed to send transactions with gasPrice 0 from main account)
Problem
: I still need a first amount of Ether to call this function or manage to send gasPrice 0 transactions from Android with the new wallet.
Create a master account (or a bunch of them) in the genesis block with (almost) infinite Ether and keep mining to get unlimitted Ether in this account(s), and from the Dapp, after log into one of this accounts (because I know its credentials), call
Transfer.sendFunds()
with 10 Eth to the newly created wallet.
Problem
: I need to log-in in the code, with the
plain-text password
to a master account, and that's a
big security bug
(even though I obfuscated the code, it's still not a good practice). This solution
works fine
because a new wallet is created with 10 Ether succesfully, but now the problem is about
security
and about to give the credentials to this master accounts to anybody, that could log in and give all the amount of Ether available in those accounts to itself and get all the project crashed.
The solution of create X accounts initially in the genesis block with predefined Ether does not fit here because I'll need
on demand accounts with ether
and I'm not knowing how many accounts there will be.
I also thought in the solution of trying a
testnet like Ropsten/Rinkeby
instead my own private blockchain and
call faucet
, but I will lose the advantages of configuring from scratch my own blockchain, and if I'm not wrong, I'll have to pay to finally deploy my Smart Contracts to the main testnet.
So the
ideal solution
would be to implement an
exact same funcionality as faucet but for my own blockchain
.
I'll be so grateful with any help. Thanks.
Quote
Report
Vikash · External communityPost link
External answer — Ethereum Stack Exchange
Author: Vikash
Original post: https://ethereum.stackexchange.com/a/98112
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
You can abstract the crediting function by running a separate end point
which listens to the request raised by the new account creators by passing their public key to your separate end point, from where you can credit them with the desired eth, and by having your master account password safe by abstracting.
There are also other ways, by altering the consensus, but this might be easy to implement.
Quote
Report
Post Reply
Checking account access…