How to install and execute Truffle on an Ubuntu 16.04

Installation

Install packages

sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get -y install curl git vim build-essential

Install NodeJs

sudo apt-get install curl software-properties-common
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt-get install nodejs

Install Truffle

sudo npm install -g truffle

Install testrpc

#  sudo npm install -g  ganache-cli
# ganache-cli

Create a project

Init Truffle project

# mkdir myproject
# cd myprojet/
# truffle init
# truffle compile

Deploy contracts

# truffle migrate
Listening on localhost:8545
eth_accounts
eth_sendTransaction
Transaction: 0xc1cbc63cd0644604bc41ebbd9bd9998ce14f5ae2b27cb2e2d3fc5ce823574e62
Contract created: 0xbbdef31b721512c7c9bc05a00e8c24fa4e15e1f6
Gas usage: 139321
Block Number: 0x01

And run migration
Running migration: 1_initial_migration.js
Deploying Migrations...
Migrations: 0xbbdef31b721512c7c9bc05a00e8c24fa4e15e1f6

Create DAPP

# truffle build
# truffle serve
Serving app on port 8080...
Rebuilding...
Completed without errors

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ABHISHEK KUMAR

ABHISHEK KUMAR

More from Medium

Upload Images to Cloudinary using NodeJS

Using TomTom APIs with Node.js and TypeScript

Nuxt3 complex solutions: database integration

The new way of deep-copying in JS, Stop using libraries!