avalanche-cli
avalanche-cli copied to clipboard
Importing blockchain does not allocate balance and can not deploy Teleporter contracts
I'm creating and deploying blockchains with Teleporter support using simple commands and running them via a bash script. Here's the process I'm following:
I create a blockchain using the CLI wizard and allocate tokens to the ewoq account:
✔ Allocate 1m to the ewoq account 0x8db...2FC (Only recommended for testing, not recommended for production)
The output confirms the creation:
creating genesis for blockchain mysubnet
prefunding address 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC with balance 1000000000000000000000000
I export the blockchain files to use in my commands:
avalanche blockchain export [blockchainName]
After clearing the network state, I import and deploy the blockchain:
avalanche blockchain import file [exported JSON]
The import is successful:
Subnet imported successfully
Then, I attempt to deploy it locally:
avalanche blockchain deploy [blockchainName] --local
Outputs
Deploying [mysubnet] to Local Network
Backend controller started, pid: 10143, output at: /home/node/.avalanche-cli/runs/server_20240815_084433/avalanche-cli-backend.log
Booting Network. Wait until healthy...
Node logs directory: /home/node/.avalanche-cli/runs/network_20240815_084434/node<i>/logs
Network ready to use.
Deploying Blockchain. Wait until network acknowledges...
Teleporter Messenger successfully deployed to c-chain (0x253b2784c75e510dD0fF1da844684a1aC0aa5fcf)
Teleporter Registry successfully deployed to c-chain (0x17aB05351fC94a1a67Bf3f56DdbB941aE6c63E25)
✗ failure sending transaction &types.Transaction{inner:(*types.DynamicFeeTx)(0xc000957b00), time:time.Time{wall:0xc1a78de30247a8ce, ext:27898688797, loc:(*time.Location)(0x5bd6a80)}, hash:atomic.Value{v:interface {}(nil)}, size:atomic.Value{v:interface {}(nil)}, from:atomic.Value{v:interface {}(nil)}} to ðclient.client{c:(*rpc.Client)(0xc00022e120)}: insufficient funds for gas * price + value: balance 0, tx cost 10001102500000000000, overshot 10001102500000000000
✗ failure sending transaction &types.Transaction{inner:(*types.DynamicFeeTx)(0xc000957b00), time:time.Time{wall:0xc1a78de30247a8ce, ext:27898688797, loc:(*time.Location)(0x5bd6a80)}, hash:atomic.Value{v:interface {}(nil)}, size:atomic.Value{v:interface {}(nil)}, from:atomic.Value{v:interface {}(nil)}} to ðclient.client{c:(*rpc.Client)(0xc00022e120)}: insufficient funds for gas * price + value: balance 0, tx cost 10001102500000000000, overshot 10001102500000000000
✗ failure sending transaction &types.Transaction{inner:(*types.DynamicFeeTx)(0xc000957b00), time:time.Time{wall:0xc1a78de30247a8ce, ext:27898688797, loc:(*time.Location)(0x5bd6a80)}, hash:atomic.Value{v:interface {}(nil)}, size:atomic.Value{v:interface {}(nil)}, from:atomic.Value{v:interface {}(nil)}} to ðclient.client{c:(*rpc.Client)(0xc00022e120)}: insufficient funds for gas * price + value: balance 0, tx cost 10001102500000000000, overshot 10001102500000000000
Error: failure sending transaction &types.Transaction{inner:(*types.DynamicFeeTx)(0xc000957b00), time:time.Time{wall:0xc1a78de30247a8ce, ext:27898688797, loc:(*time.Location)(0x5bd6a80)}, hash:atomic.Value{v:interface {}(nil)}, size:atomic.Value{v:interface {}(nil)}, from:atomic.Value{v:interface {}(nil)}} to ðclient.client{c:(*rpc.Client)(0xc00022e120)}: insufficient funds for gas * price + value: balance 0, tx cost 10001102500000000000, overshot 10001102500000000000
Despite allocating 1m tokens to the ewoq account during the creation process, the deployment fails due to a lack of funds for gas. The balance shows as 0, which prevents the transaction from being processed.
Expected Behavior:
The allocated tokens should cover the gas fees during deployment, allowing the blockchain to deploy successfully without running into an "insufficient funds" error.
Environment:
Avalanche CLI Version: v1.7.0
Steps to Reproduce:
Create a blockchain using the CLI wizard. Allocate tokens to the ewoq account. Activate Teleporter Export the blockchain. Clean the network and delete the created blockchain. Import and attempt to deploy the blockchain locally.