To Be Used as Truffle Box Creating API Endpoints for Ethereum Blockchain.
We use personalised blockchain for Ethereum BlockChain Development. This personalised blockchain is made in the GanacheCLI.
The Smart Contract Written in solidity language is deployed on this Ethereum Blockchain. Smart Contract is Immutable hence, once deployed it can't be changed.
A truffle box to serve as the foundation of any Truffle and Express.js dApp.
This Box Uses NodeJS(Express JS) to provide API endpoints to the Ethereum Blockchain smart contract so that this smart contract can be used in Android Apps as well.
Pre-Requisites
- NodeJS
- A Package Manager for NodeJS, such as Yarn or npm (comes pre-installed with NodeJS)
- GanacheCLI
- Truffle
Installation
- Install Truffle and Ganache CLI globally. If you prefer, the graphical version of Ganache works as well!
npm install -g truffle
npm install -g ganache-cli
- Download the box. This also takes care of installing the necessary dependencies.
truffle unbox arvindkalra/express-box
- Install all the node modules required by running:
// install all the node modules using npm
npm install
or if you prefer yarn
//install all the node modules using yarn
yarn install
- Start truffle development console using
truffle develop
-
Inside the truffle console run
compile
to compile the contracts -
You can see that a new
/build
folder has been created in the root directory which contains the compiled contracts. -
Now these contracts need to be deployed on the Blockchain. For this, run
migrate
inside the truffle development console -
To run the Express server
yarn start
ornpm start
-
In the browser window open
http://localhost:3000/
.
Collaborators