This is a script that gets the cosmos.directory data from GitHub and converts it into a JSON file, stores it on S3 and invalidates the cloudfront cache.
The generated data is of the following type -
import type { ChainInfo } from '@keplr-wallet/types'
type GeneratedData = {
mainnet: Record<string, ChainInfo>
testnet: Record<string, ChainInfo>
}
yarn install
yarn build
export AWS_REGION="..."
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export S3_BUCKET_NAME="..."
export CLOUDFRONT_DISTRIBUTION_ID="..."
Note: Missing environment variables will cause the script to throw an error.
yarn start
The data is served via cloudfront and can be accessed via the following path -
/cosmos-directory-cache/graz-chains.json