Deploy an API that can only be accessed by users holding your token.
This repository contains an AWS CDK Stack that deploys the AWS Cognito and Network State API resources of the sequence diagram. Have a look at suud/network-state-example-app-react for an implementation of the other parts.
Learn more about the motivation behind this repository by reading this article.
If you are using AWS CDK for the first time, check out the Introduction to the CDK workshop.
# clone repository
git clone [email protected]:suud/network-state-backend-aws.git
cd network-state-backend-aws
# install dependencies
npm install
cd lambda-layers/web3/nodejs
npm install
cd ../../..
# compile typescript to js
npm run build
# deploy stack
cdk deploy \
--parameters rpcUrl=... \
--parameters contractAddress=... \
--parameters tokenId=...
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template