Author: Manoj Kolhe

  • Blog
  • Author: Manoj Kolhe

Install Node Js From Source Code

Node Js – Installation Here we will study NodeJs installation in the different operating systems and in different ways. Depending upon our development environment we need to install node js from source code or via nvm in windows, mac, and Linux (Including AWS and Google Cloud). Our first topic will be a focus on how to install node js from source code in Linux, then we will discuss different other methods of installing node js in Windows, Ubuntu, and Mac Operating System Different Ways of Installing Node Js There are 4 ways of installing Node JS Installing Node Js From Source Code Install Node Js using NVM Binary Installation. Install Node Js from Binary. Click Here to Install Nodes Js From Binary Installation from Ubuntu Packages. To install Node Js from Ubuntu Packages click here Install Node Js From Source Code Node Js From Source Code can be installed easily in Linux and Mac. Installing node js from source code is not recommended in Windows. But if you still want to do that we will come up with a blog on that. Here we will see how to install Node Js in Ubuntu and Mac Operating System Install NodeJs from Source Code- Linux (Ubuntu) TO INSTALL THE NODE JS FROM Source Code FOLLOW THE BELOW STEPS. Open the Ubuntu terminal and execute the below commands. Your ubuntu system can be on Google Cloud, AWS Cloud, Digital Ocean or even your local machine. This post focuses completely just on Installation. But if you want to learn Node Js in detail like even creating your own NPM package you should refer this Node Js Complete Guide. Step 1: Update your apt repository sudo apt-get update Step 2: Install build-essentials sudo apt-get install build-essential openssl libssl-dev pkg-config Step 3: Change to the src directory cd /usr/local/src Step 4: Make a node directory in your src folder sudo mkdir node Step 5: Enter the node directory cd node Step 6: Download the Source file of Node Js sudo wget https://nodejs.org/dist/v8.9.3/node-v8.9.3.tar.gz This URL downloads the specific version of node js. If you want to download the different versions of Node Js Source Code please change the URL accordingly. NodeJs source code is available in different sources. But the best method will be to download it from nodejs.org. Nodejs.org is the trusted website providing reliable and secure source code of Node Js. The source code of all the versions of Node is available and their link can be found in the website If you want to experiment with multiple version I will suggest that you should go for the nvm version manager. But if you production-ready application and you are sure of version then please read below points to get the required node js source code for your project. For 8.9.3 of Node Js Source Code Please click here 9.11.0 please use this link https://nodejs.org/dist/v9.11.0/node-v9.11.0.tar.gz But if you want to download the latest version your URL will be https://nodejs.org/dist/v9.11.0/node-v9.11.0.tar.gz If you different version requirement please see the list of the available version of Node Js in the link over here https://nodejs.org/en/download/releases/ Step 7: Extract the tar file sudo tar zxvf node-v8.9.3.tar.gz Step 8:Enter the Node Js Directory cd node-v8.9.3 Note: This folder contains raw files that need to be compiled specifically for your particular architecture and kernel. Most source code packages like this come with a bash script called “configure” that will create all these files and set the options for you. Step 8: Run the configure script sudo ./configure Note: If you don’t receive any errors or warnings, the configure script ran successfully. Step 9: Compile the code to Install Node Js From Source Code sudo make make will begin compiling the code. This will take 5-10 minutes or even longer depending on your server resources. Step 10: Now that make is compiled, install it sudo make install Step 11: Check the Node.js and npm version node –version npm –version If you see the versions displayed for node and npm, you have successfully compiled Node.js with npm from the source. Since your Node Js is installed, you can now begin installing node modules through npm. Next we will see how to install this in Mac Operating System But if you want to learn complete Node Js please refer to this link of Node Js. I think this is the best thing available on the internet if you want to explore and learn Node Js better than anyone. Install NodeJs using NVM The above method explains how to install node js from source code. But there are scenarios when you need to have multiple versions of Node Js. There are many such scenarios. Consider you are running two application which requires node 8.9 and other is an old application which requires node 6.1. To handles this we need to use NVM, Node Version Manager. Installing Node Js Using NVM in Ubuntu Here, we will install two versions of node js and we will also see which version is available with NVM. Just open your Ubuntu terminal and follow the below instructions Step 1: Install NVM in Ubuntu Open Your Ubuntu Terminal and do an update. This command is not necessary but if you have not done an update for along it’s better you do it now. sudo apt-get update Step 2: Install build-essentials Again this is also not necessary. But if NVM or Node Js is the first application in your system, then it’s a high probability that these packages are not installed in your system. It’s better to execute this command. If everything is installed system will just print the message that it’s already installed. sudo apt-get install build-essential libssl-dev Step 3: Getting the NVM Installation script using Curl Download the curl script of NVM installation by using below command in your ubuntu terminal curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash Since we have mentioned a specific version i.e. 0.34 please make a note that, you can modify it to the latest version. Just google which is the latest version of the Node Version Manager

