Maker Badges Merkle Service
A micro service for the Maker Badges to ease client burden.
Getting Started
- Clone the repo to your local machine.
- Make sure you've got the required global tools by running:
npm install -g yarn ts-node
- Restore packages by running
yarn
- Check everything works locally by running
yarn test
- Deploy to AWS by running
yarn deploy
- Hint set your
AWS_PROFILE
environment variable if not using the default- On fish:
set -x AWS_PROFILE profile
- On bash:
export AWS_PROFILE=profile
- On fish:
- Hint set your
Other commands:
- Check the serverless packaging works locally:
yarn package
- Clean generated files left over from build:
yarn clean
Writing Tests
Jest has been configured to run any file ending in *.test.ts
, *.test.tsx
or *.test.js
. You can put these in the test
folder, but they can also live alongside your code in the src
folder if you prefer.
Infrastructure
[DeployPipeline] (https://www.dropbox.com/s/s63c40nqq8q85ax/MakerDAO-Badges-Pipeline.mov?dl=0)
Defaults:
- Doesn't use VPC
- Deployed to us-east-1
- Lambda timeout: 30 seconds
In the serverless.yml file uncomment from line 24 onwards to enable the hyper-paranoid security locked down setup. This uses private subnets in three availability zones, and does not include an internet gateway - which means the lambdas can't access the internet, and the only way they can be invoked is via API gateway.
Key Features when uncommented:
- No outbound connectivity at all.
- 3 private subnets.
- /24 block gives 250 addresses in each subnet
- 750 addresses available in total (limits lambda instances).