Locking weight does three things at once: it raises your resource quota, it grants voting power and — past a thousand EAV7 — it puts the account up for the active set.
Everything here is a signed write; the flow is the one from the sign-and-broadcast guide.
All of them come from config.rs and some are adjustable by governance.
1 000 EAV7Floor for entering the active-set election.100 EAV7Floor for the account to become fee-exempt.27Size of the active set — the heaviest weights produce.30Maximum candidates in a single vote transaction.604 800Maturation blocks for an UNSTAKE — at 1 block/s, about seven days.20 %Default commission a validator keeps from its voters' rewards.A Remetente covers the whole sequence without a nonce collision.
The amount leaves the liquid balance and starts counting as weight. Energy and bandwidth quotas rise in the same transaction.
let mut remetente = cliente.remetente()?;
// STAKE move saldo para o peso de consenso da própria conta
let tx = remetente.stake(1_000 * UNIT)?;
cliente.aguardar_confirmacao(&tx.id.expect("assinada"), Duration::from_secs(30))?;The active set comes ordered by weight. Each address's performance entry shows productivity, latency and missed blocks.
curl -s https://eavscan.com/validators -H 'Accept: application/json' \
| jq '.current[0:3] | .[] | { address, staked, votes }'A vote is an address → weight map, and it replaces the previous allocation entirely. Voting for zero candidates withdraws the vote.
// o peso é distribuído entre candidatos: endereço → e7
let tx = remetente.votar(vec![
("E7VAL1…77A1".to_string(), 600 * UNIT),
("E7VAL2…0C42".to_string(), 400 * UNIT),
])?;The reward is per voted validator, so the address is mandatory — consensus refuses a claim without it.
// a recompensa é POR VALIDADOR VOTADO — o endereço é obrigatório
let tx = remetente.reivindicar_recompensa("E7VAL1…77A1")?;
let conta = cliente.conta(&de)?;
println!("ainda a resgatar: {} e7", conta.claimable_voter_reward);UNSTAKE does not credit: it creates an unbonding tranche that matures by height. Until it matures, the value counts neither as weight nor as balance.
let tx = remetente.unstake(100 * UNIT)?;
// o valor NÃO volta na hora: entra em unbonding e matura por altura
for parcela in cliente.conta(&de)?.unbonding {
println!("{} e7 liberam em {} blocos", parcela.amount, parcela.blocks_left);
}