Skip to content

aaroncolaco/psl-lending

Repository files navigation

psl-lending

Service API to lend resources using Ethereum to log events

Config

  • 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.json with values as per your configuration. Make sure you change the gethUrl to the IP where your geth client is running.

  • Create a Firebase project and update src/config/firebase-admin.json.


Deploying via Docker

  • Install docker and docker-compose based on your platform.

  • Set values for ADMIN_EMAIL and ADMIN_EMAIL_PASSWORD in Dockerfile. If no envt variables, will use values in src/config/config.json

  • Run docker compose:

docker-compose up --build -d
  • App will run on port 3000 by default.

  • Running via docker will set environment to production. So, production config values from src/config/config.json will be used.

    • Environment can be changed to development in the Dockerfile.

Deploying normally

  • Install node v6.10.2 and npm 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 3000 by default.

Testing REST API

  • Run npm test.

Contributors

License

MIT

About

Service API for Persistent Lending using Ethereum

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published