Overview
This how-to guide provides instructions on how to stake resources, NET and/or CPU, for your account using the cleos
CLI tool.
Before you begin
- Install the currently supported version of
cleos
. - Ensure the reference system contracts are deployed and used to manage system resources.
-
Understand the following:
- What an account is.
- What NET bandwidth is.
- What CPU bandwidth is.
- The
delegatebw
cleos sub-command.
Command Reference
See the following reference guides for command line usage and related options for the cleos
command:
Procedure
The following steps show:
1. Stake NET bandwidth
Run the following command to stake 0.01 SYS
of NET bandwidth for alice
account from bob
account:
cleos system delegatebw alice bob "0.01 SYS" "0 SYS"
Where:
alice
= the account for which the NET bandwidth is staked.bob
= the account that pays the0.01 SYS
for the NET bandwidth staked.0.01 SYS
= the amount ofSYS
tokens allocated to stake NET bandwidth.0 SYS
= the amount ofSYS
tokens allocated to stake CPU bandwidth.
Example output:
executed transaction: 5487afafd67bf459a20fcc2dbc5d0c2f0d1f10e33123eaaa07088046fd18e3ae 192 bytes 503 us
# eosio <= eosio::delegatebw {"from":"bob","receiver":"alice","stake_net_quantity":"0.01 SYS","stake_cpu_quanti...
# eosio.token <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.01 EOS","memo":"stake bandwidth"}
# alice <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.01 SYS","memo":"stake bandwidth"}
# eosio.stake <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.01 SYS","memo":"stake bandwidth"}
2. Stake CPU bandwidth
Run the following command to stake 0.01 SYS
of CPU bandwidth for alice
account from bob
account:
cleos system delegatebw alice bob "0 SYS" "0.01 SYS"
Where:
alice
= the account for which the CPU bandwidth is staked.bob
= the account that pays the0.01 SYS
for the CPU bandwidth staked.0 SYS
= the amount ofSYS
tokens allocated to stake NET bandwidth.0.01 SYS
= the amountSYS
tokens allocated to stake CPU bandwidth.
Example output:
executed transaction: 5487afafd67bf459a20fcc2dbc5d0c2f0d1f10e33123eaaa07088046fd18e3ae 192 bytes 503 us
# eosio <= eosio::delegatebw {"from":"bob","receiver":"alice","stake_net_quantity":"0.0000 SYS","stake_cpu_quanti...
# eosio.token <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.01 EOS","memo":"stake bandwidth"}
# alice <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.01 SYS","memo":"stake bandwidth"}
# eosio.stake <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.01 SYS","memo":"stake bandwidth"}
3. Stake NET and CPU bandwidth
Run the following command to stake 0.01 SYS
of NET and 0.02 SYS
of CPU bandwidth for alice
account from bob
account:
cleos system delegatebw alice bob "0.01 SYS" "0.02 SYS"
Where:
alice
= the account for which the NET and CPU bandwidth is staked.bob
= the account that pays0.01 SYS
for the NET and0.02 SYS
for the CPU bandwidth staked.0.01 SYS
= the amount ofSYS
tokens allocated to stake NET bandwidth.0.02 SYS
= the amount ofSYS
tokens allocated to stake CPU bandwidth.
Example output:
executed transaction: 5487afafd67bf459a20fcc2dbc5d0c2f0d1f10e33123eaaa07088046fd18e3ae 192 bytes 503 us
# eosio <= eosio::delegatebw {"from":"bob","receiver":"alice","stake_net_quantity":"0.01 SYS","stake_cpu_quanti...
# eosio.token <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.01 EOS","memo":"stake bandwidth"}
# alice <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.01 SYS","memo":"stake bandwidth"}
# eosio.stake <= eosio.token::transfer {"from":"bob","to":"eosio.stake","quantity":"0.01 SYS","memo":"stake bandwidth"}
Summary
In conclusion, the above instructions show how to stake CPU and/or NET bandwidth from one account to another or to itself.