How to use the NEM2 blockchain?

Hello fellow readers, follow us today on another journey in the field of distributed ledger technology. Today, we will integrate the NEM2 blockchain protocol into our software.

NEM is a blockchain that exists since March 2015 but since July of 2018, it is possible to experiment with the NEM2 blockchain, aka Catapult.

In this article, we will go through a few simple examples of usage for the NEM2 blockchain open source packages. Most of the packages we are going to use are still under active development and behaviour might change over time.

NEM2 gives us an amazing tool to feed our mosaic balances with Pull Transactions. Those let us request a certain amount of a given mosaic for our account. The request is sent from our account and the payer must co-sign the transaction.

As a first step, we will request funds from the public beta faucet on the Catapult website. Step over to the website of the Catapult Beta and request funds to your newly created address. Wait up to 15 seconds (next block) and your account should have been funded with 10’000 XEM. This amount is subject to change.

Let us now generate a second address, re-iterate the account generation command and note down the new private key and address. This address will be referred to as the second account.

The account generate command always asks you to set a profile name, we recommend to set human readable names to your profiles to make sure you keep them organised.

For instance, this time you would set as name second_account. This way, whenever you add –profile second_account to any nem2-cli commands, you would be using the second account for signing and properties.

nem2-cli account generate -n MIJIN_TEST --save -u http://api.beta.catapult.mijin.io:3000