Tutorial · Staking

Stake from the Command Line

The same five commands on both Divi nodes: unlock an encrypted wallet for staking only, read getstakingstatus line by line, and know when the two nodes differ. Every output below is real, captured on testnet on 2026-10-21.

About 12 minutes · Checked 2026-10-21

1Two nodes, one set of commands

Divi has two full nodes. The Divi node (divid, driven by divi-cli) is the original C++ program, also the one inside Divi Desktop and BoxWallet. IronDivi (irondivid, driven by irondivi-cli) is the newer Rust rewrite. They speak the same RPC language, so the commands below are the same; the few places where the answers differ are marked.

JobDivi nodeIronDivi
Encryptencryptwallet "pass"encryptwallet "pass"
Unlock to stakewalletpassphrase "pass" 0 truewalletpassphrase "pass" 0
Am I staking?getstakingstatusgetstakingstatus
Is it locked?getwalletinfogetwalletinfo
Lock againwalletlockwalletlock
Pause stakingstaking=0 in divi.conf, restartsetstaking false

If you only want the clicking version, Stake in a wallet covers Divi Desktop and BoxWallet. To set a node up from nothing, see Install the Divi node or Install IronDivi.

2Talk to your node

Both command-line tools read the node's config file to find the RPC port and password, so once the node runs you type only the command. The config files look alike but are not the same format:

# divi.conf (Divi node): key=value, no quotes
rpcuser=pick-a-name
rpcpassword=pick-a-long-random-password
staking=1

# irondivi.conf (IronDivi): TOML, strings in quotes
rpcuser = "pick-a-name"
rpcpassword = "pick-a-long-random-password"
staking = true

Add testnet=1 (Divi node) or pass --testnet to both irondivid and irondivi-cli to do all of this with free coins from the testnet faucet. The config file lives in the data folder; Config files lists where that is on each system.

A quick test that the connection works, and that the chain is synced to the height the explorer shows (mainnet, testnet). On testnet, where we ran everything on this page:

divi-cli getblockcount
360232
irondivi-cli --testnet getblockcount
360232

3Encrypt the wallet

Skip this if getwalletinfo already shows "encryption_status": "locked" or "unlocked". Otherwise, with a long passphrase you have written down somewhere safe:

divi-cli encryptwallet "your passphrase"
Wallet reloaded!

irondivi-cli encryptwallet "your passphrase"
wallet encrypted; the wallet is now locked. Use walletpassphrase to unlock it.
Back up your wallet again: earlier backups are not encrypted.

IronDivi encrypts from 0.2.6, released on 2026-10-22. The 0.2.5 release answers error code: -32601: Method not found: encryptwallet; upgrade before steps 3 and 4.

Divi node 3.0.0 reloads the wallet in place, as above; older versions stopped the whole node and had to be started again. Either way the wallet is now locked, so staking stops until the next step. Then back up your wallet again: the old backup holds unencrypted keys.

4Unlock for staking only

The unlock command takes the passphrase, a timeout in seconds (0 means until you lock it or the node restarts) and, on the Divi node only, a third word: true for staking only.

divi-cli walletpassphrase "your passphrase" 0 true
irondivi-cli walletpassphrase "your passphrase" 0

The Divi node prints nothing when it succeeds; IronDivi prints null. A wrong passphrase gives Error: The wallet passphrase entered was incorrect. on the Divi node and Incorrect passphrase on IronDivi.

A staking-only unlock can sign stakes but cannot send. We proved it on the testnet wallet right after the command above:

divi-cli sendtoaddress yJehBfdK9KbrwPRjYrzkrPES9uG5nFLjY4 1
error: {"code":-13,"message":"Error: Please enter the wallet passphrase with walletpassphrase first."}

divi-cli getwalletinfo
...
    "unlocked_until" : 1792629553,
    "encryption_status" : "unlocked-for-staking"
IronDivi has no staking-only unlock

IronDivi 0.2.6 reads only the passphrase and the timeout. We tried the three-argument form on it: the third word is silently ignored and getwalletinfo reports plain unlocked, which can spend. If that worries you, unlock with a timeout and renew it, or keep the machine itself out of reach.

"unlocked_until" with a timeout of 0

With timeout 0 the Divi node records the moment you unlocked as unlocked_until, so it looks like the unlock expired a second after you typed it. It did not: no re-lock is scheduled for a zero timeout. IronDivi shows 0 instead. Trust encryption_status, not the number.

5Read getstakingstatus

This is the testnet wallet on the Divi node, 13,000 tDIVI, right after the staking-only unlock:

divi-cli getstakingstatus
{
    "validtime" : true,
    "haveconnections" : true,
    "walletunlocked" : true,
    "mintablecoins" : true,
    "staking_balance" : 12999.99997740,
    "enoughcoins" : true,
    "mnsync" : true,
    "staking status" : true,
    "stake split threshold" : 20000.00000000
}

Every line should be true. What each one means, straight from the node's code:

FieldTrue meansIf false
validtimeThe newest block is dated after a fixed cut-over date in 2016 (always true on a synced chain).Your copy of the chain is ancient; let it sync.
haveconnectionsAt least one peer is connected.Check the network, firewall, or addnode= lines.
walletunlockedThe wallet is unencrypted, unlocked, or unlocked for staking.Run walletpassphrase (step 4).
mintablecoinsAt least one coin is old enough to stake (1 hour) and unlocked.Wait an hour after the coins arrived, or unlock.
staking_balanceThe DIVI the node will try to stake with: your spendable coins, plus any vault coins you stake for others, minus coins you locked with lockunspent.Zero: coins not confirmed yet, or all in a vault.
enoughcoinsThe staking balance is above zero.Same fix as above.
mnsyncThe node has finished the extra sync of network lists it does after the blocks.Give it a few minutes after the block sync.
staking statusThe node tried to make a stake in one of the last 4 blocks.Staking is off (staking=0), or the node only just started: wait four minutes and ask again.
stake split thresholdCoins bigger than this are split in two when they stake; see Split and combine coins.n/a
On IronDivi, four of these are always true

IronDivi 0.2.6 fills in validtime, haveconnections, walletunlocked and mnsync as true without checking, and mintablecoins simply copies staking status. Its honest fields are enoughcoins, staking_balance and staking status, plus a "staking status text" of Staking Active, Staking Not Active or Staking Disabled. For the lock, ask irondivi-cli getwalletinfo; for peers, irondivi-cli getpeerinfo.

The Divi node also tells you the lock state the same way: getwalletinfo reports unencrypted, locked, unlocked or unlocked-for-staking. IronDivi uses the first three.

6Lock, pause and resume

7Keep the passphrase out of your history

Typing the passphrase on the command line writes it to your shell history and, for a moment, shows it to anyone listing processes on the machine. Two habits fix the history half:

# read it without echo, use it, forget it
read -rs PASS
divi-cli walletpassphrase "$PASS" 0 true
unset PASS

In bash and zsh a command that starts with a space is left out of history when HISTCONTROL=ignorespace (bash) or HIST_IGNORE_SPACE (zsh) is set. The process-list half has no clean fix on either node; on a machine only you use, it doesn't matter.

Next

Still have a question? Ask the Divi chatbot, or see all tutorials.