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
seth
command 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 test
1 - Install:
docker-compose
docker
2 - Create a
.env
file at the root location of the repository, and add theSENDGRID_API_KEY
environment 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-docker
It 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 run
Note that emailservice
will be restarted every 10 seconds to simulate a CRON job.
Execute
docker ps
to show the running containers
To stop the containers, run:
$> make stop
API Swagger can be found at the path: http://localhost:8000/documentation/swagger/index.html#/
To generate documentation static files, run
$> make docs
Prerequisites:
- 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-images
make docker-tag
make docker-push
cf login
and select the right space whish iscedar
make cf-deploy
To replace minter
keystore file:
- Get private key of
minter
from mnemonic: https://iancoleman.io/bip39/ geth account import privatekey
without the0x