A service that caches EOS Block Prodcuer's bp.json files in DynamoDB every 24 hours and exposes an endpoint to retrieve the data using the Serverless Framework.
This service uses the following AWS resources:
- Lambda Function:
cacheBpJson- Caches the bp.json file of top 50 block producer's by vote count. - Lambda Function:
getAllProducers- Retrieves cached bp.json files with updated vote counts appended to response. AWS API Gatewayto exposegetAllProducersas a public endpoint. Requires no credentials.DynamoDBtable to hold the cached bp.json files.
- Node 8.10 or above
- Serverless Framework
- Setup AWS Credentials for Serverless Framework
- Install package dependencies with
npm install. - Deploy Serverless service with
sls deploy. - Make sure to manually execute the
cacheBpJsonLambda function once after deployment for initial cache into DynamoDB. - After the deployment succeeds, the API Gateway endpoint will be reported in the terminal.
sls removeto remove service. This command destroys DynamoDB tables also.