NEM Exchange Integration Guide

This tutorial will quickly guide you through everything an exchange needs to add NEM.

Proof of importance Exchange NEM

First appeared on the NEM forums, by Paul Rieger

1. Account

To create an account go to https://nem.io/downloads/ 7 and download the desktop client. We recommend creating a simple wallet. The delegated keys can be found at Services/Delegated Harvesting/Manage delegated account. The account’s private key can be found at Account.

2. API Documentation

NEM is completely API based and therefore language agnostic. To get started, take a look at the API documentation https://nemproject.github.io/ 21.

Further, the NEM Knowledge Base consolidates lots of developer resources and examples: https://docs.nem.io 12.

3. Self-Hosted Node/Hugenode

Most exchanges like to run their own node for obvious reasons. I’d still like to point out that you can use the NEM library to execute API calls on a pool of supernodes. This is more reliable than running your own node since the call will be attempted until a working node has been found: https://nemlibrary.com/documentation/connection_pool/ 9

3.1. Self-Hosted Node

If you want to run your own node, you can use the supernode guide and skip step 3: https://forum.nem.io/t/nem-supernode-command-line-tutorial-for-debian-8-4/2211 6

3.2. Self-Hosted Hugenode

If you require historical lookups (i.e. running /account/transfers/all with a hash that’s older than 36 hours), you’ll need to change a few settings for your node and you’ll need much more RAM.

RAM Requirements

Running a node with historical lookups requires at least 9GB of RAM for the NIS process. I recommend a 16GB VPS that assigns 10GB to the NIS. Check section 1.3. of the supernode guide and change the config file to:

#!/bin/bash

java -Xms10240M -Xmx10240M -cp ".:package/nis:package/nis/*:package/libs/*" org.nem.deploy.CommonStarter

Config Changes

Change the following in nis-ncc/package/nis/config.properties:

nis.optionalFeatures = TRANSACTION_HASH_LOOKUP|HISTORICAL_ACCOUNT_DATA

and

nis.transactionHashRetentionTime = -1

You may also like...