We put our best effort into covering all topics related to Dimecoin. Each section will cover a different category. Not all documentation may be 100% accurate, if you spot an error, please report it or submit a PR request on GitHub.

REMINDER: This documentation is always evolving. If you have not been here for a while, perhaps check again. Things may have been added or updated since your last visit!

Testing Applications#

Dimecoin Core provides several network options designed to let developers test their applications with reduced risks and limitations.

Testnet#

When run with no arguments, all Dimecoin Core programs default to Dimecoin’s main network (mainnet). However, for development, it’s safer and cheaper to use Dimecoin’s test network (testnet) where the dimecoins spent have no real-world value. Testnet also relaxes some restrictions (such as standard transaction checks) so you can test functions which might currently be disabled by default on mainnet.

To use testnet, use the argument -testnet with dimecoin-cli, dimecoind or dimecoin-qt or add testnet=1 to your dimecoin.conf file as described earlier. To get free dimecoins for testing, you can easily run setgenerate to generate some testnet dimecoins.

Regtest mode#

For situations where interaction with random peers and blocks is unnecessary or unwanted, Dimecoin Core’s regression test mode (regtest mode) lets you instantly create a brand-new private blockchain with the same basic rules as testnet—but one major difference: you choose when to create new blocks, so you have complete control over the environment.

Many developers consider regtest mode the preferred way to develop new applications. The following example will let you create a regtest environment after you first configure dimecoind.

> dimecoind -regtest -daemon
Dimecoin Core server starting

Start dimecoind in regtest mode to create a private block chain.

## Dimecoin Core
dimecoin-cli -regtest generate 101

Generate 101 blocks using a special RPC which is only available in regtest mode. This takes less than a second on a generic PC. Since this is a new block chain using Dimecoin’s default rules, the first blocks pay a block reward of 500 DIME. Unlike mainnet, in regtest mode only the first 150 blocks pay a reward of 500 DIME. However, a block must have 100 confirmations before that reward can be spent, so we generate 101 blocks to get access to the coinbase transaction from block #1.

dimecoin-cli -regtest getbalance
500.00000000

Verify that we now have 500 DIME available to spend.

You can now use Dimecoin Core RPCs prefixed with dimecoin-cli -regtest.

Regtest wallets and block chain state (chainstate) are saved in the regtest subdirectory of the Dimecoin Core configuration directory. You can safely delete the regtest subdirectory and restart Dimecoin Core to start a new regtest. (See the Developer Examples Introduction for default configuration directory locations on various operating systems.

Warning

Always back up mainnet wallets before performing dangerous operations such as deleting.

The complete set of regtest-specific arguments can be found on the dimecoind Arguments and Commands page.

Network Type Comparison#

Each network type has some unique characteristics to support development and testing. The tables below summarize some of the significant differences between the 4 network types.

Network Characteristics#

Mainnet

Testnet

Regtest

Public network

Yes

Yes

No

Private network

No

No

Yes

Number of networks

1

1

Unlimited

Using Sporks

To enable or disable sporks on a regtest or devnet, set sporkaddr and sporkkey in the dimecoin.conf config file. Any valid Dimecoin address / private key can be used. You can get an address using the getnewaddress RPC and retrieve its private key using the dumpprivkey RPC.

Mining Characteristics#

Network Type

Difficulty adjustment algorithm

Testnet

Mainnet algorithm, but allows minimum difficulty blocks if no blocks are created for 5 minutes

Regtest

Mines blocks at the minimum difficulty level

See also

chainparams.cpp source for details on other differences