| order | 1 |
|---|
In Vite network, nodes are categorized into full nodes and supernodes. Supernode is special full nodes for producing snapshot blocks. This document mainly introduces full node.
Full node is responsible for maintaining a complete copy of ledger, sending or receiving transactions, and verifying all transactions in the network. Full node can also participate in SBP election and voting. Full node exposes HTTP/WEBSOCKET APIs externally and has a command line console at local.
Gvite supports installation from binary or source code
| OS | ubuntu | mac | windows |
|---|---|---|---|
| {{$page.version}} | Yes | Yes | Yes |
Download latest gvite installation package at gvite Releases in command line then install
## Download
curl -L -O https://github.com/vitelabs/go-vite/releases/download/${version}/gvite-${version}-linux.tar.gz## Unpack package
tar -xzvf gvite-${version}-linux.tar.gz## Enter the folder extracted. It should have three files: gvite, bootstrap and node_config.json
cd gvite-${version}-linux## Boot up gvite node
./bootstrap
Check the content of gvite.log in the same folder to determine whether the program is up and running.
tail -100f gvite.logThe following messages indicate boot is successful.
t=2018-11-09T17:44:48+0800 lvl=info msg=NodeServer.DataDir:/home/ubuntu/.gvite/maindata module=gvite/node_manager
t=2018-11-09T17:44:48+0800 lvl=info msg=NodeServer.KeyStoreDir:/home/ubuntu/.gvite/maindata/wallet module=gvite/node_manager
Prepare the Node success!!!
Start the Node success!!!## Download
curl -L -O https://github.com/vitelabs/go-vite/releases/download/${version}/gvite-${version}-darwin.tar.gz
## Unpack package
tar -xzvf gvite-${version}-darwin.tar.gz
## Enter the folder extracted. It should have three files: gvite, bootstrap and node_config.json
cd gvite-${version}-darwin
## Boot up gvite node
./bootstrapCheck the content of gvite.log in the same folder to determine whether the program is up and running.
cat gvite.logThe following messages indicate boot is successful.
t=2018-11-09T17:44:48+0800 lvl=info msg=NodeServer.DataDir:~/Library/GVite/maindata module=gvite/node_manager
t=2018-11-09T17:44:48+0800 lvl=info msg=NodeServer.KeyStoreDir:~/Library/GVite/maindata/wallet module=gvite/node_manager
Prepare the Node success!!!
Start the Node success!!!Open up your preferred browser and paste in the following link:
https://github.com/vitelabs/go-vite/releases/download/${version}/gvite-${version}-windows.tar.gzand save file to preferred directory. Upon download completion, open up explorer, navigate to the directory where file is downloaded to, right click file and select extract file option.
Extracted destination should contain three files:
gvite-windows-386.exe (32bit executable)
gvite-windows-amd64.exe (64bit executable)
node_config.json (node config file).
The folder contains the command .exe files and can be used without installing.
Configure node_config.json prior to launching executable (use the 32bit executable if you have a 32bit CPU or 64bit executable if you have a 64bit CPU).
To launch node, simply open up command prompt (by pressing Win + R, then, type cmd and press Enter or click/tap OK.)
Then in command prompt:
C:\Users\user>d:
D:\>cd gvite-${version}-windows
D:\gvite-${version}-windows>gvite-windows-amd64.exe (or your preferred executable)
The following messages indicate boot is successful.
INFO[11-21|09:28:42] NodeServer.DataDir:C:\Users\user\AppData\Roaming\GVite\maindata module=gvite/node_manager
INFO[11-21|09:28:42] NodeServer.KeyStoreDir:C:\Users\user\AppData\Roaming\GVite\maindata\wallet module=gvite/node_manager
Prepare the Node success!!!
Start the Node success!!!Installation Directory:Refers to the folder where gvite boot script and configuration file are located. For example, ~/gvite-${version}-${os} is an installation directory.
gvite: Gvite executable filebootstrap: Boot scriptnode_config.json: Configuration file. See Configuration Description
The default ports are 8483/8484. If you choose to go with default ports, please ensure that they are not occupied by other programs or blocked by firewall.
netstat -nlp|grep 8483 Check if the default ports are occupied. Gvite will display the following messages if it boots up successfully.
netstat -nlp|grep 8483
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 0 0 :::8483 :::* LISTEN 22821/gvite
udp6 0 0 :::8483 :::* 22821/gvitecd ~/.gvite/maindataGvite working directory, containing sub-directories/files such as "ledger", "ledger_files", "LOCK", "p2p", "rpclog", "runlog" and "wallet".
ledger: Ledger directoryrpclog: RPC log directoryrunlog: Run-time log directorywallet: Wallet keystore directory for storing keystore files that secure private keys. Do remember KEEP YOUR PRIVATE KEY SAFE.
go env
:::warning Go 1.11.1 or above version is required. See Go Installation Guide. :::
Pull gvite source code
go get github.com/vitelabs/go-vite
and will be downloaded at:
$GOPATH/src/github.com/vitelabs/go-vite/
The system default GOPATH is ~/go
Go to the source code directory and run
make gvite
Executable file is generated at:
$GOPATH/src/github.com/vitelabs/go-vite/build/cmd/gvite/gvite
node_config.json is gvite configuration file. It should reside in the same directory with gvite executables. Details can be found at: Config Description
Taking Linux as example, the script has the following content:
nohup ./gvite -pprof >> gvite.log 2>&1 &
-
Start a full node as instructed above
-
Connect to gvite command line console: Navigate to Full Node Installation Directory and execute the following command
Linux/Unix:
./gvite rpc ~/.gvite/maindata/gvite.ipc ledger_getSnapshotChainHeightWindows:
gvite-windows-amd64.exe rpc \\.\pipe\gvite.ipc ledger_getSnapshotChainHeight
The following result will be displayed:
"{\"id\":0,\"jsonrpc\":\"2.0\",\"result\":\"51821203\"}"51821203 is current block height.
-
For more information please run command
vite.help.
In Vite, rewards will be distributed to full node owners as incentives.
Additional settings in node_config.json are required:
- Set full node stats URL:
"DashboardTargetURL": "wss://stats.vite.net" - Add "dashboard" to
PublicModules - Set
"RewardAddr": "${your_address}"to receive full node reward
The modified part of node_config.json is as below(please note this is not the full config file):
"PublicModules": [
"ledger",
"public_onroad",
"net",
"contract",
"pledge",
"register",
"vote",
"mintage",
"consensusGroup",
"tx",
"dashboard" // new add
],
"DashboardTargetURL":"wss://stats.vite.net", // new add
"RewardAddr":"vite_youraddress" // new add
Reboot full node, then visit Vite Explorer to examine if your node has shown up correctly (result will reflect in 5 minutes). Scroll to filter box and input your node name from above.