Introduction
Welcome to the GHOST TestNet 2.0 Launch guide. In TestNet 1.0 only 2 nodes ran at any one point in time. One node was Alice and another was Bob. The main goal with TestNet 2.0 is to create blockchain that has as many nodes as possible running 24/7 from as many geographical locations as possible. TestNet 2.0 nodes that have participated in the genesis block will receive some $CSPR coin for future testing that may or may not include send/receive and staking functionality.
Prerequisites
Before you can proceed with launching you GHOST Node please make sure to go though the following guide:
- GHOST Chain Startup Guide – create the proper environment and install GHOST Chain.
- Generating Keys & Applying for Genesis Block – generate GHOST Node keys and apply for TestNet genesis block.
- Testing Connectivity Guide – test whether or not you node can become a Boot Node and set proper firewall rules.
Launching GHOST TestNet 2.0
Start your GHOST Node and go to ghost-node
directory:
cd ghost/ghost-node
Switch to main GIT branch:
git switch main
Make sure ghost-node
is up to date:
git pull origin main
Fetch all git branch heads:
git fetch --tags
Navigate to the current Git branch:
git checkout v0.0.2
Recompile ghost-node
using starter.sh
:
./scripts/starter.sh --release
The default option is capitalized which is N
, you can also press Enter to choose the default option. In this case we want to recompile so type y
and press Enter to proceed:
'cargo build --release ' is what you want? [y/N]:
Make ghost-node service
being able to be started by default user:
./scripts/starter.sh --make-global
Next we must set up the ghost-node
launch command by setting arguments using --set-arguments
flag:
./scripts/starter.sh --set-arguments
Only change the defaults if you are advanced otherwise press Enter for the following prompts.
If this is your first node simply press Enter to proceed with the default. If this is your second node you should type a different port here, for example 30334
, and then you should open this port on your firewall and create a dedicated port forwarding rule on your router:
specify p2p protocol TCP port (default: 30333):
To choose default options press Enter here:
specify JSON-RPC server TCP port: (default: 9945):
specify the chain specification (default: /etc/ghost/casper.json):
specify node's secret key file for p2p networking (default: /etc/ghost/node-key):
specify name for the node (default: RANDOM_NAME):
Validator Mode vs Node Operator Mode
Currently you have to qualify to become a validator through GHOST Whales. If you were NOT included in the ghosties file then you cannot be a validator and you can only be a node operator so for disable validator mode? [y/N]
type y
. If you were included in the ghosties file the you can press Enter:
disable validator mode? [y/N]: y
You can press Enter here:
enable prometheus? [y/N]:
Boot Node
For the following prompt:
list of bootnodes if any:
Paste one of the following Boot Node address:
/dns/bootnode69.chain.ghostchain.io/tcp/30333/p2p/12D3KooWF9SWxz9dmy6vfndQhoxqCa7PESaoFWEiF8Jkqh4xKDRf
Now you check whether or not the keys on your GHOST Node match those in the ghosties file
on GHOST Git. If you did not follow the Generating Keys Guide this command will return errors:
./scripts/starter.sh --check-keys
If you have followed Generating Keys Guide these should contain default paths so press Enter:
[?] path to the file with wallet key: (default: /etc/ghost/wallet-key)
[?] path to the file with stash key: (default: /etc/ghost/stash-key)
[?] path to the file with session key: (default: /etc/ghost/session-key)
After going through the whole --check-keys
flag your screen should look something like this:
Create running ghost-node
service that starts on system boot:
./scripts/starter.sh --unit-file
Changing unit-file
name is optional, otherwise press Enter:
[?] name for the unit file (default: ghost-node.service)
IF ERROR and [!] user ghost not found
pops up press y
:
[!] user ghost not found
[?] do you want to create ghost user? (NOT RECOMMENDED: current root) [y/N]:
[+] make ghost owner of /var/lib/ghost
[+] prepare unit file for the ghost-node.service
[+] reloading systemd because of updated unit file
To start and enable ghost-node.service
type y
:
[?] do you want to start the ghost-node.service? [y/N]:
[?] do you want to enable the ghost-node.service? [y/N]:
[+] execution finished
In order to insert keys run the following flags --check-keys --insert-keys
:
./scripts/starter.sh --check-keys --insert-keys
Restart ghost-node
:
sudo systemctl restart ghost-node
To see the logs produced by your ghost-node
:
journalctl -f -u ghost-node
To exit journalctl -f -u ghost-node
Press CTRL+C.
Congratulations! You have an operational GHOST Node.
Troubleshooting
For future troubleshooting be aware of the following commands:
To soft reload the entire system:
sudo systemctl daemon-reload
To stop ghost-node
:
sudo systemctl stop ghost-node
To restart ghost-node
:
sudo systemctl restart ghost-node
To see the logs produced by your ghost-node
:
journalctl -f -u ghost-node
To delete old ledger:
sudo systemctl stop ghost-node
sudo rm -rf /var/lib/ghost
./scripts/starter.sh --unit-file
sudo systemctl start ghost-node
To check session keys:
./scripts/starter.sh --check-keys --insert-keys
sudo ls -l /var/lib/ghost/chains/casper_staging_testnet/keystore/
sudo systemctl restart ghost-node.service