#
Generating Commands
#
generate
Category: Generating | Version: v1.2.14+
Mine blocks immediately (before the RPC call returns). Only available on regtest network.
Syntax
verus generate numblocks
Result
["blockhash1", "blockhash2", ...] // (array of strings) Hashes of generated blocks
Examples
Basic Usage
./verus -testnet generate 1
## Actual Output (tested on VRSCTEST)
error code: -32601
error message:
This method can only be used on regtest
Regtest Usage
## On regtest network only
./verus -regtest generate 11
RPC (curl)
curl --user user:pass \
--data-binary '{"jsonrpc":"1.0","id":"curltest","method":"generate","params":[11]}' \
-H 'content-type:text/plain;' http://127.0.0.1:18843/
Common Use Cases
- Development and testing on regtest
- Generating blocks on demand for automated tests
- Confirming transactions in test environments
Related Commands
— enable continuous mining/staking (works on all networks)setgenerate — check generation statusgetgenerate
Notes
- This is a synchronous call — it blocks until all requested blocks are mined
- For testnet/mainnet mining, use
setgenerateinstead - Useful for automated testing where you need deterministic block production
Tested On
- VRSCTEST block height: 926961
- Verus version: v1.2.14-2
#
getgenerate
Category: Generating | Version: v1.2.14+
Returns whether the server is set to mine and/or stake coins. Can be configured via command line (-gen, -mint), config file, or setgenerate.
Syntax
verus getgenerate
Parameters None.
Result
{
"staking": true|false, // (boolean) If staking is on or off
"generate": true|false, // (boolean) If mining is on or off
"numthreads": n // (numeric) Processor limit for mining
}
Examples
Basic Usage
./verus -testnet getgenerate
## Actual Output (tested on VRSCTEST) — default state
{
"staking": false,
"generate": false,
"numthreads": 0
}
After Enabling Staking
## First enable staking
./verus -testnet setgenerate true 0
## Then check
./verus -testnet getgenerate
## Actual Output (tested on VRSCTEST)
{
"staking": true,
"generate": true,
"numthreads": 0
}
RPC (curl)
curl --user user1445741888:pass2f0dc70dded67b9f392c0f3950a547bc6ef4d1edfa78da3a7da5b78113def067b6 \
--data-binary '{"jsonrpc":"1.0","id":"curltest","method":"getgenerate","params":[]}' \
-H 'content-type:text/plain;' http://127.0.0.1:18843/
Common Use Cases
- Verify mining/staking is active after configuration
- Monitor node generation state in scripts
- Confirm
setgeneratetook effect
Related Commands
— enable/disable mining and stakingsetgenerategetmininginfo— comprehensive mining status
Notes
generate: truewithnumthreads: 0means staking only (no CPU mining)generate: truewithnumthreads: N(N > 0) means CPU mining with N threads- The default state is false/false/0 unless configured via CLI args or config file
Tested On
- VRSCTEST block height: 926961
- Verus version: v1.2.14-2
#
setgenerate
Category: Generating | Version: v1.2.14+
Enable or disable mining (generation) and staking. Mining is limited to a specified number of processor threads.
Syntax
verus setgenerate generate [genproclimit]
Result No return value on success.
Examples
Enable Staking Only
./verus -testnet setgenerate true 0
## Verify
./verus -testnet getgenerate
## Actual Output (tested on VRSCTEST)
{
"staking": true,
"generate": true,
"numthreads": 0
}
Enable Mining with 1 Thread
./verus -testnet setgenerate true 1
Disable All Generation
./verus -testnet setgenerate false
## Verify
./verus -testnet getgenerate
## Actual Output (tested on VRSCTEST)
{
"staking": false,
"generate": false,
"numthreads": 0
}
RPC (curl)
curl --user user1445741888:pass2f0dc70dded67b9f392c0f3950a547bc6ef4d1edfa78da3a7da5b78113def067b6 \
--data-binary '{"jsonrpc":"1.0","id":"curltest","method":"setgenerate","params":[true,1]}' \
-H 'content-type:text/plain;' http://127.0.0.1:18843/
Common Use Cases
- Start staking with
setgenerate true 0 - Start CPU mining with
setgenerate true 1(or more threads) - Stop all mining/staking with
setgenerate false - Adjust thread count without restarting the node
Related Commands
— check current generation statusgetgenerategetmininginfo— comprehensive mining statusgetlocalsolps— monitor local hashrate after enabling
Notes
setgenerate truewithoutgenproclimitdefaults to staking mode (0 threads)- Staking requires a wallet with mature coins (100+ confirmations)
setgenerate falsestops both mining and staking- Changes take effect immediately — no restart required
- On Verus, staking uses the VerusHash algorithm and doesn't consume significant CPU
Tested On
- VRSCTEST block height: 926961
- Verus version: v1.2.14-2