Skip to content

Commit

Permalink
Merge branch 'master' into i-913/feat/script-for-PoR
Browse files Browse the repository at this point in the history
  • Loading branch information
bayram98 authored Nov 15, 2023
2 parents d0b0785 + ee5c8e4 commit 85f9604
Show file tree
Hide file tree
Showing 211 changed files with 47,445 additions and 460 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/admin.image+upload.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: ADMIN Deploy to Amazon ECR
name: Admin Deploy to Amazon ECR

on:
pull_request:
push:
branches:
- master
paths:
- "admin/**"
types:
- closed

env:
ecr_url: public.ecr.aws/bisonai/orakl-general
Expand Down Expand Up @@ -35,15 +33,15 @@ jobs:
id: package
run: |
echo "version=$(node -p -e "require('./api/package.json').version")" >> $GITHUB_OUTPUT
build:
name: Build
runs-on: ubuntu-latest
needs: prepare

permissions:
id-token: write
contents: read
contents: read

outputs:
tag_date: ${{ steps.tag.outputs.date }}
Expand All @@ -69,7 +67,7 @@ jobs:
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
registry-type: public

- name: Publish Image to ECR(admin)
run: |
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/api.image+upload.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: API Deploy to Amazon ECR

on:
pull_request:
push:
branches:
- master
paths:
- "api/**"
types:
- closed

env:
ecr_url: public.ecr.aws/bisonai/orakl-api
Expand Down Expand Up @@ -35,15 +33,15 @@ jobs:
id: package
run: |
echo "version=$(node -p -e "require('./api/package.json').version")" >> $GITHUB_OUTPUT
build:
name: Build
runs-on: ubuntu-latest
needs: prepare

permissions:
id-token: write
contents: read
contents: read

outputs:
tag_date: ${{ steps.tag.outputs.date }}
Expand All @@ -65,7 +63,7 @@ jobs:
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
registry-type: public

- name: Publish Image to ECR(api)
run: |
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/cli.image+upload.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: CLI Deploy to Amazon ECR

on:
pull_request:
push:
branches:
- master
paths:
- "cli/**"
types:
- closed

env:
ecr_url: public.ecr.aws/bisonai/orakl-cli
Expand Down Expand Up @@ -43,7 +41,7 @@ jobs:

permissions:
id-token: write
contents: read
contents: read

outputs:
tag_date: ${{ steps.tag.outputs.date }}
Expand All @@ -65,7 +63,7 @@ jobs:
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
registry-type: public

- name: Publish Image to ECR(cli)
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/contracts.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:
- "master"
paths:
- "contracts/**"

