MaximilianMeister/kuberneteth

Initial funds

Strydom opened this issue · 2 comments

Hello,
I'm trying to get initial funds into the network and am not sure how to do it.
I've changed the genesis config in the yaml to have pre-allocated amounts but they don't seem to be working...

{
        "config": {
            "chainId": 24101995,
            "homesteadBlock": 0,
            "eip155Block": 0,
            "eip158Block": 0
        },
        "difficulty" : "20",
        "gasLimit" : "2100000",
        "alloc" : {
            "7df9a875a174b3bc565e6424a0050ebc1b2d1d82": { "balance": "500000" },
            "f41c74c9ae680c1aa78f42e5647a62f353b7bdde": { "balance": "500000" }
        }
}

I'm using web3.js to grab the account balances:

web3.eth.getBalance(address)
    .catch(error => console.log("Error getting balance: " + error))
    .then(balance =>
        console.log("Balance of address " + address + ": " + balance.toString())
    );

It just returns Balance of address 7df9a875a174b3bc565e6424a0050ebc1b2d1d82: 0.

Whats the best way of doing this?

hi @Strydom I was testing it quickly in a fresh kubernetes deployment and it works as expected, i suspect you still have the old geth datadir around? if so, there will be no new genesis block written!

i usually remove /var/lib/docker/geth-storage on the kubernetes worker nodes when i start a fresh cluster. this is a limitation of our usage of hostPath where kubernetes doesnt cleanup all the persistent storage afterwards.

please check, and feel free to close the issue when it worked

thanks!

I just started a cluster from scratch and it's all working! Must have been that, thanks!