A tutorial for setting up a development environment and using truffle the smart contract framework
First we need to install nodejs and some node packages
Mac instructions
- Open terminal
#First install the node version manager nvm
brew install nodejs
#The following commands may need "sudo" in front
sudo npm install -g truffle
sudo npm install -g ganache-cli
sudo npm install -g express
Windows instructions
* [Download and Install nodejs](https://nodejs.org/en/download/) * Open power shell as administrator
npm install -g truffle
npm install -g ganache-cli
npm install -g express
Linux instructions
* [Use your favorite package manager](https://nodejs.org/en/download/package-manager/)
#This is Ubuntu for example
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
#Install the npm modules
sudo npm install -g truffle
sudo npm install -g ganache-cli
sudo npm install -g express
Steps to deploy smart contracts
- Install dependicies and deploy to ganache (A test blockchain)
- Open your terminal and run these commands
-
npm install -g ganache-cli npm install -g truffle ganache-cli -p 8545
-
- Open new terminal and git clone this project
git clone https://github.com/mullinat/truffle_tutorial.git
- cd into the truffleWorkspace directory
cd truffle_tutorial
cd truffleWorkspace
- Now compile the example smart contracts
truffle compile
- Now deploy the example smart contracts
truffle migrate --reset
- Open your terminal and run these commands