Nimiq is a frictionless payment protocol for the web.
For a high-level introduction checkout the Nimiq White Paper.
Check out our testnet Browser Miner and Wallet.
- Install Node.js v8.0.0 or higher.
- On Ubuntu, install
git
andbuild-essential
:sudo apt-get install -y git build-essential
.- On other Linux systems, install
git
,python2.7
,make
andgcc
. - For MacOS or Windows, check here for git and here for compilation tools.
- On other Linux systems, install
- Install gulp globally:
sudo npm install -g gulp
oryarn global add gulp
. - Clone this repository
git clone https://github.com/nimiq-network/core
. - In the core directory, run
npm install
oryarn
. - In the core directory, run
npm run build
oryarn build
. - Open
clients/browser/(full|light|nano).html
in your browser to access the Browser Client.
A good way to get started is to have a look at the most simple web application on top of the Nimiq Blockchain.
Follow the Quickstart guide or use our CDN:
<script src="https://cdn.nimiq.com/core/nimiq.js"></script>
Open clients/browser/(full|light|nano).html
in your browser.
To run a Node.js client you will need a publicly routable IP, Domain and SSL Certificate (get a free one at letsencrypt.org). Start the client by running clients/nodejs/index.js
.
cd clients/nodejs/
node index.js --host <hostname> --port <port> --key <ssl-key> --cert <ssl-certificate> [--wallet-seed <seed>] [--wallet-address <address>] [--miner [<threads>]] [--statistics[=<interval>]]
Argument | Description |
---|---|
host | Hostname of the Node.js client. |
port | Port used to communicate with the peers. |
key | SSL private key for your domain. |
cert | SSL certificate of your domain. |
wallet-seed | Your wallet seed (optional). |
wallet-address | Your wallet address for mining (optional, can only be used without wallet-seed). |
miner | The number of threads to start for mining (optional). |
statistics | The interval in seconds to output miner statistics (optional, default: 10). |
Just include <script src="dist/nimiq.js"></script>
in your project.
Visit the API Documentation.
Developers are free to choose between npm and yarn for managing the dependencies.
-
Node.js latest version (> 8.0.0)
-
Dependencies:
npm install
-
Node.js dependencies:
cd src/main/platform/nodejs/ npm install cd clients/nodejs/ npm install
-
Node.js latest version (> 8.0.0)
-
Dependencies:
yarn
-
Node.js dependencies:
cd src/main/platform/nodejs/ yarn cd clients/nodejs/ yarn
npm test
oryarn test
runs browser and NodeJS tests.npm run test-browser
oryarn test-browser
runs the testsuite in your browser only.npm run test-node
oryarn test-node
runs the testsuite in NodeJS only.
npm run lint
or yarn lint
runs the ESLint javascript linter.
Executing npm run build
or yarn build
concatenates all sources into dist/{web,web-babel,web-crypto,node}.js
A Dockerfile is provided which allows for creating your own backbone image using the following arguments.
Argument | Description |
---|---|
BRANCH | Defaults to master but can be any available git branch |
PORT | Defaults to TCP port 8080 |
DOMAIN | Domain to be used for hosting the backbone node |
KEY | Path to an existing certificate key for the DOMAIN |
CRT | Path to an existing signed certificate for the DOMAIN |
WALLET_SEED | Pre-existing wallet private key |
docker build \
--build-arg DOMAIN=<DOMAIN> \
--build-arg BRANCH=<BRANCH> \
--build-arg WALLET_SEED=<WALLET_SEED> \
--build-arg KEY=<KEY> \
--build-arg CRT=<CRT> \
--build-arg PORT=<PORT> \
-t nimiq .
docker run -d -p 8080:8080 -v /etc/letsencrypt/:/etc/letsencrypt/ --name "nimiq" nimiq
Note that you can override any of the arguments which were baked into the image at runtime with exception to the BRANCH. The -v flag here allows for mapping a local system path into the container for the purpose of using the existing DOMAIN certificates.
docker logs -f <instance_id_or_name>
If you'd like to contribute to the development of Nimiq please follow our Code of Conduct and Contributing Guidelines.
This project is under the Apache License 2.0.