The NEM team would like to thank Chang Lu for writing this tutorial and contributing this code.
The project is built on Node.js and MongoDB is also needed. The front end is built on Bootstrap and AngularJS. The whole NEM Blockchain Explorer includes the following modules:
- Block - view all blocks by paging and transactions which are included in the block
- Transaction - view all the transactions by paging
- Account - view rich list and harvested list
- Node - view all nodes or Supernodes in the current NEM Network
- Supernodes Reward - view the Supernode rewards for each day
- Namespace & Mosaic - view all namespaces and mosaics which are included in a namespace
- Search - you can search by block height, transaction hash, or account address
Requirements before starting to build the project include:
- Install Node.js on your machine
- Install NPM
- Install NIS, run it and wait for all blocks to be loaded and synced
- Install MongoDB and run it (it's better to set an account and password)
- Install git
Let's start to build the project:
1) Install bebel (for ES6)
npm install babel-cli -g
2) Put either the nodejs or java blockexplorer on your system:
‘git clone https://github.com/NEMChina/nem_explorer_nodejs’
‘git clone https://github.com/NEMChina/nem_explorer_java’
3) Locate the project folder and install the needed dependencies
4) Add your config into the file (app/config/config.js)
port: 8081, //app port
mongodb: 'mongodb://localhost/explorer', //MongoDB uri
5) Run the application; note that you should wait for the blocks to be fully loaded the first time running the application, it will take a while.
6) Visit http://127.0.0.1:8081
The (Node.js) source is on Github:NEM China Github
The (Java) source is on Github: NEM China Github
Go here to see how it works: http://18.104.22.168:8081
The server will be online for few months.
If you have further any questions and/or remarks regarding the explorer project, please send me a forum PM.