Random Number Generator (RNG)
Other Documentation
PBSA's GLADIATOR network
Setup SONs and join GLADIATOR public TESTNET
This is a quick document which assumes that the user has experience in setting up various Graphene blockchains before. The following link can be a good refresher: https://community.peerplays.tech/witnesses/becoming-a-witness
In this document, the executables are downloaded from the Gitlab CI-CD pipeline.

1. Prepare the server

The following dependencies are necessary for a clean Ubuntu 18.04 LTS
1
sudo apt-get install autoconf bash build-essential ca-certificates cmake \
2
doxygen git graphviz libbz2-dev libcurl4-openssl-dev libncurses-dev \
3
libreadline-dev libssl-dev libtool libzmq3-dev locales ntp pkg-config \
4
wget
Copied!

2. Download SON executable

Go to https://gitlab.com/PBSA/peerplays/-/jobs and find the job ID for the build you want to use. Build should have the following properties
  • Job: features/SONs-base
  • Stage: build
  • Name: build
Example of such a job has ID 467332251:
build (#467332251) · Jobs · PBSA / peerplays
GitLab
To download executables, click Download button on the right side of the Job page, or execute the following command:
1
wget --content-disposition --show-progress\
2
https://gitlab.com/PBSA/peerplays/-/jobs/538784707/artifacts/download
Copied!
To unpack executables in current folder:
1
unzip -j artifacts.zip build/programs/cli_wallet/cli_wallet -d ./
2
unzip -j artifacts.zip build/programs/witness_node/witness_node -d ./
Copied!
Execute the witness_node binary which will create the necessary files and folders under witness_node_data_dir
1
./witness_node
Copied!
Stop the node (CTRL + c ) and edit config.ini to configure the node.

Connecting to PBSA's Gladiator Testnet

Inside config.ini, set the seed-nodes to:
1
seed-nodes=["96.46.49.1:9777", "96.46.49.2:9777", "96.46.49.3:9777", "96.46.49.4:9777", "96.46.49.5:9777", "96.46.49.6:9777", "96.46.49.7:9777", "96.46.49.8:9777", "96.46.49.9:9777", "96.46.49.10:9777", "96.46.49.11:9777", "96.46.49.12:9777", "96.46.49.13:9777", "96.46.49.14:9777", "96.46.49.15:9777", "96.46.49.16:9777"]
Copied!
In order to sync with PBSA's Gladiator Testnet, the genesis file must be exactly the same as used by the witness nodes. This file can be downloaded here: https://drive.google.com/file/d/1YmDbwUB-5D5vGzc9vYEva8yLkTkwva8r/view?usp=sharing
1
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1YmDbwUB-5D5vGzc9vYEva8yLkTkwva8r' -O SONs_genesis.json
Copied!
Move the genesis.json file to the root of the project directory alongside the witness_node binary.
Inside config.ini, specify the genesis.json
1
genesis-json = SONs_genesis.json
Copied!
Start the witness_node and the blocks should start syncing.
1
./witness_node --gensis-file SONs_genesis.json
Copied!
If blocks have already been seeded during the initial startup, it may be necessary to reset the blockchain and p2p directories. Removing them is fine for this case.
1
rm -rf witness_node_data_dir/blockchain
2
rm -rf witness_node_data_dir/p2p
Copied!
At this point you will be able download a copy of the blockchain. Additional steps are required to run the cli_wallet and also become a SON.

SON configuration

Prerequisites

  • Your node is up and running and synced with the network.
  • You have access to a bitcoin node, with RPC and ZMQ notifications enabled
  • You have access to shared wallet used by all SONs (prerelease requirement only)

Configuration files

SON plugin is controlled by following parameters
1
peerplays_sidechain plugin. <no description>
2
Options:
3
--son-id arg ID of SON controlled by this node (e.g.
4
"1.27.5", quotes are required)
5
--son-ids arg IDs of multiple SONs controlled by this
6
node (e.g. ["1.27.5", "1.27.6"], quotes
7
are required)
8
--peerplays-private-key arg (=["TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"])
9
Tuple of [PublicKey, WIF private key]
10
(may specify multiple times)
11
--bitcoin-node-ip arg (=99.79.189.95) IP address of Bitcoin node
12
--bitcoin-node-zmq-port arg (=11111) ZMQ port of Bitcoin node
13
--bitcoin-node-rpc-port arg (=22222) RPC port of Bitcoin node
14
--bitcoin-node-rpc-user arg (=1) Bitcoin RPC user
15
--bitcoin-node-rpc-password arg (=1) Bitcoin RPC password
16
--bitcoin-wallet arg Bitcoin wallet
17
--bitcoin-wallet-password arg Bitcoin wallet password
18
--bitcoin-private-key arg (=["02d0f137e717fb3aab7aff99904001d49a0a636c5e1342f8927a4ba2eaee8e9772","cVN31uC9sTEr392DLVUEjrtMgLA8Yb3fpYmTRj7bomTm6nn2ANPr"])
19
Tuple of [Bitcoin public key, Bitcoin
20
private key] (may specify multiple
21
times)
Copied!
These parameters are available from both command line and config file:
Edit add the following to your config.ini file
1
# ==============================================================================
2
# peerplays_sidechain plugin options
3
# ==============================================================================
4
5
# ID of SON controlled by this node (e.g. "1.27.5", quotes are required)
6
son-id = "1.27.0"
7
8
# IDs of multiple SONs controlled by this node (e.g. ["1.27.5", "1.27.6"], quotes are required)
9
son-ids = []
10
11
# Tuple of [PublicKey, WIF private key]
12
peerplays-private-key = ["TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
13
14
# IP address of Bitcoin node
15
bitcoin-node-ip = 99.79.189.95
16
17
# ZMQ port of Bitcoin node
18
bitcoin-node-zmq-port = 11111
19
20
# RPC port of Bitcoin node
21
bitcoin-node-rpc-port = 22222
22
23
# Bitcoin RPC user
24
bitcoin-node-rpc-user = 1
25
26
# Bitcoin RPC password
27
bitcoin-node-rpc-password = 1
28
29
# Bitcoin wallet
30
bitcoin-wallet = son-wallet
31
32
# Bitcoin wallet password
33
bitcoin-wallet-password = 9da115c9fa6fe7fd09390841ac91aee4
34
35
# Tuple of [Bitcoin public key, Bitcoin private key] (may specify multiple times)
36
bitcoin-private-key = ["02d0f137e717fb3aab7aff99904001d49a0a636c5e1342f8927a4ba2eaee8e9772","cVN31uC9sTEr392DLVUEjrtMgLA8Yb3fpYmTRj7bomTm6nn2ANPr"]
Copied!

Edit the config file and add the RPC port

1
# Endpoint for websocket RPC to listen on
2
rpc-endpoint = 127.0.0.1:8090
Copied!

Becoming a SON

Becoming a SON is very similar to becoming a witness. You will need:
  • Active user account, upgraded to lifetime member, which will be the owner of SON account
  • Create two vesting balances (types son and normal) of 50 core assets, and get its IDs
  • Create Bitcoin address for SON account in shared SON wallet
  • Create SON account, and get its ID
  • Set the signing key for a son account (usually, its a signing key of owner account)
  • Set the bitcoin address as a sidechain address for a SON account
  • Update your config file with values obtained in previous steps, and restart the witness with peerplays_sidechain plugin enabled
Example:
1
# ================================================================================
2
# Active user account, upgraded to lifetime member, which will be the owner of SON account
3
unlocked >>> get_account account07
4
get_account account07
5
{
6
"id": "1.2.58",
7
"membership_expiration_date": "2106-02-07T06:28:15",
8
"registrar": "1.2.58",
9
"referrer": "1.2.58",
10
"lifetime_referrer": "1.2.58",
11
"network_fee_percentage": 2000,
12
"lifetime_referrer_fee_percentage": 8000,
13
"referrer_rewards_percentage": 0,
14
"name": "account07",
15
"owner": {
16
"weight_threshold": 1,
17
"account_auths": [],
18
"key_auths": [[
19
"TEST86obxk1fqh8cmDkRdgyVkzHtcmqcByva7tk9DYAjCpLPkxqeCC",
20
1
21
]
22
],
23
"address_auths": []
24
},
25
"active": {
26
"weight_threshold": 1,
27
"account_auths": [],
28
"key_auths": [[
29
"TEST7SUmjftH3jL5L1YCTdMo1hk5qpZrhbo4MW6N2wWyQpjXkT7ByB",
30
1
31
]
32
],
33
"address_auths": []
34
},
35
...
36
}
37
# ================================================================================
38
39
# ================================================================================
40
# Create two vesting balances (types son and normal) of 50 core assets, and get its IDs
41
unlocked >>> create_vesting_balance account07 50 TEST son true
42
create_vesting_balance account07 50 TEST son true
43
{
44
"ref_block_num": 3977,
45
"ref_block_prefix": 145563165,
46
"expiration": "2020-03-13T17:08:45",
47
"operations": [[
48
32,{
49
...
50
}
51
52
unlocked >>> create_vesting_balance account07 50 TEST normal true
53
create_vesting_balance account07 50 TEST normal true
54
{
55
"ref_block_num": 3979,
56
"ref_block_prefix": 1838302122,
57
"expiration": "2020-03-13T17:08:51",
58
"operations": [[
59
32,{
60
...
61
}
62
63
unlocked >>> get_vesting_balances account07
64
get_vesting_balances account07
65
[{
66
"id": "1.13.79",
67
"owner": "1.2.58",
68
...
69
},{
70
"id": "1.13.80",
71
"owner": "1.2.58",
72
...
73
}
74
]
75
# ================================================================================
76
77
# ================================================================================
78
# Create Bitcoin address for SON account in shared SON wallet
79
bitcoin-core.cli -rpcconnect=99.79.189.95 -rpcport=22222 -rpcuser=1 -rpcpassword=1 -rpcwallet="son-wallet" getnewaddress
80
2NCGVYMNjSSwYrxGAFv53WQP6i7xu8XHEVn
81
82
bitcoin-core.cli -rpcconnect=99.79.189.95 -rpcport=22222 -rpcuser=1 -rpcpassword=1 -rpcwallet="son-wallet" walletpassphrase 9da115c9fa6fe7fd09390841ac91aee4 60
83
84
bitcoin-core.cli -rpcconnect=99.79.189.95 -rpcport=22222 -rpcuser=1 -rpcpassword=1 -rpcwallet="son-wallet" dumpprivkey 2NCGVYMNjSSwYrxGAFv53WQP6i7xu8XHEVn
85
cSmQ517iJaAT94SMAsLhtyicZcFggY54gg5aLCUDuwUA3ECftP24
86
87
bitcoin-core.cli -rpcconnect=99.79.189.95 -rpcport=22222 -rpcuser=1 -rpcpassword=1 -rpcwallet="son-wallet" getaddressinfo 2NCGVYMNjSSwYrxGAFv53WQP6i7xu8XHEVn
88
{
89
"address": "2NCGVYMNjSSwYrxGAFv53WQP6i7xu8XHEVn",
90
"scriptPubKey": "a914d0a7c9ec2c89c67df9c1d8dce8d786ec9a0afcac87",
91
"ismine": true,
92
"solvable": true,
93
"desc": "sh(wpkh([c9cc7580/0'/0'/3']03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2))#4g9d62sg",
94
"iswatchonly": false,
95
"isscript": true,
96
"iswitness": false,
97
"script": "witness_v0_keyhash",
98
"hex": "0014d244cd683056c918a4d8f5cb1adce7a86558e253",
99
"pubkey": "03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2",
100
...
101
}
102
# ================================================================================
103
104
# ================================================================================
105
# Create SON account, and get its ID
106
unlocked >>> create_son account07 "http://www.account07.com" 1.13.79 1.13.80 [[bitcoin, 03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2]] true
107
create_son account07 "http://www.account07.com" 1.13.79 1.13.80 [[bitcoin, 03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2]] true
108
{
109
"ref_block_num": 4171,
110
"ref_block_prefix": 2156837961,
111
"expiration": "2020-03-13T17:20:06",
112
"operations": [[
113
82,{
114
"fee": {
115
"amount": 0,
116
"asset_id": "1.3.0"
117
},
118
"owner_account": "1.2.58",
119
"url": "http://www.account07.com",
120
"deposit": "1.13.79",
121
"signing_key": "TEST71FaAsTFbKyoGM7USqzS9uG78jjRv7wJnTytxyXr7CTnrHeAHJ",
122
"sidechain_public_keys": [[
123
"bitcoin",
124
"03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2"
125
]
126
],
127
"pay_vb": "1.13.80"
128
}
129
]
130
],
131
"extensions": [],
132
"signatures": [
133
"1f03b014fadc66110bef63125967a93da577cdd598ca8a1ffebf36b7e21fdfc3b85587e7f3e5604b336c6fc0dd3ab3d109022c1996b77a13a374349ecc9e1e1fdd"
134
]
135
}
136
137
unlocked >>> get_son account07
138
get_son account07
139
{
140
"id": "1.27.16",
141
"son_account": "1.2.58",
142
"vote_id": "3:54",
143
"total_votes": 0,
144
"url": "http://www.account07.com",
145
"deposit": "1.13.79",
146
"signing_key": "TEST71FaAsTFbKyoGM7USqzS9uG78jjRv7wJnTytxyXr7CTnrHeAHJ",
147
"pay_vb": "1.13.80",
148
"statistics": "2.24.16",
149
"status": "inactive",
150
"sidechain_public_keys": [[
151
"bitcoin",
152
"03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2"
153
]
154
]
155
}
156
# ================================================================================
157
158
# ================================================================================
159
# Set the signing key for a son account (usually, its a signing key of owner account)
160
# Set the bitcoin address as a sidechain address for a SON account
161
162
unlocked >>> get_private_key TEST7SUmjftH3jL5L1YCTdMo1hk5qpZrhbo4MW6N2wWyQpjXkT7ByB
163
get_private_key TEST7SUmjftH3jL5L1YCTdMo1hk5qpZrhbo4MW6N2wWyQpjXkT7ByB
164
"5JKvPJkerMNVEubsbKN8Xd8wGaU1ifhv7xAwy9gFJP6yMEoTkSd"
165
166
unlocked >>> update_son account07 "" "TEST7SUmjftH3jL5L1YCTdMo1hk5qpZrhbo4MW6N2wWyQpjXkT7ByB" [[bitcoin, 03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2]] true
167
update_son account07 "" "TEST7SUmjftH3jL5L1YCTdMo1hk5qpZrhbo4MW6N2wWyQpjXkT7ByB" [[bitcoin, 03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2]] true
168
{
169
"ref_block_num": 4210,
170
"ref_block_prefix": 4294628244,
171
"expiration": "2020-03-13T17:22:21",
172
"operations": [[
173
83,{
174
"fee": {
175
"amount": 0,
176
"asset_id": "1.3.0"
177
},
178
"son_id": "1.27.16",
179
"owner_account": "1.2.58",
180
"new_signing_key": "TEST7SUmjftH3jL5L1YCTdMo1hk5qpZrhbo4MW6N2wWyQpjXkT7ByB",
181
"new_sidechain_public_keys": [[
182
"bitcoin",
183
"03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2"
184
]
185
]
186
}
187
]
188
],
189
"extensions": [],
190
"signatures": [
191
"1f43fccecb7994fbb6138fd85ccb1b462d4ffeaa696cbe0738e0a3eaf99d1eb65c4c8e995db5c39a293d8f3056757ab199eb8b99a2972b0a9b56057e875ea4c790"
192
]
193
}
194
# ================================================================================
195
196
# ================================================================================
197
# Update your config file with values obtained in previous steps, and restart the witness with peerplays_sidechain plugin enabled
198
# ================================================================================
199
200
# Open your config file, and find options plugins
201
202
# Space-separated list of plugins to activate
203
plugins = witness account_history market_history accounts_list affiliate_stats bookie
204
205
# Update the line, and add peerplays_sidechain to the list of enabled plugins
206
207
# Space-separated list of plugins to activate
208
plugins = witness account_history market_history accounts_list affiliate_stats bookie peerplays_sidechain
209
210
211
# Set son-id parameter to the ID of your SON
212
son-id = "1.27.16"
213
214
# Set son-ids parameter to empty array
215
son-ids = []
216
217
# Set peerplays-private-key to the key pair belonging to the SON owner account
218
peerplays-private-key = ["TEST6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"]
219
220
# Leave default value
221
bitcoin-node-ip = 99.79.189.95
222
223
# Leave default value
224
bitcoin-node-zmq-port = 11111
225
226
# Leave default value
227
bitcoin-node-rpc-port = 22222
228
229
# Leave default value
230
bitcoin-node-rpc-user = 1
231
232
# Leave default value
233
bitcoin-node-rpc-password = 1
234
235
# Leave default value
236
bitcoin-wallet = son-wallet
237
238
# Leave default value
239
bitcoin-wallet-password = 9da115c9fa6fe7fd09390841ac91aee4
240
241
# Set bitcoin-private-key to the keypair of the bitcoin address you created for a SON in shared wallet
242
bitcoin-private-key = ["03eac07563aa5280a6c1db50724ffc51edca1458d3ed9a61c7455fb16f35ddccd2","cSmQ517iJaAT94SMAsLhtyicZcFggY54gg5aLCUDuwUA3ECftP24"]
243
244
# Restat the node with new configuration
Copied!

Starting the node

1
witness_node
2
# If you need the logs, the following can be helpful
3
# witness_node 2>&1 peerplays.log
Copied!

Using the CLI wallet

In the terminal execute the CLI wallet:
1
# In the local terminal
2
./cli_wallet
Copied!
If an exception is thrown and contains Remote server gave us an unexpected chain_id, then copy the remote_chain_id that is provided by it.
Pass the chain ID to the CLI wallet:
1
# In the local terminal
2
./cli_wallet --chain-id=<CHAIN-ID>
Copied!
There is optionally a flag that can be passed in to connect to a remote rpc endpoint.
1
./cli_wallet --server-rpc-endpoint ws://96.46.49.3:8090 -u '' -p ''
Copied!
Enter a password for the CLI wallet:
1
# In the CLI wallet
2
set_password <YOUR-WALLET-PASSWORD>
Copied!
Unlock the CLI wallet by providing the password set earlier:
1
# In the CLI wallet
2
unlock <YOUR-WALLET-PASSWORD>
Copied!
The CLI wallet will show unlocked >>> when successfully unlocked
The CLI wallet is now ready to be used.

Creating a Peerplays account

Use the CLI wallet to suggest a brain key:
1
# In the CLI wallet
2
suggest_brain_key
Copied!
Make sure to backup the information that is output
Create an account using the brain key generated:
1
# In the CLI wallet
2
create_account_with_brain_key <BRAIN-KEY> <YOUR-ACCOUNT-NAME> nathan nathan true
Copied!