This is a document for starting witness of byteball.
I will explain on the assumption that it will be started on ubuntu using docker. If you do it under other conditions you need to read the explanation.
I do not consider security at all. Please be careful.
*This document is made using google translation.
Caution
witness will not work properly just by starting it.
There are some conditions for normal startup.
· It is necessary to be an Internet environment that can open ports.
· An environment that allows continuous operation for a long time is necessary.
· It is necessary to remit some bytes to the wallet possessed by witness. Remittance bytes are consumed.
· It is necessary for the user to change one of the addresses of the witness list to yours. It is necessary to rewrite it to many users rather than several people.
· In order to obtain witness' s reward, the user who needs to rewrite needs to make remittance etc.
software
Docker community Edition
Mac https://store.docker.com/editions/community/docker-ce-desktop-mac
Windows https://store.docker.com/editions/community/docker-ce-desktop-windows
1:Launch ubuntu, Opening ports
Execute the following command at the terminal.
docker pull ubuntu
docker run -it -p 6611:6611 -p 80:80 -p 587:587 ubuntu
#Do not forget to open the port of the PC.
6611,80 Port used by byteball
587 Port used for gmail. Please change according to the means of sending mail.
2:Get source code, Acquire module
Execute the following command at the terminal.
I am editing it so that it can be executed in batch.
Since they are separated by semicolons, you can execute them one by one if necessary.
cd;apt-get update;apt-get install -y nodejs npm nodejs node-sqlite3 git logrotate vim ssmtp;apt-get install -y -Y sendmail;sendmailconfig;update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10;git clone https://github.com/byteball/byteball-witness;cd byteball-witness;npm install bitcore-mnemonic;npm install;cd node_modules;rm -r byteballcore;rm -r headless-byteball;git clone https://github.com/byteball/byteballcore;git clone https://github.com/byteball/headless-byteball;cd byteballcore/
3:Configuration change of byteball
cd byteballcore/
vim conf.js
#Change one line like this
exports.port = 6611;
cd ~/byteball-witness/
vim conf.js
#change lines like this
exports.port = 6611;
//exports.myUrl = 'wss://mydomain.com/bb';
exports.bServeAsHub = false;
#These lines need special attention.
exports.permanent_pairing_secret = ‘Put a random character string. If you leave the initial value, you can easily hacked from the outside so change is mandatory '
exports.control_addresses = ‘Address to allow operations from Wallet chat. Required to acquire the wallet address of witness later'
exports.payout_address = ‘I can not confirm it, but it seems to be a payment destination for witness reward. Please enter the address of your own wallet.’
*The address of the line written as "exports.control_addresses" is not the address of Wallet but the address of the device. Be careful not to make a mistake.
4:Mail setting
Byteball - witness will send e - mail as necessary.
At first glance it seems quite irrelevant, but if you do not set it is a required task as witness stops with errors during startup.
First, you will issue a new gmail in advance.
Although you can use existing ones, there are security risks, so it is recommended to have dedicated addresses.
[Sign-in & security - Apps with account access - Allow less secure apps: ON]
Execute the following command at the terminal.
cd /etc/ssmtp/
vim ssmtp.conf
#Delete all existing items and rewrite as follows.
#Please match the part written as hoge or password to your own environment.
[email protected]
mailhub=smtp.gmail.com:587
rewriteDomain=gmail.com
hostname=gmail.com
[email protected]
AuthPass=password
AuthMethod=LOGIN
UseSTARTTLS=YES
FromLineOverride=YES
5:1st run of witness
Execute the following command at the terminal.
cd ~/byteball-witness
node start.js
#Enter an arbitrary value as you are prompted for the device name and password. Let's not forget your password as it will be heard every time you start up.
Execute the following command at the terminal.
cd /root/.config/byteball-witness/
vim conf.json
#The json file is changed like this. No change in name part. Make only the mail address of comma and line 2-3 to an arbitrary value. Line head is TAB
The second line receives destinations of various warnings and error mails. Please note that it will receive more than 1000 cases simply by leaving it for half a day.
The third line is the mail address set earlier. In this case, [email protected]
{
"deviceName": "mydeviceName",
"admin_email": "[email protected]",
"from_email": "[email protected]"
}
6:2nd run of witness
Execute the following command at the terminal.
cd ~/byteball-witness
node start.js
#If you succeed at startup, such a line will come out
====== my pairing code: XXX
Copy the part corresponding to XXX and write down.
I will leave it running for about 1 to 3 days after this. HDD consumes at least 13 to 14 GB.
7:Confirmation of witness's wallet address. Transfer to witness
When witness operates normally in the procedure so far,you should receive such e-mails.
“witnessing failed: not enough spendable funds from [your witness’s wallet address] for 488”
Details are unknown, but when running witness, it seems necessary to send a small amount of byteball to witness.
In my case I sent 100000 bytes and disappeared in about 2 days
8:Ask the user to change the witness list
Please ask the user to change the list of witness at the end.
If it is missing, such e-mail will arrive and will stop when the number exceeds 100.
"Only [1-100] spendable outputs left, will split an output of 25000”
Supplement: How to check if it is recognized externally as Witness
https://byteball-cashback-witness.com/balance-and-withdrawal.php
Please go to and enter the wallet address of witness.
If you become Witness, with red frame
"Witness addresses can not use cashback witness system."
The message that comes out.
If there is any other display, it is not recognized outside as witness yet. There is a possibility that you made a mistake in some step.
that's all.
Good luck!!