Depends how you run your node you have to modify the testnet_genesis()
function or the local_testnet_config()
.
To make the balance 0 is as your code (changing the 1 << 60 with 0):
balances: BalancesConfig {
// Configure endowed accounts with initial balance of 1 << 60.
balances: endowed_accounts.iter().cloned().map(|k| (k, 0)).collect(),
},
This populates the accounts in the endowed_accounts
list.
To add/remove accounts you have to modify the list you are sending in the parameters when calling one of this functions testnet_genesis()
function or the local_testnet_config()
:
// Pre-funded accounts
vec![
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
],
After the changes build and run the node again:
cargo build --release
cargo run --release -- --dev
If you set all the accounts with 0, you will see this error message
'the balance of any account should always be at least the existential deposit.'
Be aware you need at least an account with more than the existential depostit, you can modify the EXISTENTIAL_DEPOSIT
constant in the runtime: runtime/src/lib.rs
.