bnb-chain / bsc-docker

49 stars 31 forks source link

cluster mode, consensus parlia, total supply #8

Closed saclin closed 2 years ago

saclin commented 2 years ago

the total supply is set in config, after I deployed the cluster mode with validators, how can I add total supply ? I check the balance of validator's coinbase is 0 , the mint reward is saved in system contract?

steventranjs commented 2 years ago

@saclin yes, correct, it's set in system contract. You can set INIT_HOLDER_BALANCE for your own application

saclin commented 2 years ago

after set up, how can I increase my account balance?

steventranjs commented 2 years ago

@saclin u can set INIT_HOLDER_BALANCE as in https://github.com/bnb-chain/bsc-docker/blob/master/docker-compose.cluster.bootstrap.yml

saclin commented 2 years ago

I mean, the private chain has run for a long time, the balance go down, I want to increase account balance, how?

steventranjs commented 2 years ago

it's not possible to change total balance after the private chain has bootstrapped. The only way is to transfer from those accounts that received transfer amount from initial balance

steventranjs commented 2 years ago

For example, account a has initial balance of 1000 coin, after run a long time, account a balance reduced because it's transfer amount to account x,y,z.... Therefore to increase account a balance, u need to transfer from x,y,z back to account a.

saclin commented 2 years ago

but the balance is used for the gas fee of smart contract, so those balance is stored in system contract, which means can not be transfered to my account, right?

steventranjs commented 2 years ago

those gas fee amount is rewarded to validator address, not system contract. In this case, you can transfer from validator address back to your account using validator private key

saclin commented 2 years ago

validator node's coinbase? the balance is 0

steventranjs commented 2 years ago

yeap, u need to check all validator address in all nodes, some will receive balance. BTW you can set gas fee = 0 as well so that u dunt loose gas fee for validator

saclin commented 2 years ago

I check all three nodes, the balance is 0.

steventranjs commented 2 years ago

u need to get validator address from genesis.json then check balance for it

saclin commented 2 years ago

this docker deploy way can not find genesis.json, I think it's the same as validator node's coinbase, balance 0

saclin commented 2 years ago

I check the transaction, the balance is transfered to 0x0000000000000000000000000000000000001002, 0x0000000000000000000000000000000000001000

steventranjs commented 2 years ago
Screenshot 2022-08-12 at 5 31 40 PM

you can find it under the generated storage folder generated by docker-compose.yml

saclin commented 2 years ago

it‘s the address in validator floder,the balance is transfered to system contract address , like 0x0000000000000000000000000000000000001002, 0x0000000000000000000000000000000000001000 how can I transfer those balance

steventranjs commented 2 years ago

@guagualvcha could u help on this?