Emer Testnet — Why and How?
Let’s say, you decided to create a blockchain-enabled project. You might want to store data on products, manufacturers, vehicles, and so on. Then it makes sense to debug every node at each stage — several times. But we have a problem: Adding records to a blockchain comes at a price, and if tests are many, the price might be pretty high.
That’s when the test mode comes in handy. It allows you to mine coins using the CPU of a low-end PC. The coins will still possess all the non-monetary properties of “real” EMC. You can send test coins to test addresses, create any number of NVS blockchain records, and combine test wallets into a testnet.
To do this, just:
Download and install the latest Emercoin wallet.
Open emercoin.conf and add the following line:
Launch the wallet and wait for a little while. The client will find the test seed and synchronize the blockchain in a few minutes. If the client cannot find the seed for a long time, open the console and point to it manually:
addnode 22.214.171.124 add
And then comes the fun part: Mining coins the way we did it back in good old 2009 — using the central processor.
Open the console again and enter:
setgenerate true X (where X is the number of CPU cores allocated for mining; omitting this number allocates all available cores).
The PoW complexity of the network is so low that the wallet will close the block in mere minutes, providing you with test coins. Their quantity will be sufficient for most tests. If it’s not, keep mining overnight or longer, until you get the nifty sum you need.
To stop generating test coins, use the following command:
Alternatively, just close the wallet client.
By the way, PoW-mined coins will start generating new coins themselves in one day through PoS mining.
For convenient tracking, we have also deployed a blockchain explorer for the public testnet at https://testnet.emercoin.mintr.org. It provides the same functions as that of the “Big Emer”, and you can easily switch between the two.
If you don’t want to use the public testnet for whatever reason, you can create your own private one.
How do I do this?
First of all, create a local network isolated from the Internet. That’s where you will be doing your tests. By isolating the network you make sure that your testnet will not be merged with the public one.
Now install at least two wallets with testnet=1 in this test network, as explained above.
Then run the addnode console command from the example above on each node of your local testnet. Use the IP addresses of the other computers running nodes of your local testnet.
Example. You have installed testnet wallets on local machines with IP addresses 192.168.1.10 and 192.168.1.11. Then you have to enter “addnode 192.168.1.11 add” in the wallet console of the machine at 192.168.1.10 and “addnode 192.168.1.10 add” in that of the machine at 192.168.1.11.
You can add these parameters to emercoin.conf. Then its content on the machine at 192.168.1.10 from the above example will be:
The emercoin.conf file is located in:
Create the file if it does not exist. Be careful when creating a new file in Windows: Turn off the “Hide extensions for known file types” file explorer option — otherwise you will create emercoin.conf.txt instead of emercoin.conf (that’s Windows for you).