hyperledger / besu

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
https://www.hyperledger.org/projects/besu
Apache License 2.0
1.48k stars 804 forks source link

[QBFT] Besu Tesnet , Not getting token in alloc address #7484

Open akashsangwan3009 opened 1 month ago

akashsangwan3009 commented 1 month ago

Hi there,

Im trying to run besu QBFT private network , with following genesis file :

{ "genesis": { "config": { "chainId": 7474, "berlinBlock": 0, "shanghaiTime":17034870, "contractSizeLimit": 2147483647, "qbft": { "blockperiodseconds": 60, "epochlength": 30000, "requesttimeoutseconds": 60 } }, "nonce": "0x0", "timestamp": "0x58ee40ba", "gasLimit": "0x1fffffffffffff", "difficulty": "0x1", "mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", "coinbase": "0x0000000000000000000000000000000000000000", "alloc": { "0xf606b4B10E0B6863165d0E8077e36Bf06e199123": { "balance": "0x3635C9ADC5DEA00000" }, "0x0Ce98c77E8ffB8Da3eea4dC5C985e53Ae0f670F8": { "balance": "0x3635C9ADC5DEA00000" } } }, "blockchain": { "nodes": { "generate": true, "count": 5 } } }

Blocks are getting produced , but im not getting the token in particular wallet address.

jframe commented 1 month ago

I'm not sure what you mean by getting a token at that address. But you should have a non-zero balance at 0xf606b4B10E0B6863165d0E8077e36Bf06e199123 and 0x0Ce98c77E8ffB8Da3eea4dC5C985e53Ae0f670F8. If you use the eth_balance RPC https://besu.hyperledger.org/development/public-networks/reference/api#eth_getbalance are you getting the expected balances for those accounts?

akashsangwan3009 commented 1 month ago

Hi @jframe What im trying here is i want to allocate 1000 token/crypto to these account , using alloc object in genesis, at the time of creating the genesis file. But this is not happening, even network is configured and up.

And with eth_getbalance also im getting zero balance.

lucasoliveirabs commented 3 weeks ago

Hey @akashsangwan3009! I believe you're saying the network deployment is working fine but the allocation set at config file is not being applied at generated genesis file. So no 'alloc' section is created then no funding. Would be it? If so, I'm just having this issue as well:

qbftConfigFile.json: { "genesis": { "config": { "chainId": 1337, "berlinBlock": 0, "contractSizeLimit": 2147483647, "qbft": { "blockperiodseconds": 2, "epochlength": 30000, "requesttimeoutseconds": 4 } }, "nonce": "0x0", "timestamp": "0x58ee40ba", "gasLimit": "0x1fffffffffffff", "difficulty": "0x1", "mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", "coinbase": "0x0000000000000000000000000000000000000000", "alloc": { "fe3b557e8fb62b89f4916b721be55ceb828dbd73": { "privateKey": "8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63", "comment": "This is Alice's Key. Private key and this comment are ignored. In a real chain, the private key should NOT be stored", "balance": "80000000000000000000000" }, "627306090abaB3A6e1400e9345bC60c78a8BEf57": { "privateKey": "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3", "comment": "This is the contract's Key. Private key and this comment are ignored. In a real chain, the private key should NOT be stored", "balance": "70000000000000000000000" }, "f17f52151EbEF6C7334FAD080c5704D77216b732": { "privateKey": "ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f", "comment": "This is Bob's Key. Private key and this comment are ignored. In a real chain, the private key should NOT be stored", "balance": "90000000000000000000000" } } }, "blockchain": { "nodes": { "generate": true, "count": 4 } } }

generated genesis.json: { "config" : { "chainId" : 1337, "berlinBlock" : 0, "contractSizeLimit" : 2147483647, "qbft" : { "blockperiodseconds" : 2, "epochlength" : 30000, "requesttimeoutseconds" : 4 } }, "nonce" : "0x0", "timestamp" : "0x58ee40ba", "gasLimit" : "0x1fffffffffffff", "difficulty" : "0x1", "mixHash" : "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365", "coinbase" : "0x0000000000000000000000000000000000000000", "extraData" : "0xf87aa00000000000000000000000000000000000000000000000000000000000000000f8549464ca6eb7c825c1b1e7d8bc246aa5ff92413b1080947da9e5a98e1f95c8fec4eb388d43c28d7c71dff2949013f4183c837b2ceff8f64a3854534dbcdbb8e394fc266c00431cbabb803996195c1b4420cdfa1a8cc080c0" }

no 'alloc' at genesis after running besu operator generate-blockchain-config --config-file=../config/qbftConfigFile.json --to=networkFiles --private-key-file-name=key Do not know yet what's happening.

lucasoliveirabs commented 3 weeks ago

I've besu --genesis-file=genesis/genesis.json to move with tests

akashsangwan3009 commented 3 weeks ago

@lucasoliveirabs Did it worked for you ? And yes, im also facing the same issue about alloc .

lucasoliveirabs commented 3 weeks ago

No, 'alloc' section still not being generated at genesis after besu operator generate-blockchain-config.

lucasoliveirabs commented 3 weeks ago

Hey @akashsangwan3009 if your end goal is to fund some accounts at deployment take a look at free gas networks config

Beh3moth commented 2 weeks ago

Same issue