4

Not by genesis file to be clear
when we create new account through geth console it should create new account with some pre-defined balance

2
  • Creating an account happens fully off-chain. You could alter the consensus rules such that each address by default is considered to have a balance of x instead of 0.
    – Jesbus
    Jan 28, 2018 at 18:33
  • For this, you have to change the source code. But depending on requirements, there could be a workaround like if accounds are created using your UI, you can have an admin account with loads of ETH and then probably send ethers each time new address is created. But you have be sure each time an account is created, you know this. May 11, 2018 at 10:09

2 Answers 2

1

If your requirements are as stated, that is:

  1. creating an account through geth console should create an account with a balance, and
  2. you cannot alter the genesis file

then your only option is to alter the source code of the Ethereum client you're using and ensure all nodes have matching consensus rules (probably by deploying your altered client code).

Changing the genesis file would allow you to pre-create accounts with balances, but this would violate your requirement #2.

Mining after chain creation would allow you to populate accounts with mining proceeds, but this would violate your requirement #1.

(If this is just for testing purposes, consider using one of the test setups like Ganache.)

0

You can't do pre-allocate ether. Because,

Create new address before validation by the network, it is off-chain process and this address checks by the network whether the address is valid or not and if valid then set nonce to 1 and you know that this is now ready for transaction.

You have to transfer ether explicitly from another externally owned account or contract account.

  1. EoA -> CA -> EoA
  2. EoA -> EoA

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.