Blockchain Technology

How to Set Up OMC Node

A full node is a program that fully validates transactions and blocks. By running it, you are supporting the OMC blockchain network to become more decentralised and fostering the growth of OMC Blockchain Technology.

Almost all full nodes also help the network by accepting transactions and blocks from other full nodes, validating those transactions and blocks, and then relaying them to further full nodes.

Most full nodes also serve lightweight clients by allowing them to transmit their transactions to the network and by notifying them when a transaction affects their wallet. If not enough nodes perform this function, clients won’t be able to connect through the peer-to-peer network—they’ll have to use centralized services instead.

Linux System

Open browser and enter https://dotnet.microsoft.com/download/linux-package-manager/rhel/runtime-2.1.11

Please select your operating system and follow the operation prompts to install .Net Core 2.1 Runtime as shown in the figure below:

Windows/Mac OS

Open browser and enter https://dotnet.microsoft.com/download/dotnet-core/2.1 As shown in the red box below, select the operating system to which it belongs, and click the corresponding hyperlink to download the installation file. After the download is complete, install it according to the standard installation operation of the system.

Download the Node Program

Open in browser https://github.com/omcdev/blockchain/releases/download/0.0.3/Node_V0.0.3.zip or https://onedrive.live.com/?authkey=%21AIJY8v0FWzmHAbA&id=A28FC3201AF2AC9A%211085&cid=A28FC3201AF2AC9A  or select the latest version as shown in the figure below and continue to click in. The current version is 0.0.3

Select node compressed package in zip format and download

Unzip the Node package to the folder of your choice, for example

  • D: \ OmcNode under Windows,
  • ~ / OmcNode under Linux.

Run Node Program

From the command line/terminal, cd into the folder where the Node program is located, and then run the command: dotnet OmniCoin.Node.dll

Running the above command under Linux may cause an error, the specific reason may be the lack of Leveldb environment. Please follow the steps below to install the Leveldb environment. After successful installation, return to the Node folder and run dotnet OmniCoin.Node.dll

If the operating system is Linux, you also need to manually install Leveldb.

Download Leveldb Source Code and Compile

cd ~ git clone https://github.com/google/leveldb.git cd leveldb cmake $PWD

If no error is reported during cmake compilation, Leveldb compilation and installation are successful.

Possible Problems with Ubuntu

Prompt “Command ‘cmake’ not found, but can be installed with: sudo apt install cmake”

Execute the command to install cmake from the root account:

apt install cmake

Non-root account execute command to install cmake:

sudo apt install cmake

Prompt cmake version is too low, you need to manually install cmake 3.9.1

Download and unzip the cmake 3.9.1 compressed package to the Home directory

cd ~ wget https://cmake.org/files/v3.9/cmake-3.9.1-Linux-x86_64.tar.gz tar -zxvf cmake-3.9.1-Linux-x86_64.tar.gz

Add ~ / cmake-3.9.1-Linux-x86_64 / bin to the environment variable of the shell (default bash)

Add the path of cmake bin folder to the last line, and save and exit the editor

vim ~ / .bashrc export PATH = ~ / cmake-3.9.1-Linux-x86_64 / bin: $ PATH

Update environment variables

source ~ / .bashrc

Verify that the installation is successful. If the result of the following command is cmake verison 3.9.1, the installation is successful. If it is not, it indicates that the installation failed.

cmake –version Possible problems with Centos system

Running dotnet OmniCoin.Node.dll directly under Centos reports an error, the error message may be as follows

“Unable to load shared library ‘leveldb.dll’ or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libleveldb.dll: cannot open shared object file: No such file or directory”

In the terminal, enter the Node folder path \runtimes\linux-x64\native, execute ldd leveldb.dll, and the related information obtained indicates that the two dependent packages are missing, and these two dependent packages are caused by the gcc version is too low, so need to Upgrade gcc.

Upgrade GCC (eg gcc-8.3.0)

cd ~ mkdir gcc_temp cd gcc_temp wget http://ftp.gnu.org/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.gz tar -zxvf gcc-8.3.0.tar.gz yum -y install bzip2 # gcc-8.3.0 Two of the three dependency packages are bzip2 compressed files. If bzip2 is already installed on the system, there is no need to repeat the installation cd gcc-8.3.0 ./contrib/download_prerequisites yum install -y gcc-c ++ glibc-static gcc # To avoid errors when compiling and installing gcc, install the required components in advance ./configure –prefix = / usr / local / gcc –enable-bootstrap –enable-checking = release –enable-languages ​​= c, c ++ –disable-multilib make # This command may take about 1 hour to execute, please be patient

make install gcc –version

If the version number obtained by the above command is not currently installed 8.3.0, you need to modify the configuration file

vim /etc/profile.d/gcc.sh # add a line at the end export PATH = / usr / local / gcc / bin: $ PATH save source /etc/profile.d/gcc.sh gcc –version # Make sure it is the currently installed version ln -sv / usr / local / gcc / include / / usr / include / gcc #Export header file vim /etc/ld.so.conf.d/gcc.conf add a line / usr / local / gcc / lib64 to save ldconfig -v ldconfig -p | grep gcc # Verify whether it is exported. If there is an export, the GCC installation is completed GLIBCXX_3.4.2X is missing

In the terminal, enter the path of Node folder \runtimes\linux-x64\native, execute ldd leveldb.dll, GLIBCXX_3.4.2X may still be missing, the following is the solution:

strings /usr/lib64/libstdc++.so.6 | grep GLIBC #Found no missing packages find / -name “libstdc ++. so.6 *” #Global search, whether a high version of libstdc ++. so.6.0.X is found, if there is a high version, copy related files, then create a soft link cp /usr/local/gcc/lib64/libstdc++.so.6.0.24 / usr / lib64 / ln -s /usr/lib64/libstdc++.so.6.0.24 /usr/lib64/libstdc++.so.6

In the terminal, enter the Node folder path \runtimes\linux-x64\native, execute ldd leveldb.dll, and find that all the dependencies are available. At this point the Leveldb environment under CentOS7 is completely complete.

en_USEnglish
zh_CNChinese en_USEnglish