This is an exercise done for an interview process. Read more about it in TASK.md
💡 Merkle Trees are a very useful data storage tool which makes data verification and integrity checking efficient. They are widely used in the blockchain space. A binary Merkle tree is a specific case of a Merkle tree in which nodes have to 2 children.
- Authorization - follow the guide, you need an active AWS access portal session for the AWS CDK.
- Bootstrapping - deploying stacks with the AWS CDK requires dedicated Amazon S3 buckets and other containers to be available to AWS CloudFormation during deployment.
After, you should be available to deploy.
cdk synth
emits the synthesized CloudFormation templatecdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with the current state
Current CDK expose two lambdas.
-
writeMerkleTree
- paramsless function, launch once to store static Merkle Tree in S3 bucket -
readMerkleTree
- accepts Merkle Tree Node index, the return value of that node, depth and offset (read TASK.md to understand more)Additionally,
readMerkleTree
is connected to AWS API Gateway, and bycurl https://{BASE_URL}/merkle-tree/{nodeIndex}
you'll get the same output
In the core of the project, you'll find cdk.context.json
- highly recommended to fill it in case of production usage :)
Read more here: https://docs.aws.amazon.com/cdk/v2/guide/context.html