Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize constans and rename OTP to NEURO #3302

Open
wants to merge 8 commits into
base: chore/remove-unsued-things
Choose a base branch
from
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,25 @@ By their nature, Knowledge Assets are semantic resources (following the W3C Sema
<table>
<tr>
<td align="center">
<a href="https://dkg.origintrail.io/explore?ual=did:dkg:otp/0x5cac41237127f94c2d21dae0b14bfefa99880630/309100">
<a href="https://dkg.origintrail.io/explore?ual=did:dkg:neuro/0x5cac41237127f94c2d21dae0b14bfefa99880630/309100">
<img src="images/knowledge-assets-graph1.svg" width="300" alt="Knowledge Assets Graph 1">
</a>
<br><b>Supply Chains</b>
</td>
<td align="center">
<a href="https://dkg.origintrail.io/explore?ual=did:dkg:otp/0x5cac41237127f94c2d21dae0b14bfefa99880630/309285">
<a href="https://dkg.origintrail.io/explore?ual=did:dkg:neuro/0x5cac41237127f94c2d21dae0b14bfefa99880630/309285">
<img src="images/knowledge-assets-graph2.svg" width="300" alt="Knowledge Assets Graph 2">
</a>
<br><b>Construction</b>
</td>
<td align="center">
<a href="https://dkg.origintrail.io/explore?ual=did:dkg:otp/0x5cac41237127f94c2d21dae0b14bfefa99880630/309222">
<a href="https://dkg.origintrail.io/explore?ual=did:dkg:neuro/0x5cac41237127f94c2d21dae0b14bfefa99880630/309222">
<img src="images/knowledge-assets-graph3.svg" width="300" alt="Knowledge Assets Graph 3">
</a>
<br><b>Life sciences and healthcare</b>
</td>
<td align="center">
<a href="https://dkg.origintrail.io/explore?ual=did:dkg:otp/0x5cac41237127f94c2d21dae0b14bfefa99880630/308028">
<a href="https://dkg.origintrail.io/explore?ual=did:dkg:neuro/0x5cac41237127f94c2d21dae0b14bfefa99880630/308028">
<img src="images/knowledge-assets-graph4.svg" width="300" alt="Knowledge Assets Graph 3">
</a>
<br><b>Metaverse</b>
Expand Down
6 changes: 3 additions & 3 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -776,11 +776,11 @@
},
"blockchain": {
"enabled": true,
"defaultImplementation": "otp:2043",
"defaultImplementation": "neuro:2043",
"implementation": {
"otp:2043": {
"neuro:2043": {
"enabled": false,
"package": "./blockchain/implementation/ot-parachain/ot-parachain-service.js",
"package": "./blockchain/implementation/neuroweb/neuroweb-service.js",
"config": {
"hubContractAddress": "0x5fA7916c48Fe6D5F1738d12Ad234b78c90B4cAdA",
"rpcEndpoints": [
Expand Down
12 changes: 6 additions & 6 deletions installer/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ install_node() {

# Set blockchain options based on the selected environment
if [ "$nodeEnv" == "mainnet" ]; then
blockchain_options=("OriginTrail Parachain" "Gnosis" "Base")
otp_blockchain_id=2043
blockchain_options=("Neuroweb" "Gnosis" "Base")
neuroweb_blockchain_id=2043
gnosis_blockchain_id=100
base_blockchain_id=8453
else
blockchain_options=("OriginTrail Parachain" "Gnosis" "Base-Sepolia")
otp_blockchain_id=20430
blockchain_options=("Neuroweb" "Gnosis" "Base-Sepolia")
neuroweb_blockchain_id=20430
gnosis_blockchain_id=10200
base_blockchain_id=84532
fi
Expand Down Expand Up @@ -468,8 +468,8 @@ EOF
# Configure selected blockchains
for blockchain in "${selected_blockchains[@]}"; do
case "$blockchain" in
"OriginTrail Parachain")
configure_blockchain "otp" $otp_blockchain_id
"Neuroweb")
configure_blockchain "neuro" $neuroweb_blockchain_id
;;
"Gnosis")
configure_blockchain "gnosis" $gnosis_blockchain_id
Expand Down
4 changes: 2 additions & 2 deletions ot-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createRequire } from 'module';
import { execSync } from 'child_process';
import DependencyInjection from './src/service/dependency-injection.js';
import Logger from './src/logger/logger.js';
import { MIN_NODE_VERSION, PARANET_ACCESS_POLICY } from './src/constants/constants.js';
import { MIN_NODE_VERSION, PARANET } from './src/constants/constants.js';
import FileService from './src/service/file-service.js';
import OtnodeUpdateCommand from './src/commands/common/otnode-update-command.js';
import OtAutoUpdater from './src/modules/auto-updater/implementation/ot-auto-updater.js';
Expand Down Expand Up @@ -416,7 +416,7 @@ class OTNode {
blockchain,
paranetId,
);
if (nodesAccessPolicy === PARANET_ACCESS_POLICY.CURATED) {
if (nodesAccessPolicy === PARANET.ACCESS_POLICY.CURATED) {
// eslint-disable-next-line no-await-in-loop
const identityId = await blockchainModuleManager.getIdentityId(blockchain);
// eslint-disable-next-line no-await-in-loop
Expand Down
10 changes: 5 additions & 5 deletions scripts/copy-assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs-extra';
import rc from 'rc';
import appRootPath from 'app-root-path';
import path from 'path';
import { TRIPLE_STORE_REPOSITORIES, SCHEMA_CONTEXT } from '../src/constants/constants.js';
import { TRIPLE_STORE, SCHEMA_CONTEXT } from '../src/constants/constants.js';
import TripleStoreModuleManager from '../src/modules/triple-store/triple-store-module-manager.js';
import DataService from '../src/service/data-service.js';
import Logger from '../src/logger/logger.js';
Expand All @@ -29,15 +29,15 @@ for (const implementationName of tripleStoreModuleManager.getImplementationNames
}
}

const fromRepository = TRIPLE_STORE_REPOSITORIES.PUBLIC_CURRENT;
const fromImplementation = repositoryImplementations[TRIPLE_STORE_REPOSITORIES.PUBLIC_CURRENT];
const fromRepository = TRIPLE_STORE.REPOSITORIES.PUBLIC_CURRENT;
const fromImplementation = repositoryImplementations[TRIPLE_STORE.REPOSITORIES.PUBLIC_CURRENT];
const fromRepositoryName =
tripleStoreModuleManager.getImplementation(fromImplementation).module.repositories[
fromRepository
].name;

const toRepository = TRIPLE_STORE_REPOSITORIES.PRIVATE_CURRENT;
const toImplementation = repositoryImplementations[TRIPLE_STORE_REPOSITORIES.PRIVATE_CURRENT];
const toRepository = TRIPLE_STORE.REPOSITORIES.PRIVATE_CURRENT;
const toImplementation = repositoryImplementations[TRIPLE_STORE.REPOSITORIES.PRIVATE_CURRENT];
const toRepositoryName =
tripleStoreModuleManager.getImplementation(toImplementation).module.repositories[toRepository]
.name;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cleaners/blockchain-event-cleaner-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
PROCESSED_BLOCKCHAIN_EVENTS_CLEANUP_TIME_MILLS,
REPOSITORY_ROWS_FOR_REMOVAL_MAX_NUMBER,
PROCESSED_BLOCKCHAIN_EVENTS_CLEANUP_TIME_DELAY,
ARCHIVE_BLOCKCHAIN_EVENTS_FOLDER,
ARCHIVE,
} from '../../constants/constants.js';
import CleanerCommand from './cleaner-command.js';

Expand All @@ -15,7 +15,7 @@ class BlockchainEventCleanerCommand extends CleanerCommand {
}

getArchiveFolderName() {
return ARCHIVE_BLOCKCHAIN_EVENTS_FOLDER;
return ARCHIVE.BLOCKCHAIN_EVENTS_FOLDER;
}

async deleteRows(ids) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cleaners/commands-cleaner-command.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
FINALIZED_COMMAND_CLEANUP_TIME_MILLS,
ARCHIVE_COMMANDS_FOLDER,
ARCHIVE,
REPOSITORY_ROWS_FOR_REMOVAL_MAX_NUMBER,
} from '../../constants/constants.js';
import CleanerCommand from './cleaner-command.js';
Expand All @@ -14,7 +14,7 @@ class CommandsCleanerCommand extends CleanerCommand {
}

getArchiveFolderName() {
return ARCHIVE_COMMANDS_FOLDER;
return ARCHIVE.COMMANDS_FOLDER;
}

async deleteRows(ids) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cleaners/get-cleaner-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OPERATIONS,
GET_CLEANUP_TIME_DELAY,
GET_CLEANUP_TIME_MILLS,
ARCHIVE_GET_FOLDER,
ARCHIVE,
} from '../../constants/constants.js';

class GetCleanerCommand extends CleanerCommand {
Expand All @@ -17,7 +17,7 @@ class GetCleanerCommand extends CleanerCommand {
}

getArchiveFolderName() {
return ARCHIVE_GET_FOLDER;
return ARCHIVE.GET_FOLDER;
}

async deleteRows(ids) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cleaners/get-response-cleaner-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OPERATIONS,
GET_RESPONSE_CLEANUP_TIME_DELAY,
GET_RESPONSE_CLEANUP_TIME_MILLS,
ARCHIVE_GET_RESPONSES_FOLDER,
ARCHIVE,
} from '../../constants/constants.js';

class GetResponseCleanerCommand extends CleanerCommand {
Expand All @@ -17,7 +17,7 @@ class GetResponseCleanerCommand extends CleanerCommand {
}

getArchiveFolderName() {
return ARCHIVE_GET_RESPONSES_FOLDER;
return ARCHIVE.GET_RESPONSES_FOLDER;
}

async deleteRows(ids) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cleaners/publish-cleaner-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OPERATIONS,
PUBLISH_CLEANUP_TIME_DELAY,
PUBLISH_CLEANUP_TIME_MILLS,
ARCHIVE_PUBLISH_FOLDER,
ARCHIVE,
} from '../../constants/constants.js';

class PublishCleanerCommand extends CleanerCommand {
Expand All @@ -17,7 +17,7 @@ class PublishCleanerCommand extends CleanerCommand {
}

getArchiveFolderName() {
return ARCHIVE_PUBLISH_FOLDER;
return ARCHIVE.PUBLISH_FOLDER;
}

async deleteRows(ids) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cleaners/publish-response-cleaner-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OPERATIONS,
PUBLISH_RESPONSE_CLEANUP_TIME_DELAY,
PUBLISH_RESPONSE_CLEANUP_TIME_MILLS,
ARCHIVE_PUBLISH_RESPONSES_FOLDER,
ARCHIVE,
} from '../../constants/constants.js';

class PublishResponseCleanerCommand extends CleanerCommand {
Expand All @@ -17,7 +17,7 @@ class PublishResponseCleanerCommand extends CleanerCommand {
}

getArchiveFolderName() {
return ARCHIVE_PUBLISH_RESPONSES_FOLDER;
return ARCHIVE.PUBLISH_RESPONSES_FOLDER;
}

async deleteRows(ids) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cleaners/update-cleaner-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OPERATIONS,
UPDATE_CLEANUP_TIME_DELAY,
UPDATE_CLEANUP_TIME_MILLS,
ARCHIVE_UPDATE_FOLDER,
ARCHIVE,
} from '../../constants/constants.js';

class UpdateCleanerCommand extends CleanerCommand {
Expand All @@ -17,7 +17,7 @@ class UpdateCleanerCommand extends CleanerCommand {
}

getArchiveFolderName() {
return ARCHIVE_UPDATE_FOLDER;
return ARCHIVE.UPDATE_FOLDER;
}

async deleteRows(ids) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cleaners/update-response-cleaner-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OPERATIONS,
UPDATE_RESPONSE_CLEANUP_TIME_DELAY,
UPDATE_RESPONSE_CLEANUP_TIME_MILLS,
ARCHIVE_UPDATE_RESPONSES_FOLDER,
ARCHIVE,
} from '../../constants/constants.js';

class UpdateResponseCleanerCommand extends CleanerCommand {
Expand All @@ -17,7 +17,7 @@ class UpdateResponseCleanerCommand extends CleanerCommand {
}

getArchiveFolderName() {
return ARCHIVE_UPDATE_RESPONSES_FOLDER;
return ARCHIVE.UPDATE_RESPONSES_FOLDER;
}

async deleteRows(ids) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/common/validate-asset-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ERROR_TYPE,
OPERATION_ID_STATUS,
LOCAL_STORE_TYPES,
ZERO_BYTES32,
EVM_ZERO,
} from '../../constants/constants.js';

class ValidateAssetCommand extends Command {
Expand Down Expand Up @@ -49,7 +49,7 @@ class ValidateAssetCommand extends Command {
tokenId,
);
}
if (!blockchainAssertionId || blockchainAssertionId === ZERO_BYTES32) {
if (!blockchainAssertionId || blockchainAssertionId === EVM_ZERO.BYTES32) {
return Command.retry();
}
const cachedData = await this.operationIdService.getCachedOperationIdData(operationId);
Expand Down
6 changes: 3 additions & 3 deletions src/commands/local-store/local-store-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ERROR_TYPE,
LOCAL_STORE_TYPES,
PENDING_STORAGE_REPOSITORIES,
TRIPLE_STORE_REPOSITORIES,
TRIPLE_STORE,
} from '../../constants/constants.js';
import Command from '../command.js';

Expand Down Expand Up @@ -51,7 +51,7 @@ class LocalStoreCommand extends Command {
if (cachedData.public.assertion && cachedData.public.assertionId) {
storePromises.push(
this.tripleStoreService.localStoreAsset(
TRIPLE_STORE_REPOSITORIES.PRIVATE_CURRENT,
TRIPLE_STORE.REPOSITORIES.PRIVATE_CURRENT,
cachedData.public.assertionId,
cachedData.public.assertion,
blockchain,
Expand All @@ -64,7 +64,7 @@ class LocalStoreCommand extends Command {
if (cachedData.private.assertion && cachedData.private.assertionId) {
storePromises.push(
this.tripleStoreService.localStoreAsset(
TRIPLE_STORE_REPOSITORIES.PRIVATE_CURRENT,
TRIPLE_STORE.REPOSITORIES.PRIVATE_CURRENT,
cachedData.private.assertionId,
cachedData.private.assertion,
blockchain,
Expand Down
Loading
Loading