NEM is a peer-to-peer cryptocurrency based on a next-generation blockchain algorithm. It was launched in March of 2015 and functions similar to Bitcoin. However, NEM has a number of advanced features and enhancements that Bitcoin's older technology lacks. Some of the benefits that NEM claims to have over other cryptocurrencies include that it has been built entirely from scratch and that it uses an innovative proof-of-importance algorithm for blockchain generation.
One of the core concepts in cryptocurrency is the blockchain. A blockchain is a distributed, provable list of blocks containing data such as transactions or documents. Each block has a cryptographic hash that indicates the prior block in the chain, linking the two. Together, all of the blocks in the blockchain form a continuous, secure history. Cryptocurrencies use these blockchains as publicly proveable ledgers to show how units of the currency are introduced, spent, and passed from one owner to the next.
In a peer-to-peer network such as NEM or Bitcoin, every node can have a complete copy of the blockchain. Since the system is distributed across the network, there is no centralized copy of the blockchain. New transactions or records are collected by certain nodes and, if they are valid, are added to the next block that the peer-to-peer network approves.
NEM's blockchain has a new feature that's not present in previous cryptocurrencies. It can be used to store any type of data, and not just financial transactions. For more information on how blockchains work with NEM, check out The Beginner's Guide to NEM.
Keeping Your Wallet Secure
XEM is the cryptocurrency unit used by NEM. With NEM, as with other cryptocurrencies, your balance is stored securely in an encrypted file called a wallet. Keeping your wallet secure is crucial to the safety of your cryptocurrency investment!
The NEM architecture is broadly composed of two components, the NEM Infrastructure Server (NIS), and the NEM Community Client (NCC). The NIS is a node in the peer-to-peer network that makes NEM possible, and stores the blockchain as well as acting as a gateway for the NCC. The NCC provides a wallet and a frontend for interacting with the wallet and the NEM network.
Since the NCC stores your wallet, it is important that it be kept on a secure computer. In this tutorial, we will install the NIS on a CenturyLink Cloud Computer server, and connect to it via a locally-secured NCC installed on your workstation.
CenturyLink Cloud Compute servers are high-performance cloud servers. These enterprise-grade virtual machines are easy to deploy and manage from the CenturyLink Cloud Console and via our powerful API.
Before We Start
If you don’t have a CenturyLink Cloud account yet, head over to our website and sign up for a free trial. You’ll need it to access CenturyLink Cloud products.
Deploy a New Virtual Server with NEM
Our first step is to deploy a new CenturyLink Cloud virtual server. Follow the steps below.
- Log into the CenturyLink Cloud control portal at https://control.ctl.io/
- On the left side menu, click Infrastructure and then Servers.
- On the left-hand side of the server panel, click on the region for the server you want to provision.
- Click create and then server.
- Complete the setup form for your new server. Be sure to fill out the fields for server name and admin/root password.
- For operating system, select "Ubuntu 16 | 64-bit".
- Click create server.
- Your server provisioning request will enter the queue. You can watch the progress of your request on the screen. Your server is provisioned when the status of all tasks in the queue is complete.
- After your new server is provisioned, in the CenturyLink control portal, click Infrastructure on the left side menu, and then click Servers.
- Navigate to your new server and click on its name.
- Click the more menu, and then click add public ip.
- Check the box for SSH/SFTP (22).
- Click custom port... and then single port.
- Select "TCP" in the drop-down menu and enter "7890" in the input box. This allows NCC to connect to the NIS.
- Click add public ip address.
Installing and Configuring the NIS
In this section, we will configure your new virtual server to run NIS and connect to the NEM peer-to-peer network. This will involve installing custom software and creating a new user.
- Log into the CenturyLink Cloud control portal at https://control.ctl.io/
- On the left side menu, click Infrastructure, and then click Servers.
- Navigate to the virtual server you provisioned in the previous step and click on its name.
- On the right hand side of the server status page, look for IP ADDRESS(ES). Your server's public IP address will be underlined.
- From a shell or terminal on your local machine, connect to your new server with the following command. Replace "YOUR.VPS.IP" with your server's public IP address.
- Install the required Ubuntu packages with the following commands.
apt update apt install software-properties-common tmux openjdk-8-jre -y
- Create a new user to run the NEM software and change to that account. Run these commands.
useradd -d /var/local/nem -s /bin/bash -U -m nem su - nem
- In your web browser, go to https://www.nem.io/install.html and scroll down to the section titled Standalone Client.
- Copy the URL for NIS/NCC Standalone (.tgz). We will use "http://bob.nem.ninja/nis-ncc-0.6.82.tgz" in this example.
- In your virtual server shell, run the following commands.
wget http://bob.nem.ninja/nis-ncc-0.6.82.tgz tar xfz nis-ncc-0.6.82.tgz
- Next, we will run the NIS inside tmux, a terminal multiplexer. This will allow the NIS to continue running even after you log out. Run the following commands.
tmux cd package/ sh ./nix.runNis.sh
- Exit tmux by pressing Control-B, releasing the "Control" key, and then pressing D.
Note: You can reconnect to the NIS terminal later with the command
tmux attach. For more information on tmux, check out this guide to getting started with tmux.
Connecting a Local NCC to Your Virtual Server
Installing the NCC is a little bit different for each operating system. Visit the Windows and Mac Installation Guide or the Ubuntu Installation Guide to get NCC up and running. Once the NCC is running, follow these directions.
- In your web browser, go to http://127.0.0.1:8989/
- Click Create New Wallet.
- For "Name of your Wallet" input a descriptive name.
- For "Password" input a new password. This will be used to encrypt your wallet, so if you forget your password, you will not be able to recover your wallet.
- Click Create. You will be taken to the NCC wallet screen.
- In the left-hand column, click Settings.
- Click Remote Server.
- For Protocol, select "HTTP".
- In the Host box, type your virtual server's public IP address.
- Click Save.
- In a few moments, you will see an NIS status message at the top of the page. Note: If you just started your NIS, you will see a message saying, "NIS is synchronizing."
Cryptocurrency is a relatively new and incredibly complex subject. Getting involved with NEM can provide a rich field for technological exploration through cutting-edge modern blockchain and cryptographic systems.
There is a world of possibilities with NEM. Visit the NEM Tutorial List to get ideas for what to do next. You should also visit the NEM Wiki, where you can dive into the technology driving the project. Also be sure to check out the Buy XEM page to find exchanges and resources for loading up your NCC wallet with XEM currency.