Skip to content

Commit

Permalink
Merge pull request #2624 from OriginTrail/v6/prerelease/mainnet
Browse files Browse the repository at this point in the history
Mainnet 6.0.11 Release
  • Loading branch information
zeroxbt authored Jun 22, 2023
2 parents 9bdd737 + ca3c20f commit 4c92a61
Show file tree
Hide file tree
Showing 87 changed files with 2,266 additions and 1,039 deletions.
41 changes: 41 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: setup

runs:
using: composite
steps:
- name: Setup NodeJS
id: nodejs
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: npm

- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
${{ runner.os }}-node-modules-
- name: Cache Blazegraph
id: cache-blazegraph
uses: actions/cache@v3
with:
path: blazegraph.jar
key: ${{ runner.os }}-blazegraph-${{ hashFiles('blazegraph.jar') }}
restore-keys: ${{ runner.os }}-blazegraph-

- if: steps.cache-node-modules.outputs.cache-hit != 'true'
name: Install dependencies & compile contracts
shell: bash
run: |
npm ci
npm explore dkg-evm-module -- npm run compile
- if: steps.cache-blazegraph.outputs.cache-hit != 'true'
name: Download Blazegraph
shell: bash
run: wget https://github.com/blazegraph/database/releases/latest/download/blazegraph.jar
32 changes: 0 additions & 32 deletions .github/workflows/CHECK-lint.yml

This file was deleted.

64 changes: 0 additions & 64 deletions .github/workflows/TEST-bdd.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/TEST-unit.yml

This file was deleted.

77 changes: 77 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: checks

on:
pull_request:
branches:
- v6/develop

env:
REPOSITORY_PASSWORD: password
JWT_SECRET: aTx13FzDG+85j9b5s2G7IBEc5SJNJZZLPLe7RF8hu1xKgRKj46YFRx/z7fJi7iF2NnL7SHcxTzq7TySuPKWkdg/AYKEMD2p1I++qPYFHqg8KQeLArGjCYiqtf43i1Fgtya8z9qJXyegogMz/jYori2BJ8v6b4K3GkAw3XxiO7VaaEYktOp8qsRDcN3b+bITMZqztDvZdWp4EnViGjoES7fRFhKm/d/2C8URnQyGm6xgTR3xTfAjy7+milGmoPA0KU0nu+GsZIhOfeVc9Z2nfxOK/1JQykpjeBhNDYTOr31yW/xdvoW0Kq0PZ6JmM+yezLoyQXcYjavZ+X7cXjbREQg==

concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up environment
uses: ./.github/actions/setup

- name: Run linter
run: npm run lint

unit-tests:
runs-on: ubuntu-latest
services:
graphdb:
image: khaller/graphdb-free:latest
ports:
- 7200:7200
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up environment
uses: ./.github/actions/setup

- name: Run unit tests
run: npm run test:unit

bdd-tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: operationaldb
MYSQL_USER: node
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up environment
uses: ./.github/actions/setup

- name: Run Blazegraph
run: /usr/bin/java -Djava.awt.headless=true -jar blazegraph.jar &

- name: Run BDD tests
run: npm run test:bdd

- name: Upload log files
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
name: bdd-test-logs
path: ./test/bdd/log/
3 changes: 1 addition & 2 deletions .github/workflows/release-drafter-config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Release Drafter
name: release-drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- develop

Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/update-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: update-cache

on:
push:
branches:
- v6/develop

concurrency:
group: update-cache-${{ github.ref }}
cancel-in-progress: true

jobs:
build-cache:
name: Build Cache
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up environment
uses: ./.github/actions/setup
19 changes: 19 additions & 0 deletions ot-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import RemoveAgreementStartEndTimeMigration from './src/migration/remove-agreeme
import MarkOldBlockchainEventsAsProcessedMigration from './src/migration/mark-old-blockchain-events-as-processed-migration.js';
import TripleStoreMetadataMigration from './src/migration/triple-store-metadata-migration.js';
import RemoveOldEpochCommandsMigration from './src/migration/remove-old-epoch-commands-migration.js';
import PendingStorageMigration from './src/migration/pending-storage-migration.js';

const require = createRequire(import.meta.url);
const pjson = require('./package.json');
Expand Down Expand Up @@ -58,6 +59,7 @@ class OTNode {
await this.executeTripleStoreMetadataMigration();
await this.executeServiceAgreementsMetadataMigration();
await this.executeRemoveOldEpochCommandsMigration();
await this.executePendingStorageMigration();

await this.createProfiles();

Expand Down Expand Up @@ -421,6 +423,23 @@ class OTNode {
}
}

async executePendingStorageMigration() {
if (
process.env.NODE_ENV === NODE_ENVIRONMENTS.DEVELOPMENT ||
process.env.NODE_ENV === NODE_ENVIRONMENTS.TEST
)
return;

const migration = new PendingStorageMigration(
'pendingStorageMigration',
this.logger,
this.config,
);
if (!(await migration.migrationAlreadyExecuted())) {
await migration.migrate();
}
}

async initializeShardingTableService() {
try {
const shardingTableService = this.container.resolve('shardingTableService');
Expand Down
Loading

0 comments on commit 4c92a61

Please sign in to comment.