peerplays_migrated/README.md

276 lines
7.1 KiB
Markdown
Raw Normal View History

2017-05-27 03:28:22 +00:00
Intro for new developers and witnesses
2017-05-25 09:13:59 +00:00
------------------------
This is a quick introduction to get new developers and witnesses up to speed on Peerplays blockchain. It is intended for witnesses plannig to join a live, already deployed blockchain.
# Building on Ubuntu 18.04 LTS and Installation Instructions
The following dependencies were necessary for a clean install of Ubuntu 18.04 LTS:
2019-05-23 17:57:29 +00:00
```
sudo apt-get install gcc-5 g++-5 cmake make libbz2-dev\
libdb++-dev libdb-dev libssl-dev openssl libreadline-dev\
autoconf libtool git
```
## Build Boost 1.67.0
2019-05-23 17:57:29 +00:00
```
mkdir $HOME/src
cd $HOME/src
export BOOST_ROOT=$HOME/src/boost_1_67_0
sudo apt-get update
sudo apt-get install -y autotools-dev build-essential libbz2-dev libicu-dev python-dev
wget -c 'http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.bz2/download'\
-O boost_1_67_0.tar.bz2
tar xjf boost_1_67_0.tar.bz2
cd boost_1_67_0/
./bootstrap.sh "--prefix=$BOOST_ROOT"
./b2 install
```
## Building Peerplays
2019-05-23 17:57:29 +00:00
```
cd $HOME/src
export BOOST_ROOT=$HOME/src/boost_1_67_0
2019-05-23 17:57:29 +00:00
git clone https://github.com/peerplays-network/peerplays.git
cd peerplays
2019-05-23 17:57:29 +00:00
git submodule update --init --recursive
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release
2019-05-23 17:57:29 +00:00
make -j$(nproc)
make install # this can install the executable files under /usr/local
```
docker build -t peerplays .
## Docker image
```
# Install docker
sudo apt install docker.io
# Add current user to docker group
sudo usermod -a -G docker $USER
# You need to restart your shell session, to apply group membership
# Type 'groups' to verify that you are a member of a docker group
# Build docker image (from the project root, must be a docker group member)
2019-08-21 17:57:14 +00:00
docker build -t peerplays .
# Start docker image
docker start peerplays
# Exposed ports
# # rpc service:
# EXPOSE 8090
# # p2p service:
# EXPOSE 1776
2019-05-23 17:57:29 +00:00
```
Rest of the instructions on starting the chain remains same.
2017-05-25 09:13:59 +00:00
Starting A Peerplays Node
2017-05-25 09:13:59 +00:00
-----------------
2018-10-15 09:44:29 +00:00
For Ubuntu 14.04 LTS and up users, see
[this](https://github.com/cryptonomex/graphene/wiki/build-ubuntu) and
then proceed with:
2017-05-25 09:13:59 +00:00
2019-05-23 17:59:15 +00:00
git clone https://github.com/peerplays-network/peerplays.git
2017-05-27 03:28:22 +00:00
cd peerplays
2017-05-25 09:13:59 +00:00
git submodule update --init --recursive
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release .
2017-05-25 09:13:59 +00:00
make
./programs/witness_node/witness_node
Launching the witness creates required directories. Next, **stop the witness** and continue.
2017-05-25 09:13:59 +00:00
2018-10-15 09:44:29 +00:00
$ vi witness_node_data_dir/config.ini
2017-05-29 16:46:58 +00:00
p2p-endpoint = 0.0.0.0:9777
2017-05-25 09:13:59 +00:00
rpc-endpoint = 127.0.0.1:8090
seed-node = 213.184.225.234:59500
Start the witness back up
./programs/witness_node/witness_node
2017-05-25 09:13:59 +00:00
Upgrading A Peerplays Node
-----------------
2018-10-15 09:44:29 +00:00
To minimize downtime of your peerplays node when upgrading, one upgrade
idea was written in [this steemit
article](https://steemit.com/peerplays/@joseph/peerplays-update-setting-a-backup-witness-server-switching-servers).
Wallet Setup
-----------------
2017-05-25 09:13:59 +00:00
Then, in a separate terminal window, start the command-line wallet `cli_wallet`:
./programs/cli_wallet/cli_wallet
To set your initial password to 'password' use:
2017-05-25 09:13:59 +00:00
>>> set_password password
>>> unlock password
A list of CLI wallet commands is available
2017-05-27 03:28:22 +00:00
[here](https://github.com/PBSA/peerplays/blob/master/libraries/wallet/include/graphene/wallet/wallet.hpp).
2017-05-25 09:13:59 +00:00
2018-10-15 09:44:29 +00:00
Testnet - "Beatrice"
2017-05-25 09:32:05 +00:00
----------------------
2018-10-15 09:44:29 +00:00
- chain-id - T.B.D.
2017-05-25 09:13:59 +00:00
2018-10-15 09:44:29 +00:00
Use the `get_private_key_from_password` command
---------------------------------
2017-05-28 01:54:20 +00:00
You will to generate owner and active keys
```
get_private_key_from_password your_witness_username active the_key_you_received_from_the_faucet
```
This will reveal an array for your active key `["PPYxxx", "xxxx"]`
import_keys into your cli_wallet
-------------------------------
- use the second value in the array returned from the previous step for the private key
- be sure to wrap your username in quotes
- import the key with this command
```
import_key "your_witness_username" xxxx
```
Upgrade your account to lifetime membership
--------------------------------
```
upgrade_account your_witness_username true
```
Create your witness (substitute the url for your witness information)
-------------------------------
- place quotes around url
```
create_witness your_witness_username "url" true
```
**Be sure to take note of the block_signing_key**
IMPORTANT (issue below command using block_signing_key just obtained)
```
get_private_key block_signing_key
```
Compare this result to
2017-05-25 09:13:59 +00:00
```
dump_private_keys
```
You should see 3 pairs of keys. One of the pairs should match your block_signing_key and this is the one you will use in the next step!
Get your witness id
-----------------
```
2017-05-27 03:28:22 +00:00
get_witness username (note the "id" for your config)
```
2017-05-25 09:13:59 +00:00
Modify your witness_node config.ini to include **your** witness id and private key pair.
-------------------------
Comment out the existing private-key before adding yours
```
vim witness_node_data_dir/config.ini
witness-id = "1.6.x"
2017-05-30 03:18:43 +00:00
private-key = ["block_signing_key","private_key_for_your_block_signing_key"]
```
start your witness back up
------------------
```
./programs/witness_node/witness_node
```
If it fails to start, try with these flags (not for permanent use)
```
2017-05-27 16:48:08 +00:00
./programs/witness_node/witness_node --resync --replay
```
2017-05-25 09:13:59 +00:00
Vote for yourself
--------------
```
vote_for_witness your_witness_account your_witness_account true true
```
2017-05-27 21:31:25 +00:00
Ask to be voted in!
--------------
2017-05-25 09:13:59 +00:00
2017-05-27 03:28:22 +00:00
Join @Peerplays Telegram group to find information about the witness group.
2017-05-27 16:36:00 +00:00
http://t.me/@peerplayswitness
You will get logs that look like this:
```
2070264ms th_a application.cpp:506 handle_block ] Got block: #87913 time: 2017-05-27T16:34:30 latency: 264 ms from: bhuz-witness irreversible: 87903 (-10)
```
2017-05-27 21:31:25 +00:00
Assuming you've received votes, you will start producing as a witness at the next maintenance interval (once per hour). You can check your votes with.
```
get_witness your_witness_account
```
2017-05-25 09:13:59 +00:00
2017-05-30 00:03:02 +00:00
systemd
----------------
It's important for your witness to start when your system boots up. The filepaths here assume that you installed your witness into `/home/ubuntu/peerplays`
Create a logfile to hold your stdout/err logging
```bash
sudo touch /var/log/peerplays.log
```
Save this file in your peerplays directory. `vi /home/ubuntu/peerplays/start.sh`
```bash
#!/bin/bash
cd /home/ubuntu/peerplays
./programs/witness_node/witness_node &> /var/log/peerplays.log
```
Make it executable
```bash
chmod 744 /home/ubuntu/peerplays/start.sh
```
Create this file: `sudo vi /etc/systemd/system/peerplays.service`
Note the path for start.sh. Change it to match where your start.sh file is if necessary.
```
[Unit]
Description=Peerplays Witness
After=network.target
[Service]
ExecStart=/home/ubuntu/peerplays/start.sh
[Install]
WantedBy = multi-user.target
```
Enable the service
```bash
2017-05-30 00:17:03 +00:00
sudo systemctl enable peerplays.service
2017-05-30 00:03:02 +00:00
```
Make sure you don't get any errors
```bash
sudo systemctl status peerplays.service
```
2017-05-30 00:15:54 +00:00
Stop your witness if it is currently running from previous steps, then start it with the service.
2017-05-30 00:03:02 +00:00
```bash
sudo systemctl start peerplays.service
```
Check your logfile for entries
```bash
tail -f /var/log/peerplays.log
```
2017-05-27 03:28:22 +00:00
Running specific tests
----------------------
2017-05-25 09:13:59 +00:00
2017-05-27 03:28:22 +00:00
- `tests/chain_tests -t block_tests/name_of_test`