• 255892

    Last Block

  • 93

    Max TPS

  • 63581

    Daily TX

  • 5

    Daily Active Account

APEX BLOCKCHAIN DEPLOYMENT DOCUMENTATION

Tip: This deployment document is only used to deploy your own APEX Network private chain and cannot connect to the current official test main network.

1.Hardware Requirements

CPU:4 cores, 2.5GHz or above

RAM:8G or above

HARD DISK:512G SSD or above

NETWORK:Need to have public IP and access P2P port and RPC port set in the program configuration file

2. Software environment

2.1. Operating system

Ubuntu 16.04 or above

2.2. System software

2.2.1. Java8

Recommended version:java version "1.8.0_181"

Test if the installation is successful.

java -version

2.2.2.Git

Recommended version:git version 2.19.2.

Test if the installation is successful.

git --version

2.2.3.Gradle

Recommended version:Gradle 4.10.2

Test if the installation is successful.

gradle -v

3.System deployment

3.1.Compile application

1.Compile APEX blockchain

git clone https://github.com/APEX-Network/APEX-Blockchain-Core.git
cd APEX-Blockchain-Core
git checkout v0.9.0
gradle shadowJar

After the compilation is successful, the following directory can see the generated jar package.

APEX-Blockchain-Core /build/libs/APEX-Blockchain-Core-1.0-SNAPSHOT.jar

2.Compile CLI

Compile cli and compile the main chain to run in different working directories to avoid unknown errors.

git clone https://github.com/APEX-Network/APEX-Blockchain-CLI.git
cd APEX-Blockchain-CLI
mkdir libs

Copy the APEX-Blockchain-Core-1.0-SNAPSHOT.jar generated in the previous step to the APEX-Blockchain-CLI/libs directory.

gradle release

After the compilation is successful, the following directory can see the generated jar package.

APEX-Blockchain-CLI/build/libs/APEX-Blockchain-CLI-1.0-SNAPSHOT.jar

3.2.Configuration application

3.2.1.Configuration file path

The path to the configuration file is "APEX-Blockchain-Core/src/main/resources/settings.conf ". Some of the contents of the file need to be configured, see 3.2.2. The content of the red color should be replaced with the actual value.

3.2.2.Setting configuration file

1.Network configuration

(1)P2P address port:

bindAddress = "10.1.1.173:9084" 

(2)Other producer P2P address ports:

 known Peers = ["10.1.1.149:9084","10.1.1.150:9084","10.1.1.151:9084"]

2.Block reward configuration

minerAward = 16

Block Rewards all nodes must be configured identically, otherwise nodes will not be able to connect.

3.Genesis block configuration

In the configuration of Genesis block, all nodes in the whole network must be identical, otherwise they will be recognized as different chains and cannot be connected.
The timeStamp is the Genesis Block timestamp, must be UTC time, and must be greater than the main network startup time.

 genesis { 
timeStamp = "2018-10-29T00:00:00Z",
genesisCoinAirdrop = [
{
addr = "APEwS7ZiA4HNJAMznmjaupUtFLx73EhaGeS",
coins = 2.1
},
{
addr = "APLUf5g4YDghJTFZrkkLMjeZVkVDKxVMvW1",
coins = 3.2
}
]
}

4.RPC configuration

rpc {
enabled = true,
host = "localhost",
port = "8080"
}

5.Producer configuration

(1)Configure production interval:

produceInterval = 5000 

(2)Configure the number of continuous production blocks:

producerRepetitions = 6

(3)Configuring the producer public key private key pair

The configuration of all producers must be consistent, including the name, the configuration of the pubkey, and the order of the producers. Fill in your own private key and leave the other producer's private key blank.

initialWitness = [
{'name': 'node_1','pubkey': 'pubkey_node1','privkey':''},
{'name': 'node_2','pubkey': 'pubkey_node2','privkey':''},
{'name': 'node_thisProducer','pubkey': 'pubkey_thisProducer','privkey':'privkey_thisProducer'}
]

Case: If three nodes are configured, the configuration of the three nodes must be:
A node configuration:

initialWitness = [
{
'name': 'node_A',
'pubkey': '03975486a18185d5a88264b36a955458c69f6811802cec9995fe4cfe63808f3e28',
'privkey':'6c4cdf160e794cfd3116e3d616f81583a570404d9adcdac038edccb63124a768'
},
{
'name': 'node_B',
'pubkey': '02347373367384b2abf42e460b8c1f24981467f077323bc338b5deab04b24edf96',
'privkey':''
},
{
'name': 'node_C',
'pubkey': '023ca9c7a462381ac6e59ffd8e7b8e791940f6f4fdff085655432ae7ba0dd237d6',
'privkey':''
}
]

B node configuration:

initialWitness = [
{
'name': 'node_A',
'pubkey': '03975486a18185d5a88264b36a955458c69f6811802cec9995fe4cfe63808f3e28',
'privkey':''
},
{
'name': 'node_B',
'pubkey': '02347373367384b2abf42e460b8c1f24981467f077323bc338b5deab04b24edf96',
'privkey':'09e667bd75257b4888f66bcd18ced34ed641f8c86783c760b49ac573cc2a0969'
},
{
'name': 'node_C',
'pubkey': '023ca9c7a462381ac6e59ffd8e7b8e791940f6f4fdff085655432ae7ba0dd237d6',
'privkey':''
}
]

C node configuration:

initialWitness = [
{
'name': 'node_A',
'pubkey': '03975486a18185d5a88264b36a955458c69f6811802cec9995fe4cfe63808f3e28',
'privkey':''
},
{
'name': 'node_B',
'pubkey': '02347373367384b2abf42e460b8c1f24981467f077323bc338b5deab04b24edf96',
'privkey':''
},
{
'name': 'node_C',
'pubkey': '023ca9c7a462381ac6e59ffd8e7b8e791940f6f4fdff085655432ae7ba0dd237d6',
'privkey':'f5fdb694a1a64eb5f09a846406b5e36517615516d639080359c1f0a6d97257f9'
}
]

3.3.Launch application

1.Switch working directory

cd APEX-Blockchain-Core/build/libs

2.Create a database folder for the blockchain (This folder can be configured in the configuration file.)

mkdir test_net

3.Start the network

java -jar APEX-Blockchain-Core-1.0-SNAPSHOT.jar ../../src/main/resources/settings.conf

4.Start CLI

cd APEX-Blockchain-CLI/build/libs 
java -Djava.ext.dirs=./lib -jar APEX-Blockchain-CLI-1.0-SNAPSHOT.jar