-
Notifications
You must be signed in to change notification settings - Fork 47
Detailed guide about Webchain pool installation
In the next example distribution was installed with the user "webchain".
adduser webchain --disabled-password
(you just need to hit ENTER to continue, when you see “Is the information correct? [Y/n]” you type y)
apt-get install sudo wget openssh-server software-properties-common build-essential tcl git unzip curl python net-tools nginx
(at some point it will ask you “Do you want to continue? [Y/n]” type y)
sudo apt-get update sudo apt-get install redis-server (at some point it will ask you “Do you want to continue? [Y/n]” type y)
sudo nano /etc/redis/redis.conf
- In the file (redis.conf), find the “supervised” directive.
- You can use : Ctrl+W and paste the word “supervised”
- You will see this “supervised no”. Change it to “supervised systemd”
- Save and close the file when you are finished.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
systemctl enable redis-server
systemctl start redis-server
systemctl status redis-server
(before you go to the next step, exit status menu of the server by clicking Ctrl+C)
cd /home/webchain/
curl -O https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.13.3.linux-amd64.tar.gz
su webchain
echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go version
go env
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install v8.17.0
command -v nvm
npm -v
nvm list
Before completing the next steps make sure you are logged into the webchain userid created above. If you are not, there is a risk that your webchain mainnet files will be placed in the wrong location. The webchain database and key files should be located in /home/webchain/.webchain/mainnet
but if you are logged on as root there is a risk that these files will be located in /root/.webchain/mainnet
.
- Download the latest Version of Webchaind
wget https://github.com/mintme-com/webchaind/releases/download/v0.8.0/webchaind-0.8.0-linux-amd64.zip
unzip webchaind-0.8.0-linux-amd64.zip -d .
Note: dot in the end of the command is not a typo, it’s an important part of the command)
- Test that Webchaind is working properly
./webchaind --help
./webchaind account list
(You will not see anything which is normal)
- Create a new Webchaind account (If you don’t have one already from a previous pool)
./webchaind account new
(example : 0x71a5de171cc7f23997267f4c18f30d682001bdf0)
- Type the passphrase (Note : use a strong one eg : ts0H@pp1€ , and make sure that you don’t forget it.)
Note: If you already have a wallet, just copy your keystore file from your old pool or from your backup to this location
/home/webchain/.webchain/mainnet/keystore/
- Connect your old pool server using PuTTY (Windows users)
- Now copy your pool wallet to the new server using “scp” command
scp /home/webchain/.webchain/mainnet/keystore/UTC--2018-12-25T12-59-53.183289922Z--71a5de171cc7f23997267fxxxxx root@newserverip:/home/webchain/.webchain/mainnet/keystore/
Example of file : UTC--2018-12-25T12-59-53.183289922Z--71a5de171cc7f23997267fxxxxx
If you stored your pool wallet on your computer, you should upload it to that same location
(/home/webchain/.webchain/mainnet/keystore/
) using a software like FileZilla
- Then go to your new pool and continue
- Test Webchain daemon console
./webchaind console
exit
- Copy and paste a passphrase you just have set into this file
nano /home/webchain/wallet.pass
- Save and close.
Ctrl+O -> Enter (Save the file) Ctrl+X -> exit the editor
git clone https://github.com/mintme-com/pool.git
mv pool webchain-pool
cd webchain-pool
make
cd /home/webchain/webchain-pool/www/config
nano environment.js
You need to change certain values in www/config/environment.js to match your domain name or your IP address.
ApiUrl: '//[your_IP_or_Domain]/',
HttpHost: '[your_IP_or_Domain]',
StratumHost: '[your_IP_or_Domain]',
- Save and close.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
cd /home/webchain/webchain-pool/www
npm install -g ember-cli@2.4.3
npm install -g bower
npm install
bower install
./build.sh
cd /home/webchain/webchain-pool
rm config.json
nano config.json
{
"threads": 2,
"coin": "web",
"name": "main",
"proxy": {
"enabled": true,
"listen": "0.0.0.0:8888",
"limitHeadersSize": 1024,
"limitBodySize": 256,
"behindReverseProxy": false,
"blockRefreshInterval": "120ms",
"stateUpdateInterval": "3s",
"difficulty": 1000,
"hashrateExpiration": "3h",
"healthCheck": true,
"maxFails": 100,
"stratum": {
"enabled": true,
"listen": "0.0.0.0:3333",
"timeout": "120s",
"maxConn": 8192
},
"varDiff": {
"minDiff": 500,
"maxDiff": 100000,
"targetTime": 100,
"variancePercent": 30,
"maxJump": 50
},
"policy": {
"workers": 8,
"resetInterval": "60m",
"refreshInterval": "1m",
"banning": {
"enabled": false,
"ipset": "blacklist",
"timeout": 1800,
"invalidPercent": 30,
"checkThreshold": 30,
"malformedLimit": 5
},
"limits": {
"enabled": false,
"limit": 30,
"grace": "5m",
"limitJump": 10
}
}
},
"api": {
"enabled": false,
"purgeOnly": false,
"purgeInterval": "10m",
"listen": "0.0.0.0:8080",
"statsCollectInterval": "5s",
"hashrateWindow": "30m",
"hashrateLargeWindow": "3h",
"luckWindow": [64, 128, 256],
"payments": 30,
"blocks": 50
},
"upstreamCheckInterval": "5s",
"upstream": [
{
"name": "main",
"url": "http://127.0.0.1:39573",
"timeout": "10s"
}
],
"redis": {
"endpoint": "127.0.0.1:6379",
"poolSize": 10,
"database": 0,
"password": ""
},
"unlocker": {
"enabled": false,
"poolFee": 1.0,
"poolFeeAddress": "",
"devDonate": 10.0,
"depth": 32,
"immatureDepth": 16,
"keepTxFees": false,
"interval": "1m",
"daemon": "http://127.0.0.1:39573",
"timeout": "10s"
},
"payouts": {
"enabled": false,
"requirePeers": 2,
"interval": "120m",
"daemon": "http://127.0.0.1:39573",
"timeout": "10s",
"address": "0x0",
"gas": "21000",
"gasPrice": "200000000000",
"autoGas": true,
"threshold": 5000000000,
"bgsave": false
},
"newrelicEnabled": false,
"newrelicName": "MyEtherProxy",
"newrelicKey": "SECRET_KEY",
"newrelicVerbose": false
}
- Save and close.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
nano config-api.json
{
"threads": 2,
"coin": "web",
"name": "main",
"proxy": {
"enabled": false,
"listen": "0.0.0.0:8888",
"limitHeadersSize": 1024,
"limitBodySize": 256,
"behindReverseProxy": false,
"blockRefreshInterval": "120ms",
"stateUpdateInterval": "3s",
"difficulty": 1000,
"hashrateExpiration": "3h",
"healthCheck": true,
"maxFails": 100,
"stratum": {
"enabled": true,
"listen": "0.0.0.0:3333",
"timeout": "120s",
"maxConn": 8192
},
"varDiff": {
"minDiff": 500,
"maxDiff": 100000,
"targetTime": 100,
"variancePercent": 30,
"maxJump": 50
},
"policy": {
"workers": 8,
"resetInterval": "60m",
"refreshInterval": "1m",
"banning": {
"enabled": false,
"ipset": "blacklist",
"timeout": 1800,
"invalidPercent": 30,
"checkThreshold": 30,
"malformedLimit": 5
},
"limits": {
"enabled": false,
"limit": 30,
"grace": "5m",
"limitJump": 10
}
}
},
"api": {
"enabled": true,
"purgeOnly": false,
"purgeInterval": "10m",
"listen": "0.0.0.0:8080",
"statsCollectInterval": "5s",
"hashrateWindow": "30m",
"hashrateLargeWindow": "3h",
"luckWindow": [64, 128, 256],
"payments": 30,
"blocks": 50
},
"upstreamCheckInterval": "5s",
"upstream": [
{
"name": "main",
"url": "http://127.0.0.1:39573",
"timeout": "10s"
}
],
"redis": {
"endpoint": "127.0.0.1:6379",
"poolSize": 10,
"database": 0,
"password": ""
},
"unlocker": {
"enabled": false,
"poolFee": 1.0,
"poolFeeAddress": "",
"devDonate": 10.0,
"depth": 32,
"immatureDepth": 16,
"keepTxFees": false,
"interval": "1m",
"daemon": "http://127.0.0.1:39573",
"timeout": "10s"
},
"payouts": {
"enabled": false,
"requirePeers": 2,
"interval": "120m",
"daemon": "http://127.0.0.1:39573",
"timeout": "10s",
"address": "0x0",
"gas": "21000",
"gasPrice": "200000000000",
"autoGas": true,
"threshold": 5000000000,
"bgsave": false
},
"newrelicEnabled": false,
"newrelicName": "MyEtherProxy",
"newrelicKey": "SECRET_KEY",
"newrelicVerbose": false
}
- Save and close.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
nano config-unlocker.json
{
"threads": 2,
"coin": "web",
"name": "main",
"proxy": {
"enabled": false,
"listen": "0.0.0.0:8888",
"limitHeadersSize": 1024,
"limitBodySize": 256,
"behindReverseProxy": false,
"blockRefreshInterval": "120ms",
"stateUpdateInterval": "3s",
"difficulty": 1000,
"hashrateExpiration": "3h",
"healthCheck": true,
"maxFails": 100,
"stratum": {
"enabled": true,
"listen": "0.0.0.0:3333",
"timeout": "120s",
"maxConn": 8192
},
"varDiff": {
"minDiff": 500,
"maxDiff": 100000,
"targetTime": 100,
"variancePercent": 30,
"maxJump": 50
},
"policy": {
"workers": 8,
"resetInterval": "60m",
"refreshInterval": "1m",
"banning": {
"enabled": false,
"ipset": "blacklist",
"timeout": 1800,
"invalidPercent": 30,
"checkThreshold": 30,
"malformedLimit": 5
},
"limits": {
"enabled": false,
"limit": 30,
"grace": "5m",
"limitJump": 10
}
}
},
"api": {
"enabled": false,
"purgeOnly": false,
"purgeInterval": "10m",
"listen": "0.0.0.0:8080",
"statsCollectInterval": "5s",
"hashrateWindow": "30m",
"hashrateLargeWindow": "3h",
"luckWindow": [64, 128, 256],
"payments": 30,
"blocks": 50
},
"upstreamCheckInterval": "5s",
"upstream": [
{
"name": "main",
"url": "http://127.0.0.1:39573",
"timeout": "10s"
}
],
"redis": {
"endpoint": "127.0.0.1:6379",
"poolSize": 10,
"database": 0,
"password": ""
},
"unlocker": {
"enabled": true,
"poolFee": 1.0,
"poolFeeAddress": "",
"devDonate": 10.0,
"depth": 32,
"immatureDepth": 16,
"keepTxFees": false,
"interval": "1m",
"daemon": "http://127.0.0.1:39573",
"timeout": "10s"
},
"payouts": {
"enabled": false,
"requirePeers": 2,
"interval": "120m",
"daemon": "http://127.0.0.1:39573",
"timeout": "10s",
"address": "0x0",
"gas": "21000",
"gasPrice": "200000000000",
"autoGas": true,
"threshold": 5000000000,
"bgsave": false
},
"newrelicEnabled": false,
"newrelicName": "MyEtherProxy",
"newrelicKey": "SECRET_KEY",
"newrelicVerbose": false
}
- Save and close.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
nano config-payouts.json
Note : in the payouts block, change the address with your own address (the one you created previously for the pool, or the one you already had before)
{
"threads": 2,
"coin": "web",
"name": "main",
"proxy": {
"enabled": false,
"listen": "0.0.0.0:8888",
"limitHeadersSize": 1024,
"limitBodySize": 256,
"behindReverseProxy": false,
"blockRefreshInterval": "120ms",
"stateUpdateInterval": "3s",
"difficulty": 1000,
"hashrateExpiration": "3h",
"healthCheck": true,
"maxFails": 100,
"stratum": {
"enabled": true,
"listen": "0.0.0.0:3333",
"timeout": "120s",
"maxConn": 8192
},
"varDiff": {
"minDiff": 500,
"maxDiff": 100000,
"targetTime": 100,
"variancePercent": 30,
"maxJump": 50
},
"policy": {
"workers": 8,
"resetInterval": "60m",
"refreshInterval": "1m",
"banning": {
"enabled": false,
"ipset": "blacklist",
"timeout": 1800,
"invalidPercent": 30,
"checkThreshold": 30,
"malformedLimit": 5
},
"limits": {
"enabled": false,
"limit": 30,
"grace": "5m",
"limitJump": 10
}
}
},
"api": {
"enabled": false,
"purgeOnly": false,
"purgeInterval": "10m",
"listen": "0.0.0.0:8080",
"statsCollectInterval": "5s",
"hashrateWindow": "30m",
"hashrateLargeWindow": "3h",
"luckWindow": [64, 128, 256],
"payments": 30,
"blocks": 50
},
"upstreamCheckInterval": "5s",
"upstream": [
{
"name": "main",
"url": "http://127.0.0.1:39573",
"timeout": "10s"
}
],
"redis": {
"endpoint": "127.0.0.1:6379",
"poolSize": 10,
"database": 0,
"password": ""
},
"unlocker": {
"enabled": false,
"poolFee": 1.0,
"poolFeeAddress": "",
"devDonate": 10.0,
"depth": 32,
"immatureDepth": 16,
"keepTxFees": false,
"interval": "1m",
"daemon": "http://127.0.0.1:39573",
"timeout": "10s"
},
"payouts": {
"enabled": true,
"requirePeers": 2,
"interval": "120m",
"daemon": "http://127.0.0.1:39573",
"timeout": "10s",
"address": "0xyour_address",
"gas": "21000",
"gasPrice": "200000000000",
"autoGas": true,
"threshold": 5000000000,
"bgsave": false
},
"newrelicEnabled": false,
"newrelicName": "MyEtherProxy",
"newrelicKey": "SECRET_KEY",
"newrelicVerbose": false
}
- Save and close.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
exit
Configure nginx to serve API on /api subdirectory. Configure nginx to serve www/dist as static website.
nano /etc/nginx/sites-available/default
root /home/webchain/webchain-pool/www/dist;
location /api {
if ($request_uri ~* "/api/(.*)") {
proxy_pass http://127.0.0.1:8080/apietc/$1;
}
}
- Save and close.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
nginx -t
service nginx restart
service nginx status
(before you go to the next step, exit status menu of the server by clicking Ctrl+C)
Note : in the line ExecStart=, change the address with your own address (the one you created previously for the pool)
cd /etc/systemd/system/
nano webchaind.service
[Unit]
Description=Webchaind
After=network.target
[Service]
Type=simple
User=webchain
Group=webchain
ExecStart=/home/webchain/webchaind --rpc --rpcaddr 127.0.0.1 --unlock '0xyour_address' --password /home/webchain/wallet.pass
Restart=always
[Install]
WantedBy=multi-user.target
- Save and close Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
nano webchain-pool.service
[Unit]
Description=Webchain-pool
After=network.target
[Service]
Type=simple
User=webchain
Group=webchain
ExecStart=/home/webchain/webchain-pool/build/bin/webchain-pool /home/webchain/webchain-pool/config.json
Restart=always
[Install]
WantedBy=multi-user.target
- Save and close.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
nano webchain-pool-api.service
[Unit]
Description=Webchain-pool-api
After=network.target
[Service]
Type=simple
User=webchain
Group=webchain
ExecStart=/home/webchain/webchain-pool/build/bin/webchain-pool /home/webchain/webchain-pool/config-api.json
Restart=always
[Install]
WantedBy=multi-user.target
- Save and close.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
nano webchain-pool-unlocker.service
[Unit]
Description=Webchain-pool-unlocker
After=network.target
[Service]
Type=simple
User=webchain
Group=webchain
ExecStart=/home/webchain/webchain-pool/build/bin/webchain-pool /home/webchain/webchain-pool/config-unlocker.json
Restart=always
[Install]
WantedBy=multi-user.target
- Save and close.
Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
nano webchain-pool-payouts.service
[Unit]
Description=Webchain-pool-payouts
After=network.target
[Service]
Type=simple
User=webchain
Group=webchain
ExecStart=/home/webchain/webchain-pool/build/bin/webchain-pool home/webchain/webchain-pool/config-payouts.json
Restart=always
[Install]
WantedBy=multi-user.target
- Save and close. Ctrl+O -> Enter (save the file) Ctrl+X -> exit the editor
Enable webchaind service, webchain-pool service, webchain-pool-api service, webchain-pool-unlocker service, webchain-pool-payouts service by pasting next block of commands at once
systemctl enable webchaind.service
systemctl enable webchain-pool.service
systemctl enable webchain-pool-api.service
systemctl enable webchain-pool-unlocker.service
systemctl enable webchain-pool-payouts.service
Start webchaind service, webchain-pool service, webchain-pool-api service, webchain-pool-unlocker service, webchain-pool-payouts service by pasting next block of commands at once
systemctl start webchaind.service
systemctl start webchain-pool.service
systemctl start webchain-pool-api.service
systemctl start webchain-pool-unlocker.service
systemctl start webchain-pool-payouts.service
Check status of webchaind service, webchain-pool service, webchain-pool-api service, webchain-pool-unlocker service, webchain-pool-payouts service by pasting next block of commands at once
systemctl status webchaind.service
systemctl status webchain-pool.service
systemctl status webchain-pool-api.service
systemctl status webchain-pool-unlocker.service
systemctl status webchain-pool-payouts.service
netstat -tupln
Open the browser and type your IP address or domain name (Example : 192.168.200.163 in my case). You should see this : http://take.ms/OUxvQ and http://take.ms/PeJcw
Source : https://github.com/mintme-com/webchaind/wiki/mining IMPORTANT: Make a backup of your pool's wallet (save it in a secure place)
/home/webchain/.webchain/mainnet/keystore/UTC--2018-12-25T12-59-53.183289922Z--71a5de171cc7f23997267f4c18f30d682001bdf0