Giter Club home page Giter Club logo

node-main's Introduction

Node-main

Node-main is a part of Enecuum's blockchain protocol. It is a Fullnode with the Blockchain Explorer functionality.

What is this project?

Enecuum is a Blockchain Mobile Network for decentralized application. We create a decentralized ecosystem able to bring the blockchain and cryptocurrencies to the real mainstream, involving a crowd with regular mobile and desktop devices into the blockchain network, as well as providing the powerful toolkit for the dApps developers to create fast and low cost applications for millions of people.

To help new people with understanding our products, Enecuum maintains a Vuepress-powered website with tutorials, Enecuum User Guides.

Run Fullnode

Prerequisites

You need a public IP to run Fullnode.

Make sure you have the following installed.

MySQL:

sudo apt install mysql-server -y

NodeJS:

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

PM2:

sudo npm i -g pm2

Install

  1. Install the packages:

    npm i
    
  2. Initialize DB:

    mysql -uroot -e "DROP DATABASE IF EXISTS trinity_fullnode; CREATE DATABASE trinity_fullnode;"
    
  3. Create DB schema from dump:

    mysql -uroot trinity_fullnode < sql/db.sql
    

Configure

Before proceeding, make sure you have a public IP to run Fullnode.

  1. Create a copy of config.pulse and name it config.json.

    cp config.pulse config.json
    
  2. In config.json, set the dbport, dbuser according to your MySQL settings. You can also specify dbhost property if it is not localhost.

  3. Create a copy of pm2/fullnode.config.example and name it pm2/fullnode.config.js.

    cp pm2/fullnode.config.example pm2/fullnode.config.js
    
  4. Optionally, in pm2/fullnode.config.js, change the following ports:

    • In fullnode_explorer section:

    • set the --explorer as one of your open ports for your Blockchain Explorer:

      --explorer 80
      

      To turn off the Explorer, just remove the --explorer 80 key from arguments list.

    • In fullnode_transport section:

      • set the --peer as an existing Enecuum node IP address, preferably the Enecuum LPoS IP address:

        --peer=95.216.68.221:8000
        
      • set the --port as one of your open ports for other's nodes sync, preferably 8000:

        --port=8000
        
  5. To run Explorer, make a copy of explorer/config-enq.js and name it explorer/config.js.

    cp explorer/config-enq.js explorer/config.js
    

Run PoS

Prerequisites

You need a public IP to run PoS node.

Make sure you have the following installed.

MySQL:

sudo apt install mysql-server -y

NodeJS:

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

PM2:

sudo npm i -g pm2

Install

  1. Install the packages:

    npm i
    
  2. Initialize DB:

    mysql -uroot -e "DROP DATABASE IF EXISTS trinity_pos; CREATE DATABASE trinity_pos;"
    
  3. Create DB schema from dump:

    mysql -uroot trinity_pos < sql/db.sql
    

Configure

Before proceeding, make sure you have a public IP to run PoS.

  1. Create a copy of config.pulse and name it config.json.

    cp config.pulse config.json
    
  2. In config.json, set the dbport, dbuser according to your MySQL settings. You can also specify dbhost property if it is not localhost.

  3. Create a copy of pm2/pos.config.example and name it pm2/pos.config.js.

    cp pm2/pos.config.example pm2/pos.config.js
    
  4. Optionally, in pm2/pos.config.js, change the following ports:

    • In pos_miner, pos_syncer, pos_nodeapi, pos_transport section:

    • set the --id as of your PoS contract id:

      --id <you PoS contract id>
      
    • In pos_transport section:

      • set the --peer as an existing Enecuum node IP address, preferably the Enecuum LPoS IP address:

        --peer=95.216.68.221:8000
        
      • set the --port as one of your open ports for other's nodes sync, preferably 8000:

        --port=8000
        

Start

Start Fullnode:

pm2 start pm2/fullnode.config.js

Start PoS:

pm2 start pm2/pos.config.js

Check

To check if your node is successfully running, you can optionally do the following.

  1. Open MySQL command line:

    mysql -u root -p
    
  2. Check if your node is synchronizing:

    Use the appropriate database name in the query

    Fullnode:

    select count(*) from trinity_fullnode.kblocks;
    

    PoS:

    select count(*) from trinity_pos.kblocks;
    

Alternatively, if you enable explorer in the config file, you can access it via your browser with the specified port number.

Stop

To stop the process, use the following:

pm2 stop <process name | id>
pm2 delete <process name | id>

Contribution

See Contributing.

License

MIT

node-main's People

Contributors

floyddd-vm avatar kamighost1 avatar prudanoff avatar svanurin avatar wwrongname avatar yuliabardinova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

node-main's Issues

PoW issue

Hello team
I'm unable to start a node in PoW for mainnet. Can you please help?
Also, the sub-module linked by the "ext" folder is not accessible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.