A truffle box to serve as the foundation of any Truffle and Koa.js dApp.
This Box Uses NodeJS(Koa JS) to provide API endpoints to the Ethereum Blockchain smart contract so that this smart contract can be used in Android/Ios Apps as well.
- Production grade lightweight JSON based logging utility
- configurable env's based on current NODE_ENV
- Error handling middlewares
- Easily pluggable controllers and routers
- The project structure is highly modular and can be directly used or extended for production purpose
Pre-Requisites
Installation
- Install Truffle and Ganache CLI globally.
npm install -g truffle
npm install -g ganache-cli
- Download the box. This also takes care of installing the necessary dependencies.
truffle unbox manjeet-thadani/koa-trufflebox
- Install all the node modules required by running:
// install all the node modules using npm
npm installor 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
compileto compile the contracts -
You can see that a new
/buildfolder 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
migrateinside the truffle development console -
To run the Koa server
yarn startornpm start -
In the browser window open
http://localhost:8081/.
Collaborators