- "!contracts/**/VRFCoordinator.sol"
- "!contracts/**/VRFConsumerBase.sol"
- "!contracts/**/vrf/**"
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -28,10 +30,14 @@ jobs:
working-directory: ./contracts
- run: yarn eslint
working-directory: ./contracts
- run: npx hardhat test
- run: npx hardhat test test/v0.1/non-vrf/*.cjs
working-directory: ./contracts
env:
L2_PROVIDER: ${{ secrets.L2_PROVIDER }}
- run: yarn compile
working-directory: ./contracts
env:
L2_PROVIDER: ${{ secrets.L2_PROVIDER }}
- run: yarn build
working-directory: ./contracts
- name: Extract version from package.json
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/core.image+upload.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Core Deploy to Amazon ECR

on:
pull_request:
push:
branches:
- master
paths:
- "core/**"
types:
- closed

env:
ecr_url: public.ecr.aws/bisonai/orakl-core
Expand Down Expand Up @@ -43,7 +41,7 @@ jobs:

permissions:
id-token: write
contents: read
contents: read

outputs:
tag_date: ${{ steps.tag.outputs.date }}
Expand All @@ -65,7 +63,7 @@ jobs:
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
registry-type: public

- name: Publish Image to ECR(core)
run: |
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/delegator.image+upload.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
name: Delegator Deploy to Amazon ECR

on:
pull_request:
push:
branches:
- master
paths:
- "delegator/**"
types:
- closed

push:
branches:
- i-519/delegator-git-actions-building-image

env:
ecr_url: public.ecr.aws/bisonai/orakl-delegator
Expand Down Expand Up @@ -47,7 +41,7 @@ jobs:

permissions:
id-token: write
contents: read
contents: read

outputs:
tag_date: ${{ steps.tag.outputs.date }}
Expand All @@ -57,7 +51,7 @@ jobs:
- uses: actions/checkout@v3

- name: Docker build orakl-core
run: docker-compose -f delegator/docker-compose.build.yaml build
run: docker-compose -f delegator/docker-compose.build.yaml build

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
Expand All @@ -69,7 +63,7 @@ jobs:
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
registry-type: public

- name: Publish Image to ECR(delegator)
run: |
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/fetcher.image+upload.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Fetcher Deploy to Amazon ECR

on:
pull_request:
push:
branches:
- master
paths:
- "fetcher/**"
types:
- closed

env:
ecr_url: public.ecr.aws/bisonai/orakl-fetcher
Expand Down Expand Up @@ -43,7 +41,7 @@ jobs:

permissions:
id-token: write
contents: read
contents: read

outputs:
tag_date: ${{ steps.tag.outputs.date }}
Expand All @@ -65,7 +63,7 @@ jobs:
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
registry-type: public

- name: Publish Image to ECR(fetcher)
run: |
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/monitor.image+upload.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Monitor Deploy to Amazon ECR

on:
pull_request:
push:
branches:
- master
paths:
- "monitor/**"
types:
- closed

env:
ecr_url: public.ecr.aws/bisonai/orakl-general
Expand Down Expand Up @@ -35,15 +33,15 @@ jobs:
id: package
run: |
echo "version=$(node -p -e "require('./package.json').version")" >> $GITHUB_OUTPUT
build:
name: Build
runs-on: ubuntu-latest
needs: prepare

permissions:
id-token: write
contents: read
contents: read

outputs:
tag_date: ${{ steps.tag.outputs.date }}
Expand All @@ -65,7 +63,7 @@ jobs:
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v1
with:
registry-type: public
registry-type: public

- name: Publish Image to ECR
run: |
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/vrf.contracts.test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "vrf contracts: test"

on:
push:
branches-ignore:
- "master"
paths:
- "contracts/**/VRFCoordinator.sol"
- "contracts/**/VRFConsumerBase.sol"
- "contracts/**/vrf/**"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.12"
registry-url: "https://registry.npmjs.org"
scope: "@bisonai"
always-auth: true
- run: yarn
working-directory: ./contracts
- run: yarn prettier-solidity-check
working-directory: ./contracts
- run: yarn solhint
working-directory: ./contracts
- run: yarn eslint
working-directory: ./contracts
- run: npx hardhat test test/v0.1/vrf/*.cjs
working-directory: ./contracts
- run: yarn compile
working-directory: ./contracts
- run: yarn build
working-directory: ./contracts
3 changes: 3 additions & 0 deletions api/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DATABASE_URL=postgresql://${USER}@localhost:5432/orakl?schema=public
APP_PORT=3000
ENCRYPT_PASSWORD=anything
22 changes: 16 additions & 6 deletions api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ datasource db {
}

model Chain {
id BigInt @id @default(autoincrement()) @map("chain_id")
name String @unique
Aggregator Aggregator[]
Listener Listener[]
VrfKey VrfKey[]
Reporter Reporter[]
id BigInt @id @default(autoincrement()) @map("chain_id")
name String @unique
Aggregator Aggregator[]
Listener Listener[]
VrfKey VrfKey[]
Reporter Reporter[]
L2AggregatorPair L2AggregatorPair[]
@@map("chains")
}
Expand Down Expand Up @@ -155,3 +156,12 @@ model Proxy {
@@unique([protocol, host, port])
@@map("proxies")
}

model L2AggregatorPair {
id BigInt @id @default(autoincrement())
l1AggregatorAddress String @map("l1_aggregator_addresss")
l2AggregatorAddress String @map("l2_aggregator_addresss")
active Boolean @default(false)
chainId BigInt @map("chain_id")
chain Chain @relation(fields: [chainId], references: [id])
}
4 changes: 3 additions & 1 deletion api/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { VrfModule } from './vrf/vrf.module'
import { ReporterModule } from './reporter/reporter.module'
import { ErrorModule } from './error/error.module'
import { ProxyModule } from './proxy/proxy.module'
import { L2aggregatorModule } from './l2aggregator/L2aggregator.module';

@Module({
imports: [
Expand All @@ -28,7 +29,8 @@ import { ProxyModule } from './proxy/proxy.module'
VrfModule,
ReporterModule,
ErrorModule,
ProxyModule
ProxyModule,
L2aggregatorModule
],
controllers: [AppController],
providers: [AppService, ConfigService]
Expand Down
Loading

0 comments on commit 85f9604

Please sign in to comment.