siddharthborderwala / cosmos-directory-chains-sync

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction

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>
}

Usage

Install Dependencies

yarn install

Build TS Script

yarn build

Load the Environment Variables

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.

Run the Generated JS

yarn start

Data Usage

The data is served via cloudfront and can be accessed via the following path -

/cosmos-directory-cache/graz-chains.json

About


Languages

Language:TypeScript 100.0%