Install Litecoin Core in Ubuntu from Source Code

….. Cryptcurrency Cryptocurrency are the blockchain based currency which offers best alternative to the fiat currency. Cryptocurrency are much better in terms of security , transparency and its very environment friendly because it doesn’t user paper. Altcoin With the success of Bitcoin many other currencies where launched like Ethereum , Litecoin , Monero and many more.This currency are often termed as Altcoin . A cryptocurrency is successfully when it has very big and active community and many core node running to make it very powerful. But running a cryptocurrency core node requires some technical expertise and as result many indidvuale are not running nodes they just care for the wallet. To brigde the gap Techaorha team has listed out instructions to build altcoin form source code and make their own core node. Below steps give insight to Install Litecoin Core in Ubuntu from Source code. Follow Below Instructions to Install Litecoin Core in Ubuntu 1. Install and Update Pre-equired Packages. Install Litecoin core requires some packages to build and execute. Follow below command to install the requisite. #update package sudo apt-get update #install git if not available sudo apt-get install git #Install essential and dependencies. sudo apt-get install build-essential #Install Dependencies sudo apt-get install autoconf libtool pkg-config libboost-all-dev libssl-dev libprotobuf-dev protobuf-compiler libevent-dev libqt4-dev libcanberra-gtk-module #thanks. After this we need to install berkeley db 2. Install Berkeley DB 4.8 Berkeley is must and the version is also very specific. You need to install only Berkeley DB 4.8 , if you install any other system it will show an error. Found Berkeley DB other than 4.8 . Since we need to install specific version you have to compile from source code instead of directly deploying form Ubuntu packages. Please execute/use following commands to install Berkeley DB 4.8 in Ubuntu wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz echo ’12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz’ | sha256sum -c tar -xvf db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix mkdir -p build BDB_PREFIX=$(pwd)/build ../dist/configure –disable-shared –enable-cxx –with-pic –prefix=$BDB_PREFIX make make install 3. Install Litecoin Core Node Once the dependencies are install next step is to install the Litecoin Core in the system. Execute  below steps to install the Litecoin Core in Ubuntu #below commands git clone https://github.com/litecoin-project/litecoin.git cd litecoin sudo chmod -R 777 . ./autogen.sh ./configure CPPFLAGS=”-I${BDB_PREFIX}/include/ -O2″ LDFLAGS=”-L${BDB_PREFIX}/lib/” make 3. Setup Config and Run Node 1. Create folder same as “.name of coin” , in our case it’s  “.litecoin”  in root directory of Users , in AWS it will be /houme/ubuntu 2.  Create a file with a name “litecoin.conf” inside newly create folder 3. Go to folder of coin and then src folder i.e /home/ubuntu/litecoin/src and run the command ./litecoind If you want any assistance from Techaroha Team to Install or Create a new coin please contact us here.

Setup Explorer for Cryptocoin in Ubuntu 14.04

