1Divi's three networks
The Divi node software can run on three networks. They use the same code and the same commands, but they never mix: each has its own blocks, its own coins and its own data folder.
| Mainnet | Testnet | Regtest | |
|---|---|---|---|
| Who runs it | Everyone | Anyone who wants to practise | Only you |
| Coins worth | Real money | Nothing | Nothing |
| Who makes blocks | Stakers, every minute | Stakers, every minute | You, whenever you ask |
| Addresses start with | D | x or y | x or y |
| Node setting | (none) | testnet=1 | regtest=1 |
| Data folder | the data folder itself | testnet3/ | regtest/ |
| Peer port | 51472 | 51474 | 51476 |
RPC port (divi-cli) | 51473 | 51475 | 51475 |
| Finds other nodes | DNS seeds | DNS seed | Never, unless you tell it one |
Regtest is short for regression test. It was built so the Divi developers could test the node against a chain they fully control, and it is just as useful for anyone building on Divi or practising commands.
Both use RPC port 51475 and both make x/y addresses. So you cannot run a testnet node and a regtest node on one computer with the default settings, and a regtest address looks exactly like a testnet one. Nothing you make on regtest exists anywhere else.
2What is different on regtest
Regtest keeps Divi's rules but turns the numbers down so you can see everything happen in a few minutes. These values are from the node's source and from a regtest chain we built on 2026-10-21.
- Block 1 holds a 1,250 DIVI premine, and every block you make after it pays 1,250 DIVI to your own wallet. After 100 blocks you have 125,000 regtest DIVI without asking anyone.
- New coins mature after 20 blocks, as on mainnet. Testnet uses 1 block. Regtest keeps the real wait so you can test code that handles immature coins, and you can make 20 blocks in a few seconds anyway.
- You can make the first 100 blocks on demand. From block 101 the chain switches to proof of stake, like the real network.
setgeneratekeeps working: it now makes proof-of-stake blocks with your wallet's coins, and there is no minimum coin age, so it can do that straight away. - The reward drops every 100 blocks (mainnet drops once a year). The lottery and treasury rules are turned down too: the node is set to a lottery every 10 blocks from block 101 and a treasury payment every 50 blocks from block 102. We did not watch a payout for this page.
- Blocks are easy. The proof-of-work difficulty is as low as it goes, so making a block takes a fraction of a second.
- No seeds, no peers. A regtest node never looks for other nodes. If you want two nodes, you connect them yourself (tutorial #79).
- Same genesis block for everyone. Every regtest chain starts from block
0000000b3f9980dcf71f5f52d69e30d3b02f807e0a77b91b6091701e4ae51a6f, but every block after it is yours, so two people's regtest chains are never the same.
3Who makes the blocks
On regtest nobody makes a block unless you ask. The command is setgenerate, and it exists only on regtest:
./divi-cli setgenerate 101
That makes 101 blocks straight away and prints their hashes. On mainnet or testnet the same command answers:
error: {"code":-32601,"message":"Method disabled: invalid networks setting (regtest only)"}
There are two Divi nodes you can run, and only one of them can make regtest blocks today:
| Node | Join a regtest chain | Make regtest blocks |
|---|---|---|
Divi v3.0.0 (divid, C++) | Yes | Yes: setgenerate and generateblock |
IronDivi v0.2.5 (irondivid, Rust) | Yes, with --regtest | Not yet |
Ask IronDivi for a block and it says so plainly:
error code: -32603: setgenerate is not yet implemented - requires full mining subsystem
So the tutorials in this series use the Divi C++ node to make blocks, and IronDivi as a second node that follows the chain, holds a wallet, and answers the same commands. Everything that doesn't need a new block works on either.
4When to use regtest
- You want coins now. No faucet, no waiting for a sync. One command makes a wallet with 125,000 DIVI in it.
- You want to test waiting without waiting. Coin maturity, a vault's lock, a time lock, a swap's refund window: on regtest you jump forward by making blocks.
- You want the same chain every time. A script can build the same chain from scratch in a few seconds, so a bug report comes with the exact chain that shows it (tutorial #82).
- You are testing your own code. Your app talks to a node on your laptop, there is no network between you and it, and nobody else's transactions get in the way (tutorial #83).
- You are on a plane. Regtest needs no internet at all.
5When testnet is the better tool
Regtest can't show you anything that involves other people. Use testnet when:
- Real timing matters. Testnet blocks come about every minute from other stakers, so you see how long a payment really takes to confirm.
- You need other nodes. Peer discovery, syncing from scratch, a bootstrap snapshot, a node behind Tor: all of that needs a real network.
- You want the public tools. The testnet explorer, the faucet and the testnet web wallet only know testnet. There is no explorer for your private chain.
- You are showing someone else. A testnet txid is something another person can look up. A regtest txid exists only on your disk.
A good habit for developers: prove the logic on regtest, then run the same test once on testnet before anything touches mainnet.
6The regtest tutorials
- Start a regtest node and make your first 100 blocks
- Two nodes on one laptop: Divi making blocks, IronDivi following
- Give yourself coins and watch them mature
- Practise every vault command on regtest in five minutes
- Reproduce a bug: a script that builds the same chain every time
- Test your app against regtest before testnet (Python and JavaScript)
- Atomic swaps on regtest: a hash lock and a time lock, proved on your own chain
You need the Divi node software for all of them: see install the Divi node, and install IronDivi for the second node.
If something goes wrong
| You see | What it means |
|---|---|
Method disabled: invalid networks setting (regtest only) | You ran setgenerate on a mainnet or testnet node. Only a node started with regtest=1 can make blocks. |
setgenerate is not yet implemented - requires full mining subsystem | You asked IronDivi for a block. Use the Divi C++ node to make blocks; IronDivi can follow the chain. |
| Your regtest chain has a different tip from a friend's | Normal. Only the genesis block is shared; every block after it is made locally. |
| A regtest address was refused by the testnet faucet or explorer | Regtest addresses look like testnet ones but the regtest chain is private. Use a testnet node for testnet coins. |
Still stuck? Ask the Divi chatbot, or see all tutorials.