Install Gmet

This document describes the configuration and build of gmet for installing the Metadium EN node. This installation process is only necessary if you build directly from the source code and not when using pre-built files from GitHub.

Download Source Code

The source code for go-metadium is publicly available on the Metadium GitHub, allowing everyone to access it. Download it as follows:

git clone https://github.com/METADIUM/go-metadium.git

Build Gmet

Gmet in Metadium supports rocksdb and leveldb, and building can be done by selecting each version using the USE_ROCKSDB option. Each version has a different format for the generated chain data, so it is essential to confirm the DB version to be used before proceeding.

Below is the command for building, written based on the Ubuntu operating system recommended by Metadium.

Dependency

sudo apt-get update
sudo apt-get install -y build-essential golang

Rocksdb only

sudo apt-get install -y libsnappy-dev libjemalloc-dev
cd /usr/lib/x86_64-linux-gnu/
sudo ln -sf libjemalloc.so.2 libjemalloc.so.1xx

Download source code

git clone https://github.com/METADIUM/go-metadium.git
cd go-metadium

Make-build (in case of rocksdb)

make USE_ROCKSDB=YES 

Make-build (in case of leveldb)

make USE_ROCKSDB=NO

Copy and untar "build" to $GMET_HOME

GMET_HOME='/opt/meta'
sudo mkdir -p $GMET_HOME 
sudo chown $USER:$USER $GMET_HOME
cp build/metadium.tar.gz $GMET_HOME/
cd $GMET_HOME 
tar xvzf metadium.tar.gz

Start gmet

$GMET_HOME/bin/gmet.sh start

Check log

tail -F $GMET_HOME/logs/log

If there are issues with library dependencies due to the build environment, it is recommended to use Docker for building, as shown below:

make USE_ROCKSDB=YES gmet-linux

Configuration

Once the build is complete, you can run the gmet node using the gmet.sh script. The gmet.sh script allows you to specify parameters for running the gmet node by creating a .rc configuration file, simplifying the process.

# vi $GMET_HOME/.rc 

PORT=8588 
DISCOVER=1        # 1 for enable discovery mode, 0 for disable discovery mode
TESTNET=1         # 1 for Testnet or remove this line for Mainnet
SYNC_MODE=full    # snap, full or archive 
GMET_OPTS="--maxpeers=100" # setup additional options

Last updated