Hub-Layer node build

Server Environment

OS
Linux
CPU
2 Core / 1.8GHz / x86_64 or ARM
RAM
RAM: 8GB DISK: 100GB SSD
Network
100Mbps
10,000,000 OAS is required to validate the Hub-Layer node.

Firewall Settings

  • TCP/UDP port 30303 allowed (for P2P between nodes)
  • TCP port 8545 allowed (for RPC)

Validator Build Steps

  1. 1.
    Download the Oasys geth binary from github and place it in any directory (e.g. /usr/local/bin). (Or build it according to README.md)
  2. 2.
    Create an OS user to be used by geth.
1
$ sudo useradd -s /sbin/nologin geth
2
$ sudo mkdir /home/geth
3
$ sudo chown geth:geth /home/geth
4
$ sudo chmod 700 /home/geth
Copied!
3. Download the configuration file for the genesis block from github.
1
$ wget https://github.com/oasysgames/oasys-validator/releases/download/v1.0.0-alpha2/genesis.zip
2
3
$ unzip genesis.zip
4
Archive: genesis.zip
5
creating: genesis/
6
inflating: genesis/mainnet.json
7
inflating: genesis/testnet.json
8
9
$ mv genesis/{target network}.json /home/geth/genesis.json
Copied!
4. Create a genesis block.
1
$ sudo -u geth geth init /home/geth/genesis.json
Copied!
The following will be output.
1
INFO [03-14|12:07:35.106] Maximum peer count ETH=50 LES=0 total=50
2
INFO [03-14|12:07:35.106] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
3
INFO [03-14|12:07:35.107] Set global gas cap cap=50,000,000
4
INFO [03-14|12:07:35.107] Allocated cache and file handles database=/home/geth/.ethereum/geth/chaindata cache=16.00MiB handles=16
5
INFO [03-14|12:07:35.115] Writing custom genesis block
6
INFO [03-14|12:07:35.115] Persisted trie from memory database nodes=5 size=743.00B time="42.208µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
7
INFO [03-14|12:07:35.115] Successfully wrote genesis state database=chaindata hash=f63988..28bcdc
8
INFO [03-14|12:07:35.115] Allocated cache and file handles database=/home/geth/.ethereum/geth/lightchaindata cache=16.00MiB handles=16
9
INFO [03-14|12:07:35.121] Writing custom genesis block
10
INFO [03-14|12:07:35.122] Persisted trie from memory database nodes=5 size=743.00B time="30.833µs" gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
11
INFO [03-14|12:07:35.122] Successfully wrote genesis state database=lightchaindata hash=f63988..28bcdc
12
INFO [03-14|12:07:35.106] Maximum peer count ETH=50 LES=0 total=50 INFO [03-14|12
Copied!
5. Save bootstrap node configuration to /home/geth/.ethereum/geth/static-nodes.json
1
# For mainnet
2
[ "enode://093c363d9fa759b58cb0a59d8ca664b4b4981873dc0305b113edf6d0c865089ed[email protected]35.73.174.118:30303" ]
3
4
# For testnet
5
[ "enode://4a85df39ec500acd31d4b9feeea1d024afee5e8df4bc29325c2abf2e0a02a34f6[email protected]35.77.156.6:30303" ]
Copied!
6. Creates a secret key to be used by geth.
1
$ sudo -u geth geth account new
Copied!
The following will be output.
1
INFO [03-14|12:10:46.047] Maximum peer count ETH=50 LES=0 total=50
2
INFO [03-14|12:10:46.047] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory"
3
Your new account is locked with a password. Please give a password. Do not forget this password.
4
Password:
5
Repeat password:
6
7
Your new key was generated
8
9
Public address of the key: 0xabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd
10
Path of the secret key file: /home/geth/.ethereum/keystore/UTC--2022-03-14T12-11-06.835917424Z--abcdabcdabcdabcdabcdabcdabcdabcdabcdabcd
11
12
- You can share your public address with anyone. Others need it to interact with you.
13
- You must NEVER share the secret key with anyone! The key controls access to your funds!
14
- You must BACKUP your key file! Without the key, it's impossible to access account funds!
15
- You must REMEMBER your password! Without the password, it's impossible to decrypt the key!
Copied!
Important: Keep the secret key and password in a safe place.
7. Save the secret key password to a text file.
1
$ vi /home/geth/.ethereum/password.txt
Copied!
8. Start geth. For YOUR_ACCOUNT_ADDRES, use the secret key address you just created.
1
# For mainnet
2
$ export NETWORK_ID=248
3
4
# For testnet
5
$ export NETWORK_ID=9372
6
7
$ sudo -u geth geth \
8
--networkid $NETWORK_ID \
9
--syncmode full --gcmode archive \
10
--mine --miner.gaslimit 30000000 \
11
--allow-insecure-unlock --unlock {YOUR_ACCOUNT_ADDRESS} \
12
--password /home/geth/.ethereum/password.txt \
13
--http --http.addr 0.0.0.0 --http.port 8545 \
14
--http.vhosts '*' --http.corsdomain '*' \
15
--http.api net,eth,web3
Copied!
9. Immediately after startup, the block synchronization process takes place. The progress of synchronization can be checked with the following command.
1
$ sudo -u geth geth attach ipc:/home/geth/.ethereum/geth.ipc --exec eth.syncing
2
{
3
currentBlock: 34559,
4
highestBlock: 203190,
5
knownStates: 0,
6
pulledStates: 0,
7
startingBlock: 0
8
}
Copied!
Synchronization is complete when the output changes to false.
1
$ sudo -u geth geth attach ipc:/home/geth/.ethereum/geth.ipc --exec eth.syncing
2
false
Copied!