Create BTY parent Blockchain

2022-1-5

# Create BTY parent Blockchain

BTY is a simple and stable public blockchain with strong scalability. By default, the developer can explore on existing nodes of parent blockchain as long as all datas from parachain are written to parent blockchain. However, continuously exploring and development on existing parent blockchain nodes may reduce the system performence. Thus, we suggest that developers can create a node on parent blockchain autonomously, and build parachain on the new node.

# Get parent blockchain installation package

  1. Two ways to get parent blockchain installation package:

    • Download from github [https://github.com/bityuan/bityuan/releases], we offer MAC version, Windows version, Linux version.
    • Download Bityuan program and configuration files from BTY node servers.
    Download bityuan program:wget http://122.9.98.227/data/ubuntu/bityuan
    Download cli program:wget http://122.9.98.227/data/ubuntu/bityuan-cli
    Download configuration files:wget http://122.9.98.227/data/ubuntu/bityuan.toml 
    
    1
    2
    3
  2. Grant executable permission

chmod +x ./bityuan bityuan-cli bityuan.toml
1

# Revise configuration files

Revise the following parameter in bityuan.toml based on the situation:

[rpc]
Delete "localhost" for jsonrpc address and grpc address. The whitelist on parent blockchain only allows access from local address, please revise to your network based on the situation. 
jrpcBindAddr="localhost:8801"
grpcBindAddr="localhost:8802"
whitelist=["127.0.0.1"]
1
2
3
4
5

# Start nodes

  1. To start nodes, under the path of Bityuan program and configuration file, run the following command(nohup ./bityuan -f bityuan.toml &)
nohup ./bityuan -f bityuan.toml &
1
  1. Run the command(./bityuan-cli net peer), check the info of parent blockchain node. The information of newly added node, by default, is printed at the end.
./bityuan-cli net peer
1

Returned log is as follows:

{
    "addr": "123.***.***.253",
    "port": 13803,
    "name": "16Uiu2HAmBgc59hyLHMGBCEFm4ETMamzTwjuL*****mo6jt8EBnEB",
    "mempoolSize": 0,
    "self": true,
    "header": {
        "version": 0,
        "parentHash": "0xfe6b884b7f82ffcea4ae43f*****674022b19db736d4a7d09a1683",
        "txHash": "0xd67bc4d2f23f579f1c5a9e92*****07c6aa458fe14c8771ce2f06",
        "stateHash": "0x1c954d5b22ea6f006597e*****c507e0f8844372f2c996b61f0f93",
        "height": 0,
        "blockTime": 1635***972,
        "txCount": 8,
        "hash": "0x4ed74981efd76ef6f3ad8ce8*****0435613df14f4d2a6c6f449e",
        "difficulty": 0
     },
    "version": "1.65.2-dd28ef5d@6.5.3",
    "runningTime": "2.842 minues"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

# Node synchronization

So far, the block height of BTY exceeds 17,000,000, it takes really long time for node automatic syncing. You can download synced data to save syncing time. Since the task in process cannot be interruptted during downloading, you can install a Tmux tool. It can help to keep things running persistently on servers within a long downloading.

  1. Install Tmux tool
sudo yum install tmux
1
  1. Enter Tmux window tmux

  2. Download synced data wget http://122.9.98.227/data/datadir.zip

  3. Unzip files unzip datadir.zip

PS: Although the process can save syncing time, it still takes pretty long time for download and subsequent synchronization.