This is the source code powering usdcfaucet.com, a free crypto faucet.
- Send some USDC ERC-20 tokens to an eth address that you own the private key to. Make sure the address also has ETH as gas.
- https://infura.io account. Free version works!
- Google recaptcha v2 account
- Nodejs 8.10
To start, clone the repo and install modules
ccmonkey user$ npm install
-
Lambda + API Gateway setup + S3 + DynamoDB Good tutorial here https://aws.amazon.com/getting-started/projects/build-serverless-web-app-lambda-apigateway-s3-dynamodb-cognito/
-
Lambda setup with one function RequestUSDC, Node.js 8.10
- Be sure to fill the environment variables. ethAddress, ethPrivateKey, infuraProjectSecret
-
DynamoDB setup with three tables:
- (TableName, Column, Column, etc.)
- Currency: CurrencyName, Nonce
- Request: UserId, NumberOfRequests
- Send: SendId, DestinationAddress, ETHSendURL, IPAddress, SendDate, TxHash, Testnet
- Lambda Layers We only deploy the api code each time we push to Lambda. This allows our deploys to be much faster as we don't need to re-deploy sizable node modules unless our dependencies change.
Navigate to the Web directory
ccmonkey user$ npm install http-server -g
web user$ http-server
- in chrome, go to http://localhost:8080/