Translate

[Blockchain] How to Install NOMP (채굴풀/마이닝풀 설치방법)









채굴풀을 만드려면 어떻게 해야 하는지 알아보다가 오픈소스가 있어서 설치를 해봤다.
(공식홈페이지를 보니 국내 마이닝풀 사이트 https://miningpoolhub.com/ 에서도 해당 오픈소스를 이용하여 구축을 했다고 한다.)




NOMP (Node Open Mining Portal)
 - https://github.com/zone117x/node-open-mining-portal

1004lucifer
Ubuntu: 16.04




lucifer@ubuntu:~$
lucifer@ubuntu:~$ sudo su -
[sudo] password for 1004lucifer:
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
autoconf is already the newest version (2.69-9).
autoconf set to manually installed.
autotools-dev is already the newest version (20150820.1).
build-essential is already the newest version (12.1ubuntu2).
libtool is already the newest version (2.4.6-0.1).
pkg-config is already the newest version (0.29.1-0ubuntu1).
libssl-dev is already the newest version (1.0.2g-1ubuntu4.10).
0 upgraded, 0 newly installed, 0 to remove and 98 not upgraded.
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# apt-get install libboost-all-dev git npm nodejs nodejs-legacy libminiupnpc-dev redis-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
...
Setting up node-sha (1.2.3-1) ...
Setting up node-slide (1.1.4-1) ...
Setting up nodejs-legacy (4.2.6~dfsg-1ubuntu4.1) ...
Setting up npm (3.5.2-0ubuntu4) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu19) ...
Processing triggers for ureadahead (0.100.0-19) ...
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# add-apt-repository ppa:bitcoin/bitcoin
 Stable Channel of bitcoin-qt and bitcoind for Ubuntu, and their dependencies

Note that you should prefer to use the official binaries, where possible, to limit trust in Launchpad/the PPA owner.

No longer supports precise, due to its ancient gcc and Boost versions.
 More info: https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpln5r6c2i/secring.gpg' created
gpg: keyring `/tmp/tmpln5r6c2i/pubring.gpg' created
gpg: requesting key 8842CE5E from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpln5r6c2i/trustdb.gpg: trustdb created
gpg: key 8842CE5E: public key "Launchpad PPA for Bitcoin" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# apt-get update
Hit:1 http://kr.archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://kr.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://kr.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Hit:4 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu xenial InRelease
Get:5 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [710 kB]
Get:6 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [660 kB]
Get:7 http://kr.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [580 kB]
Get:8 http://kr.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [538 kB]
Get:9 http://kr.archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [6,628 B]
Get:10 http://kr.archive.ubuntu.com/ubuntu xenial-backports/universe i386 Packages [6,612 B]
Get:11 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Fetched 2,807 kB in 6s (433 kB/s)
Reading package lists... Done
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# apt-get install libdb4.8-dev libdb4.8++-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libdb4.8-dev is already the newest version (4.8.30-xenial4).
libdb4.8++-dev is already the newest version (4.8.30-xenial4).
0 upgraded, 0 newly installed, 0 to remove and 98 not upgraded.
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3535  100  3535    0     0   4136      0 --:--:-- --:--:-- --:--:--  4134
=> Downloading nvm from git to '/root/.nvm'
=> Cloning into '/root/.nvm'...
remote: Counting objects: 6699, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 6699 (delta 3), reused 10 (delta 3), pack-reused 6684
Receiving objects: 100% (6699/6699), 2.07 MiB | 1.06 MiB/s, done.
Resolving deltas: 100% (4155/4155), done.
Checking connectivity... done.
Note: checking out 'v0.16.1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 64de890... v0.16.1
Deleted branch master (was 6dd9ecb).

=> Appending source string to /root/.bashrc
=> Close and reopen your terminal to start using nvm
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# source ~/.profile
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# nvm install 0.10.25
######################################################################## 100.0%
Now using node v0.10.25
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# nvm use 0.10.25
Now using node v0.10.25
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# git clone https://github.com/zone117x/node-open-mining-portal.git nomp
Cloning into 'nomp'...
remote: Counting objects: 2556, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 2556 (delta 3), reused 4 (delta 2), pack-reused 2548
Receiving objects: 100% (2556/2556), 712.15 KiB | 439.00 KiB/s, done.
Resolving deltas: 100% (1540/1540), done.
Checking connectivity... done.
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# cd nomp
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp# npm update
npm http GET https://registry.npmjs.org/dateformat/latest
npm http GET https://registry.npmjs.org/node-json-minify/latest
npm http GET https://registry.npmjs.org/redis/latest
npm http GET https://registry.npmjs.org/mysql/latest
npm http GET https://registry.npmjs.org/async/latest
npm http GET https://registry.npmjs.org/express/latest
...
bignum@0.12.5 node_modules/bignum
├── nan@2.8.0
└── node-pre-gyp@0.6.39 (detect-libc@1.0.3, semver@5.5.0, rc@1.2.5, mkdirp@0.5.1, nopt@4.0.1, hawk@3.1.3, tar@2.2.1, rimraf@2.6.2, tar-pack@3.4.1, npmlog@4.1.2, request@2.81.0)
node-pre-gyp http GET https://rvagg-node.s3-us-west-2.amazonaws.com/bignum/v0.12.5/bignum-v0.12.5-node-v11-linux-x64.tar.gz
node-pre-gyp http 200 https://rvagg-node.s3-us-west-2.amazonaws.com/bignum/v0.12.5/bignum-v0.12.5-node-v11-linux-x64.tar.gz
[bignum] Success: "/root/nomp/node_modules/stratum-pool/node_modules/bignum/binding/bignum.node" is installed via remote
stratum-pool@0.1.9 node_modules/stratum-pool
├── base58-native@0.1.4
├── async@2.6.0 (lodash@4.17.4)
├── multi-hashing@0.0.9 (bindings@1.3.0)
└── bignum@0.12.5 (nan@2.8.0, node-pre-gyp@0.6.39)
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp# node init.js
config.json file does not exist. Read the installation/setup instructions.
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp# cp config_example.json config.json
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp#
root@ubuntu:~/nomp# node init.js
2018-02-03 00:58:30 [POSIX]     [Connection Limit] (Safe to ignore) POSIX module not installed and resource (connection) limit was not raised
2018-02-03 00:58:30 [Master]    [PoolSpawner] No pool configs exists or are enabled in pool_configs folder. No pools spawned.
2018-02-03 00:58:30 [Master]    [CLI] CLI listening on port 17117
2018-02-03 00:58:30 [Website]   [Server] Website started on 0.0.0.0:80
(node-watch) First param in callback function  is replaced with event name since 0.5.0, use  `(evt, filename) => {}` if you want to get the filename







설치 및 기동 시 아래와 같은 에러가 발생 시 링크 확인 후 조치하면 된다.

1. SyntaxError: Use of const in strict mode
 - http://1004lucifer.blogspot.kr/2018/02/nomp-error-syntaxerror-use-of-const-in.html

2. Error: Module did not self-register
 - http://1004lucifer.blogspot.kr/2018/02/nomp-error-module-did-not-self-register_3.html






정상적으로 설치 / 기동하게되면 접속 시 아래와 같이 보여진다.




how to install nomp server and nodejs
Quickstart Guide to NOMP
setup mining pool

참고
 - https://blockgen.net/setup-your-own-mining-pool/


댓글