5
Geth
Version: 1.6.1-stable
Git Commit: 021c3c281629baf2eae967dc2f0a7532ddfdc1fb
Architecture: amd64
Protocol Versions: [63 62]
Network Id: 1
Go Version: go1.8.1
Operating System: windows
GOPATH=
GOROOT=c:\go

The above is my geth installation, I need to initialize testnet with some default balance for some address - how can I do this? I tried with the genesis.json from https://github.com/ethereum/go-ethereum/wiki/Private-network and initialized the private block chain, created an account, replaced the address in the custom genesis file with that and re-run the init, but it failed with

Fatal: Failed to write genesis block: database already contains an incompatible genesis block (have 15ecff6ddb9d4db4, new 834a88447f2091cc)

How can I add some balance to the address?

2

You can run the command:

miner.start()

In the geth console. This will start mining and add ether to your default account.

  • > miner.start() null as that is what I get – born2net Sep 11 '17 at 20:48
2

Looks like you are trying to set geth private net node on your machine, I posted the steps today in another question. This should help you out, please take a look.

How do I set up a private ethereum network?

Before following the steps, remove the existing datadir and genesis file.

Note - datadir folder has keystore and that has to be deleted to start from scratch

Once you set up private net then you can use eth.SendTransaction({from: accounthash_sender, to: accounthash_reciever, value: the_amount}) to send some balance to other accounts from default account. Your default account would have balance from genesis block instantiation.

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.