{"id":18263774,"url":"https://github.com/yearn/yearn-caching-api","last_synced_at":"2025-04-04T20:31:18.563Z","repository":{"id":40399161,"uuid":"393120826","full_name":"yearn/yearn-caching-api","owner":"yearn","description":"🍕 Lightweight Rest API shim for yearn's SDK","archived":false,"fork":false,"pushed_at":"2023-01-09T14:01:18.000Z","size":729,"stargazers_count":5,"open_issues_count":2,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-20T19:07:23.913Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yearn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-05T17:16:00.000Z","updated_at":"2022-04-28T00:54:03.000Z","dependencies_parsed_at":"2023-02-08T12:16:42.189Z","dependency_job_id":null,"html_url":"https://github.com/yearn/yearn-caching-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-caching-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-caching-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-caching-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yearn%2Fyearn-caching-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yearn","download_url":"https://codeload.github.com/yearn/yearn-caching-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247246366,"owners_count":20907782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:12:34.903Z","updated_at":"2025-04-04T20:31:17.220Z","avatar_url":"https://github.com/yearn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yearn API\n\nSmall SDK shim + Metadata endpoint for Yearn\n\nThis codebase hosts non user specific data provided by the [SDK](https://github.com/yearn/yearn-sdk) to increase the speed of providing this data as well as reducing the number of web3 calls \n\n## Setting up GitHub Actions\n\nThe service can be deployed using GitHub actions. The service is deployed on the infrastructure described [here](https://github.com/numan/yearn-api-infra).\n\nTo set up GitHub actions, you will first need to create a AWS User with the proper IAM policy to deploy the service.\n\nHere is the minimal policy you need:\n\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"RegisterTaskDefinition\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ecs:RegisterTaskDefinition\",\n                \"ecs:DescribeTaskDefinition\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"PassRolesInTaskDefinition\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"iam:PassRole\"\n            ],\n            \"Resource\": [\n                \"arn:aws:iam::\u003caws account id\u003e:role/\u003cyearn api task definition execution role\u003e\",\n                \"arn:aws:iam::\u003caws account id\u003e:role/\u003cyearn api task definition task role\u003e\"\n            ]\n        },\n        {\n            \"Sid\": \"DeployService\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ecs:UpdateService\",\n                \"ecs:DescribeServices\"\n            ],\n            \"Resource\": [\n                \"arn:aws:ecs:*:\u003caws account id\u003e:service/yearn-api-cluster/YearnAPIService\"\n            ]\n        },\n        {\n            \"Sid\": \"GetAuthorizationToken\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ecr:GetAuthorizationToken\"\n            ],\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"AllowPush\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ecr:GetDownloadUrlForLayer\",\n                \"ecr:BatchGetImage\",\n                \"ecr:BatchCheckLayerAvailability\",\n                \"ecr:PutImage\",\n                \"ecr:InitiateLayerUpload\",\n                \"ecr:UploadLayerPart\",\n                \"ecr:CompleteLayerUpload\"\n            ],\n            \"Resource\": \"arn:aws:ecr:us-east-1:\u003caws account id\u003e:repository/yearn-api-repo\"\n        }\n    ]\n}\n```\n\nReplace the following placeholders:\n\n- `\u003caws account id\u003e` - Your aws account id\n- `\u003cyearn api task definition execution role\u003e` - The name of the task definition execution role. This should be automatically created when your create the [infrastructure](https://github.com/numan/yearn-api-infra)\n- `\u003cyearn api task definition task role\u003e` - The name of the task definition task role. This should be automatically created when you create the [infrastructure](https://github.com/numan/yearn-api-infra)\n\n\nCreate a new AWS user and attach the newly created policy to that user.\n\nCreate a new [GitHub environment](https://github.com/numan/yearn-api/settings/environments/new) in the repo  called `production`. Add the following secrets in the new environment (use the credentials of the new user you just created):\n\n1. AWS_ACCESS_KEY_ID\n2. AWS_SECRET_ACCESS_KEY\n\n**IMPORTANT**\n\nOptionally, setup [environment protection rules](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-protection-rules) to control who is able to deploy a new version of the app.\n\n## Deploying a new version\n\nTo deploy, run the build and deploy workflow from the [actions](https://github.com/numan/yearn-api/actions/workflows/ecs-build-deploy.yaml) page.\n## Starting\n\n```\n$ make\n```\n\n## Stopping\n\n```\n$ make down\n```\n\n## Production deployment\n\n```\n$ PROD=true make\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-caching-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyearn%2Fyearn-caching-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyearn%2Fyearn-caching-api/lists"}