Service API to lend resources using Ethereum to log events
- Create files
src/blockchain/ABI.txt&src/blockchain/contractAddress.txt:
touch src/blockchain/ABI.txt
touch src/blockchain/contractAddress.txt-
Deploy the contract to peer (if not already done) & paste the ABI and the contract address in files created above.
- ABI and contract address change after every deployment. If not updated accordingly, events will not be logged.
-
Update
src/config/config.jsonwith values as per your configuration. Make sure you change thegethUrlto the IP where your geth client is running. -
Create a Firebase project and update
src/config/firebase-admin.json.
-
Install docker and docker-compose based on your platform.
-
Set values for
ADMIN_EMAILandADMIN_EMAIL_PASSWORDin Dockerfile. If no envt variables, will use values insrc/config/config.json -
Run docker compose:
docker-compose up --build -d-
App will run on port
3000by default. -
Running via docker will set environment to
production. So, production config values fromsrc/config/config.jsonwill be used.- Environment can be changed to
developmentin the Dockerfile.
- Environment can be changed to
-
Install
node v6.10.2andnpm v4.4.4. -
Set environment to production:
export NODE_ENV=production- Install gulp and dependencies:
npm install -g gulp-cli
npm install- Build and start:
gulp
npm start- App will run on port
3000by default.
- Run
npm test.
MIT