This project is the frontend & backend of the Cedrus Reference Design and it handles the following functionality
- Endpoint for static files used by the website
- REST API for creating new CedarCoin claims (
cedrusservice) - Sendgrid integration for sending email instructions on how to claim a CedarCoin (
emailservice) - REST API that wraps
sethcommand line utility which allows CedarCoin to be claimed (sethservice)
For detailled explanation of the services, see services.
All Ethereum contracts are located in the contracts/ folder.
We use OpenZeppelin CLI to manage contracts dependencies, deploy and upgrade contracts.
- Mongo DB (3.4.23)
- Sendgrid
- Seth
- Golang (1.12)
- NPM
Prerequisite:
- Install
go
$> make deps$> make build$> make test1 - Install:
docker-composedocker2 - Create a
.envfile at the root location of the repository, and add theSENDGRID_API_KEYenvironment variable :SENDGRID_API_KEY=<YOUR_API_KEY>Make sure to have outbound connection not blocked by your local network.
Then run on first time (might takes minutes to complete):
$> make build-dockerIt will build docker containers of mongodb, cedrusservice, emailservice and sethservice, see docker-compose.yaml.
Warning: the sethservice container build may takes minutes.
Then, run the containers with:
$> make runNote that emailservice will be restarted every 10 seconds to simulate a CRON job.
Execute
docker psto show the running containers
To stop the containers, run:
$> make stopAPI Swagger can be found at the path: http://localhost:8000/documentation/swagger/index.html#/
To generate documentation static files, run
$> make docsPrerequisites:
- Make sure you have Cloud Foundy CLI installed.
- Set the environments variables :
REGISTRY: Docker registry url (i.edockerhub-account/my-image)USERNAME: Docker registry usernamePASSWORD: Docker registry password
Run:
make docker-imagesmake docker-tagmake docker-pushcf loginand select the right space whish iscedarmake cf-deploy
To replace minter keystore file:
- Get private key of
minterfrom mnemonic: https://iancoleman.io/bip39/ geth account import privatekeywithout the0x