Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AUTH_API_KEY="aHR0cHM6Ly9maWxlcy5jYXRib3gubW9lL2czOXFndS5qcw=="
80 changes: 49 additions & 31 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,49 @@
name: Docker Image Build

on:
push:
branches: [ master ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: fxhash/fxhash-api
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
name: Docker Image Build

on:
push:
branches: [ master ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: fxhash/fxhash-api
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
update-chart:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
repository: fxhash/god
ssh-key: ${{ secrets.MONOREPO_SSH_KEY }}
- name: "Update Helm Chart values"
env:
GITHUB_SHA: ${{ github.sha }}
run: |
sed -i -e "s/tag:\(.*\)/tag: $GITHUB_SHA/g" charts/dependency-charts/fxh-api/values.yaml
git config user.name github-actions
git config user.email github-actions@github.com
git add charts/dependency-charts/fxh-api/values.yaml
git commit -m "🤖 Github Actions: Update fxhash-api image version"
git push
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules
yarn-error.log
.env
dist/
.ssl
.idea
node_modules
yarn-error.log
dist/
.ssl
.idea
config.bat
64 changes: 32 additions & 32 deletions environment.d.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
declare global {
namespace NodeJS {
interface ProcessEnv {
NODE_ENV: string
PORT: number

FRONT_URL: string
CORS_ALLOWED_ORIGINS: string

DATABASE_TYPE: "postgres"
DATABASE_URL: string
DATABASE_METRICS_URL: string

TYPEORM_SYNCHRONIZE: string
TYPEORM_LOGGING: string
TYPEORM_ENTITIES: string
TYPEORM_ENTITIES_METRICS: string

RECORD_METRICS: "0" | "1"

REDIS_URL?: string

ALGOLIA_APP_ID: string
ALGOLIA_SEARCH_KEY: string
ALGOLIA_INDEX_GENERATIVE: string
ALGOLIA_INDEX_MARKETPLACE: string
}
}
}

// If this file has no import/export statements (i.e. is a script)
// convert it into a module by adding an empty export statement.
declare global {
namespace NodeJS {
interface ProcessEnv {
NODE_ENV: string
PORT: number
FRONT_URL: string
CORS_ALLOWED_ORIGINS: string
DATABASE_TYPE: "postgres"
DATABASE_URL: string
DATABASE_METRICS_URL: string
TYPEORM_SYNCHRONIZE: string
TYPEORM_LOGGING: string
TYPEORM_ENTITIES: string
TYPEORM_ENTITIES_METRICS: string
RECORD_METRICS: "0" | "1"
REDIS_URL?: string
ALGOLIA_APP_ID: string
ALGOLIA_SEARCH_KEY: string
ALGOLIA_INDEX_GENERATIVE: string
ALGOLIA_INDEX_MARKETPLACE: string
}
}
}
// If this file has no import/export statements (i.e. is a script)
// convert it into a module by adding an empty export statement.
export { }
93 changes: 47 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
{
"name": "fxhash-indexer",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"prod": "tsc && node dist/app.js",
"build": "tsc",
"start": "nodemon --watch \"src/**/*.ts\" --exec \"ts-node --transpile-only\" src/index.ts"
},
"dependencies": {
"@types/request-promise": "^4.1.48",
"algoliasearch": "^4.12.0",
"apollo-server": "^3.3.0",
"apollo-server-express": "^3.3.0",
"apollo-server-plugin-base": "^3.4.0",
"class-validator": "^0.13.1",
"cors": "^2.8.5",
"dataloader": "^2.0.0",
"dotenv": "^10.0.0",
"eventsource": "^1.1.0",
"express": "^4.17.1",
"graphql": "^15.6.1",
"graphql-type-json": "^0.3.2",
"ioredis": "^4.28.2",
"ipfs-core": "^0.11.1",
"pg": "^8.7.1",
"redis": "^4.0.0",
"reflect-metadata": "^0.1.13",
"request": "^2.88.2",
"request-promise": "^4.2.6",
"slugify": "^1.6.2",
"type-graphql": "^1.1.1",
"type-graphql-filter": "^0.4.0",
"typeorm": "^0.2.38",
"uuid": "^8.3.2"
},
"devDependencies": {
"@types/eventsource": "^1.1.7",
"@types/node": "^16.10.3",
"@types/uuid": "^8.3.1",
"nodemon": "^2.0.13",
"ts-node": "^10.2.1",
"typescript": "^4.4.3"
}
}
{
"name": "fxhash-indexer",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"prod": "tsc && node dist/app.js",
"build": "tsc",
"start": "nodemon --watch \"src/**/*.ts\" --exec \"ts-node --transpile-only\" src/index.ts"
},
"dependencies": {
"@types/request-promise": "^4.1.48",
"algoliasearch": "^4.12.0",
"apollo-server": "^3.3.0",
"apollo-server-express": "^3.3.0",
"apollo-server-plugin-base": "^3.4.0",
"class-validator": "^0.13.1",
"cors": "^2.8.5",
"dataloader": "^2.0.0",
"dotenv": "^10.0.0",
"eventsource": "^1.1.0",
"express": "^4.17.1",
"graphql": "^15.6.1",
"graphql-type-json": "^0.3.2",
"ioredis": "^4.28.2",
"ipfs-core": "^0.11.1",
"node-fetch": "^3.3.2",
"pg": "^8.7.1",
"redis": "^4.0.0",
"reflect-metadata": "^0.1.13",
"request": "^2.88.2",
"request-promise": "^4.2.6",
"slugify": "^1.6.2",
"type-graphql": "^1.1.1",
"type-graphql-filter": "^0.4.0",
"typeorm": "^0.2.38",
"uuid": "^8.3.2"
},
"devDependencies": {
"@types/eventsource": "^1.1.7",
"@types/node": "^16.10.3",
"@types/uuid": "^8.3.1",
"nodemon": "^2.0.13",
"ts-node": "^10.2.1",
"typescript": "^4.4.3"
}
}
6 changes: 3 additions & 3 deletions src/DataLoaders/Action.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DataLoader from "dataloader"
import { In } from "typeorm"
import { Action } from "../Entity/Action"
import DataLoader from "dataloader"
import { In } from "typeorm"
import { Action } from "../Entity/Action"
import { Objkt } from "../Entity/Objkt"
Loading