Overview

Guides show you how to use specific NEM functionality by practising with step by step simple use cases.

How to run an example

Every guide has code examples ready to use.

You will find snippets divided by programming language and topic.

To run an example, check installation instructions for that language.

Cli

Go to cli folder, and give executing permission to an example.

$> chmod +x <file-name>.sh

Find and run an example.

$> ./<file-name>.sh

TypeScript

Go to typescript folder and then install required packages.

$> npm install

Use ts-node to execute TypeScript files with node.

Install the tool first if you have not it installed yet.

$> npm install -g ts-node

Find and run an example.

$> ts-node <file-name>.ts

If some code contains dynamic variables, for example, a public key (without quotes), run:

$> PUBLIC_KEY='<your_public_key_here>' ts-node <file-name>.ts

JavaScript

Go to javascript folder and then install required packages.

$> npm install

Find and run an example.

$> node <file-name>.js

If some code contains dynamic variables, for example, a public key (without quotes), run:

$> PUBLIC_KEY='<your_public_key_here>' node <file-name>.js

Java

Open java folder with your favourite IDE.

Find the example, and run it as a JUnit Test.