2

I am creating cryptocurrency exchange and want to test my app and for that purpose I need to add dev account balance. Please help me to generate ether for testing purposes in my private network.

NOTE

I am using geth to run ethereum node.

  • 1
    Do you use Parity or Go-Ethereum for your private network? – Igor Barinov May 28 '17 at 22:58
2

Because you use go-ethereum I recommend you to try the new tool to set-up your private ethereum network named puppeth. It's available from version 1.6. When you'll answer questions of a wizard, one question will be Which accounts should be pre-funded?

ubuntu@test1:~$ puppeth
+-----------------------------------------------------------+
| Welcome to puppeth, your Ethereum private network manager |
|                                                           |
| This tool lets you create a new Ethereum network down to  |
| the genesis block, bootnodes, miners and ethstats servers |
| without the hassle that it would normally entail.         |
|                                                           |
| Puppeth uses SSH to dial in to remote servers, and builds |
| its network components out of Docker containers using the |
| docker-compose toolset.                                   |
+-----------------------------------------------------------+

Please specify a network name to administer (no spaces, please)
> foobar
Sweet, you can set this via --network=foobar next time!

INFO [05-28|23:33:58] Administering Ethereum network           name=foobar
WARN [05-28|23:33:58] No previous configurations found         path=/home/ubuntu/.puppeth/foobar

What would you like to do? (default = stats)
 1. Show network stats
 2. Configure new genesis
 3. Track new remote server
 4. Deploy network components
> 2

Which consensus engine to use? (default = clique)
 1. Ethash - proof-of-work
 2. Clique - proof-of-authority
> 2

How many seconds should blocks take? (default = 15)
> 15

Which accounts are allowed to seal? (mandatory at least one)
> 0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98
> 0x

Which accounts should be pre-funded? (advisable at least one)
> 0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98
> 0x
| improve this answer | |
1

For testing purpose, you should use testRPC. It gives 10 accounts by default and each account has balance some initially. With this, you don't have to unlock the account or add balance and also it's much faster than geth to quickly test your code.

Install it using following command -

npm install -g ethereumjs-testrpc
| improve this answer | |
0

You have three choices:

1-Mining : in your node run miner.start() to get some new ethers and then send divide them between your balances

2-Init your private chain with a genesis file defining the balances of your accounts using :

"alloc": { "133ded6da4e99fa9e37d75cbc9e8cba18a9a7796": { "balance": "100000000000" } }

| improve this answer | |

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.