Cryptocoin Explorer are used to view and track transaction in the blockchain network. Many opensource explorer are available in the git repository you can use as per choice. This article explains how to Setup Explorer for Cryptocoin in Ubuntu. Explorer are must for any cryptocoin to track the transaction , blockchain is an public ledger but explorer make its actually visible to user. In short its the ui of block chain technology or block chain based currency. Setup Crytpocoin explorer Cryptocoin explorer requires different software or packages in ubuntu to be installed. This article explains how to setup iquidus Explorer in your Ubuntu Operating System. Major Component required to Setup Explorer.  Nodes Js Mongo DB Coin Setup Domain Point Let understand each and every step to Setup Explorer.  Node Js Node Js is required to run the UI of the Explorer and interact with coin to fetch the data and insert the same into Mongo DB. You can installed Node Js using There are three ways of installing Node JS 1. Binary Installation. Please view the link for Details Step. Click Here to Install Nodes Js From Binary 2. Installation from Source Code. To install Node js from Source Code Click Here 3. Installation from Ubuntu Packages. To install Node Js from Ubuntu Packages click here Mongo DB Mongo DB serves as an back-end to  Explorer. All the transaction in block chain are also stored in Mongo DB. Please click here to Install Mongo DB in your ubuntu system. Once Mongo DB is installed we need to create the database which will be by iquidus explorer and setup the credentials for that. First following commands to ready Mongo DB for your explorer. #Run Mongo $ mongo #Create Database. Below command create the database if database doesn’t exist or it will just open the db for further actions. use explorerDatabase #Create User. db.createUser( { user: “techaroha”, pwd: “techPassword”, roles: [ “readWrite” ] } ) Coin Setup This is the most important part. Coin core daemons needs to installed and config files to be configured correctly to ensure that Explorer can fetch all the required. Here we will take an example of Litecoin. Please click here to install Litecoin Core in Ubuntu 14.0.4 Once the core is installed we need to setup config file. Config file will help connecting explorer to Coin and fetch the required data for Display. Example Configurations for Litecoin  Core for explorer is given in the below rpcuser=Yourusername rpcpassword=Yourpassword rpcallowip=127.0.0.1 daemon=1 server=1 listen=1 #Below config is must so that litecoin core will fetch and stored all the transactions txindex=1 Configuring Iquidus – Explorer UI(User Interface) Clone or Download the Source code from GitHub  https://github.com/iquidus/explorer or you can clone the repository using following commandgit clone https://github.com/iquidus/explorer Go to explorer folder and rename the file settings.json.template to settings.json Open the new setting.json file and change the following parameters #Change the Title to your coin name “title”: “IQUIDUS”, #Change the coin name “coin”: “Darkcoin”, #change the ticker or Symbol of Coin “symbol”: “DRK”, # change the Logo “logo”: “/images/logo.png”, # change the favicon as per your need “favicon”: “public/favicon.ico”, # Db setting very importtant. # Rember the username password we have setup for mongodb “dbsettings”: { “user”: “techaroha”, “password”: “techarohaPassword”, “database”: “explorerDatabase”, “address”: “localhost”, “port”: 27017 }, # Configuration of coin to connect via RPC and fetch Data. # In the conf file of Litecoin we have setup certain credentials , # we need to user them here // wallet settings “wallet”: { “host”: “localhost”, “port”: 9332, “user”: “YourUsername”, “pass”: “YourPassword” }, Setting Up Cron for Data syncing Open crontab using command  crontab -e and add following crons for explorer data sync */5 * * * * cd /var/www/html/blogs/techaroha_wordpress/explorer && /usr/local/bin/node scripts/sync.js index update > /dev/null 2>&1 */7 * * * * cd /home/ubuntu/explorer && /usr/local/bin/node scripts/sync.js market > /dev/null 2>&1 */9 * * * * cd /var/www/html/blogs/techaroha_wordpress/explorer && /usr/local/bin/node scripts/peers.js > /dev/null 2>&1 Now start the node js application in background using following command npm install pm2 start ./bin/cluster –node-args=”–stack-size=10000″  Now finally run the url YourIP:3001 and you will see your explorer. If you want this explorer to be pointed to some domain , please go through this link. Please contact us here if you want any assistance.

Install Node JS From Binary

Install Node JS From Binary Node JS is required to run the UI of the Explorer and interact with coin to fetch the data and insert the same into Mongo DB. There are three ways of installing Node JS 1. Binary Installation. 2. Installation from Source Code. To install Node JS from Source Code Click Here 3. Installation from Ubuntu Packages. To install Node JS from Ubuntu Packages click here we are going to install Node JS from binary. To install the Node JS from binary follow the below steps step 1: Go to https://nodejs.org/en/download/  and copy latest Linux binary URL https://nodejs.org/dist/v8.9.4/node-v8.9.4-linux-x64.tar.xz step 2: Make a node directory in your src folder sudo mkdir node Step 3: Enter the node directory cd node step 4: Unzip and extract the binaries sudo tar xvf node-v8.9.4-linux-x64.tar.xz –strip-components=1 -C ./node step 4: Make an etc directory in your node folder sudo mkdir node/etc Step 5: execute the following command sudo echo ‘prefix=/usr/local’ > node/etc/npmrc sudo mv node /opt/ sudo chown -R root: /opt/node step 6: Create a symbolic link for a node that points to the new directory sudo ln -s /opt/node/bin/node /usr/local/bin/node sudo ln -s /opt/node/bin/npm /usr/local/bin/npm step 7: Check the Node.js version node -v If you see the versions displayed for a node, you have successfully installed Node.js.