diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f8ecbe5a4c..3dad05a1ab 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @branarakic @djordjekovac @kotlarmilos @NZT48 @zeroxbt +* @branarakic @djordjekovac @NZT48 @zeroxbt @u-hubar diff --git a/README.md b/README.md index 319b9d61cc..c4fd787499 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,285 @@ -# OriginTrail Decentralized Knowledge Graph network node - OT-Node v6 + +___ -OriginTrail technology is a set of tools and protocols evolving as the semantic layer for Web3, built on the OriginTrail Decentralized Knowledge Graph (DKG). Its function is to empower developers and system integrators utilizing decentralized knowledge exchange supported by emerging standards and DLT networks. +
+
+ + OriginTrail Node Banner + -Version 6 is the latest implementation of OriginTrail Decentralized Knowledge Graph. OriginTrail is currently in the launch procedure. +

OT-Node

-The DKG v6 introduces various improvements to the existing OriginTrail DKG. Among others, it will introduce: - - the Universal Asset Locator (UAL), akin to URLs in Web2 - - improved discoverability, performance and semantic powers with the expanding support for semantic technologies such as RDF, OWL, SPARQL, Triple Pattern Fragments, SHACL and others - - numerous performance updates to the protocol & network implementation +

+
+ OriginTrail Docs + Β· + Report Bug + Β· + Request Feature +

+
-To learn more about OriginTrail v6, check out this blogpost. +
-## Contribution +
+ + Table of Contents + +
    +
  1. + πŸ“š About The Project + +
  2. +
  3. + πŸš€ Getting Started + +
  4. +
  5. πŸ“„ License
  6. +
  7. 🀝 Contributing
  8. +
  9. πŸ“° Social Media
  10. +
+
-OriginTrail software is open source (Apache 2 licence) and open for contributions by anyone. We encourage the developer community to submit [issues](https://github.com/OriginTrail/ot-node/issues) and [pull requests](https://github.com/OriginTrail/ot-node/pulls) for DKG v6 on this repo. Please have the issue/PR name formatted like this for easy navigation: ``` [v6] Issue name goes here ``` +___ -For a live discussion you are welcome to join the OriginTrail tech community in our [Discord](https://discordapp.com/invite/FCgYk2S)! +
-## Launch procedure -The OriginTrail DKG v6 launch is performed in 3 stages: - - Stage 1 which introduces the new network and data layer. The goal of Stage1 is to verify smooth operation of the v6 network and data layer in a public network environment. - - Stage 2 which introduces the incentivisation layer (smart contracts and TRAC token). Stage 2 immediately kicks in once stage 1 KPIs are stable, which will introduce the incentivisation layer, implemented through smart contracts, opening the doors for token delegation, staking and improving several existing mechanisms - - Stage 3 will be focused on performing the migration from v5 to the v6 mainnet. +## πŸ“š About The Project -Throughout the stages the OriginTrail community is invited to participate by actively utilizing the v6 network. Each node will be capable of collecting granular network KPI and telemetry data and publishing it to the DKG itself, further utilized by the core developers to improve the DKG implementation and proceed through the launch stages. For that purpose, there will be a designated reward pool that node runners will be able to collect by submitting relevant network utilization data. All node runners will be motivated to test and utilize their nodes in various creative ways, in order to generate as much quality DKG utilization data to be able to collect rewards. The collected data will include performance metrics, collected error information from bugs occurrences and other. More details on the reward pool distribution among all node runners will be available shortly. +
+ -## Node setup instructions +### **What is the Decentralized Knowledge Graph?** + -Setup instructions are available in the [official documentation](https://docs.origintrail.io/). +
+
+ Knowledge Asset +
+OriginTrail Decentralized Knowledge Graph (DKG), hosted on the OriginTrail Decentralized Network (ODN) as trusted knowledge infrastructure, is shared global Knowledge Graph of Knowledge Assets. Running on the basis of the permissionless multi-chain OriginTrail protocol, it combines blockchains and knowledge graph technology to enable trusted AI applications based on key W3C standards. +
+ +
+ + +### **The OriginTrail DKG Architecture** + + +
+ +The OriginTrail tech stack is a three layer structure, consisting of the multi-chain consensus layer (OriginTrail layer 1, running on multiple blockchains), the Decentralized Knowledge Graph layer (OriginTrail Layer 2, hosted on the ODN) and Trusted Knowledge applications in the application layer. + +
+ DKG Architecture +
+ +Further, the architecture differentiates between **the public, replicated knowledge graph** shared by all network nodes according to the protocol, and **private Knowledge graphs** hosted separately by each of the OriginTrail nodes. + +**Anyone can run an OriginTrail node and become part of the ODN, contributing to the network capacity and hosting the OriginTrail DKG. The OriginTrail node is the ultimate data service for data and knowledge intensive Web3 applications and is used as the key backbone for trusted AI applications (see https://chatdkg.ai)** +
+ +
+ + +### **What is a Knowledge Asset?** + + +
+ +
+ Knowledge Asset +
+ +**Knowledge Asset is the new, AI‑ready resource for the Internet** + +Knowledge Assets are verifiable containers of structured knowledge that live on the OriginTrail DKG and provide: +- **Discoverability - UAL is the new URL**. Uniform Asset Locators (UALs, based on the W3C Decentralized Identifiers) are a new Web3 knowledge identifier (extensions of the Uniform Resource Locators - URLs) which identify a specific piece of knowledge and make it easy to find and connect with other Knowledge Assets. +- **Ownership - NFTs enable ownership**. Each Knowledge Asset contains an NFT token that enables ownership, knowledge asset administration and market mechanisms. +- **Verifiability - On-chain information origin and verifiable trail**. The blockchain tech increases trust, security, transparency, and the traceability of information. + +By their nature, Knowledge Assets are semantic resources (following the W3C Semantic Web set of standards), and through their symbolic representations inherently AI ready. See more at https://chatdkg.ai +
+ +**Discover Knowledge Assets with the DKG Explorer:** +
+ + + + + + + +
+ + Knowledge Assets Graph 1 + +
Supply Chains +
+ + Knowledge Assets Graph 2 + +
Construction +
+ + Knowledge Assets Graph 3 + +
Life sciences and healthcare +
+ + Knowledge Assets Graph 3 + +
Metaverse +
+
+ + +
+ +

(back to top)

+
+ +## πŸš€ Getting Started + +___ + +### Prerequisites + +
+ +- **NodeJS** >= 16.0.0 +- **npm** >= 8.0.0 + +___ +
+ +### Local Network Setup + +
+ +First, clone the repo: +```bash +git clone https://github.com/OriginTrail/ot-node.git +cd ot-node +``` + +Install dependencies using `npm`: +```bash +npm install +``` + +Run the Triple Store. + +To use default Triple Store (`blazegraph`), download the exec file and run it with the following command in the separate process: +```bash +java -server -Xmx4g -jar blazegraph.jar +``` + +Then, depending on the OS, use one of the scripts in order to run the local network with provided number of nodes (minimal amount of nodes should be 12): + +**MacOS** +```bash +bash ./tools/local-network-setup/setup-macos-environment.sh --nodes=12 +``` + +___ +
+ +### DKG Node Setup + +
+ +In order to run a DKG node on the **Testnet** or **Mainnet**, please read the official documentation: https://docs.origintrail.io/decentralized-knowledge-graph-layer-2/node-setup-instructions/setup-instructions-dockerless + +___ +
+ +### Build on DKG + +
+ +The OriginTrail SDKs are client libraries for your applications, used to interact and connect with the OriginTrail Decentralized Knowledge Graph. +From an architectural standpoint, the SDK libraries are application interfaces into the DKG, enabling you to create and manage Knowledge Assets through your apps, as well as perform network queries (such as search, or SPARQL queries), as illustrated below. + +
+ SDK +
+ +The OriginTrail SDK libraries are being built in various languages by the team and the community, as listed below: +- dkg.js - JavaScript SDK implementation + - [Github repository](https://github.com/OriginTrail/dkg.js) + - [Documentation](https://docs.origintrail.io/decentralized-knowledge-graph-layer-2/dkg-sdk/dkg-v6-js-client) +- dkg.py - Python SDK implementation + - [Github repository](https://github.com/OriginTrail/dkg.py) + - [Documentation](https://docs.origintrail.io/decentralized-knowledge-graph-layer-2/dkg-sdk/dkg-v6-py-client) +___ + +
+

(back to top)

+ +## πŸ“„ License + +Distributed under the Apache-2.0 License. See `LICENSE` file for more information. + +
+

(back to top)

+ +## 🀝 Contributing + +Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. + +If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". +Don't forget to give the project a star! Thanks again! + +1. Fork the Project +2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`) +3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`) +4. Push to the Branch (`git push origin feature/AmazingFeature`) +5. Open a Pull Request + +
+

(back to top)

+ +## πŸ“° Social Media + +
+ +
+ + Medium Badge + + + Telegram Badge + + + X Badge + + + YouTube Badge + + + LinkedIn Badge + + + Discord Badge + + + Reddit Badge + + + Coinmarketcap Badge + +
+ +___ diff --git a/images/banner.gif b/images/banner.gif new file mode 100644 index 0000000000..1157a572ff Binary files /dev/null and b/images/banner.gif differ diff --git a/images/dkg-architecture.png b/images/dkg-architecture.png new file mode 100644 index 0000000000..6d787d8163 Binary files /dev/null and b/images/dkg-architecture.png differ diff --git a/images/icons/coinmarketcap.svg b/images/icons/coinmarketcap.svg new file mode 100644 index 0000000000..30d702d700 --- /dev/null +++ b/images/icons/coinmarketcap.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/icons/discord.svg b/images/icons/discord.svg new file mode 100644 index 0000000000..4257d772e3 --- /dev/null +++ b/images/icons/discord.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/images/icons/linkedin.svg b/images/icons/linkedin.svg new file mode 100644 index 0000000000..908c867517 --- /dev/null +++ b/images/icons/linkedin.svg @@ -0,0 +1,4 @@ + + + + diff --git a/images/icons/medium.svg b/images/icons/medium.svg new file mode 100644 index 0000000000..ae6b3edf17 --- /dev/null +++ b/images/icons/medium.svg @@ -0,0 +1,4 @@ + + + + diff --git a/images/icons/reddit.svg b/images/icons/reddit.svg new file mode 100644 index 0000000000..57c919f016 --- /dev/null +++ b/images/icons/reddit.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/images/icons/telegram.svg b/images/icons/telegram.svg new file mode 100644 index 0000000000..d52f2e23d4 --- /dev/null +++ b/images/icons/telegram.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/images/icons/x.svg b/images/icons/x.svg new file mode 100644 index 0000000000..17bf45dca1 --- /dev/null +++ b/images/icons/x.svg @@ -0,0 +1,4 @@ + + + + diff --git a/images/icons/youtube.svg b/images/icons/youtube.svg new file mode 100644 index 0000000000..b9324915bf --- /dev/null +++ b/images/icons/youtube.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/images/ka.png b/images/ka.png new file mode 100644 index 0000000000..7381788ab9 Binary files /dev/null and b/images/ka.png differ diff --git a/images/knowledge-assets-graph1.svg b/images/knowledge-assets-graph1.svg new file mode 100644 index 0000000000..bf7d1fe7f1 --- /dev/null +++ b/images/knowledge-assets-graph1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/images/knowledge-assets-graph2.svg b/images/knowledge-assets-graph2.svg new file mode 100644 index 0000000000..654b0de877 --- /dev/null +++ b/images/knowledge-assets-graph2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/images/knowledge-assets-graph3.svg b/images/knowledge-assets-graph3.svg new file mode 100644 index 0000000000..4482eba946 --- /dev/null +++ b/images/knowledge-assets-graph3.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/images/knowledge-assets-graph4.svg b/images/knowledge-assets-graph4.svg new file mode 100644 index 0000000000..4f30cddb9f --- /dev/null +++ b/images/knowledge-assets-graph4.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/images/nodes.png b/images/nodes.png new file mode 100644 index 0000000000..fac3e0b4ca Binary files /dev/null and b/images/nodes.png differ diff --git a/images/sdk.png b/images/sdk.png new file mode 100644 index 0000000000..4137e15bb4 Binary files /dev/null and b/images/sdk.png differ diff --git a/installer/installer.sh b/installer/installer.sh index ba6a78771b..b9d090e96d 100755 --- a/installer/installer.sh +++ b/installer/installer.sh @@ -87,7 +87,7 @@ install_prereqs() { rm -rf setup_$NODEJS_VER.x perform_step apt update "Updating Ubuntu package repository" perform_step apt-get install nodejs -y "Installing node.js" - perform_step npm install -g npm "Installing npm" + perform_step npm install -g npm@^8 "Installing npm" perform_step install_firewall "Configuring firewall" perform_step apt remove unattended-upgrades -y "Remove unattended upgrades" } @@ -263,9 +263,9 @@ install_node() { perform_step touch $CONFIG_DIR/.origintrail_noderc "Configuring node config file" perform_step $(jq --null-input --arg tripleStore "$tripleStore" '{"logLevel": "trace", "auth": {"ipWhitelist": ["::1", "127.0.0.1"]}}' > $CONFIG_DIR/.origintrail_noderc) "Adding loglevel and auth values to node config file" - perform_step $(jq --arg tripleStore "$tripleStore" --arg tripleStoreUrl "$tripleStoreUrl" '.modules.tripleStore.implementation[$tripleStore] |= + perform_step $(jq --arg tripleStore "$tripleStore" --arg tripleStoreUrl "$tripleStoreUrl" '.modules.tripleStore.implementation[$tripleStore] |= { - "enabled": "true", + "enabled": "true", "config": { "repositories": { "privateCurrent": { @@ -293,24 +293,24 @@ install_node() { "password": "" } } - } + } } + .' $CONFIG_DIR/.origintrail_noderc > $CONFIG_DIR/origintrail_noderc_tmp) "Adding node wallets to node config file 1/2" perform_step mv $CONFIG_DIR/origintrail_noderc_tmp $CONFIG_DIR/.origintrail_noderc "Adding node wallets to node config file 2/2" - - perform_step $(jq --arg blockchain "otp" --arg evmOperationalWallet "$EVM_OPERATIONAL_WALLET" --arg evmOperationalWalletPrivateKey "$EVM_OPERATIONAL_PRIVATE_KEY" --arg evmManagementWallet "$EVM_MANAGEMENT_WALLET" --arg evmManagementWallet "$SHARES_TOKEN_NAME" --arg evmManagementWallet "$SHARES_TOKEN_SYMBOL" --arg sharesTokenName "$SHARES_TOKEN_NAME" --arg sharesTokenSymbol "$SHARES_TOKEN_SYMBOL" '.modules.blockchain.implementation[$blockchain].config |= - { - "evmOperationalWalletPublicKey": $evmOperationalWallet, - "evmOperationalWalletPrivateKey": $evmOperationalWalletPrivateKey, - "evmManagementWalletPublicKey": $evmManagementWallet, - "sharesTokenName": $sharesTokenName, + + perform_step $(jq --arg blockchain "otp" --arg evmOperationalWallet "$EVM_OPERATIONAL_WALLET" --arg evmOperationalWalletPrivateKey "$EVM_OPERATIONAL_PRIVATE_KEY" --arg evmManagementWallet "$EVM_MANAGEMENT_WALLET" --arg evmManagementWallet "$SHARES_TOKEN_NAME" --arg evmManagementWallet "$SHARES_TOKEN_SYMBOL" --arg sharesTokenName "$SHARES_TOKEN_NAME" --arg sharesTokenSymbol "$SHARES_TOKEN_SYMBOL" '.modules.blockchain.implementation[$blockchain].config |= + { + "evmOperationalWalletPublicKey": $evmOperationalWallet, + "evmOperationalWalletPrivateKey": $evmOperationalWalletPrivateKey, + "evmManagementWalletPublicKey": $evmManagementWallet, + "sharesTokenName": $sharesTokenName, "sharesTokenSymbol": $sharesTokenSymbol } + .' $CONFIG_DIR/.origintrail_noderc > $CONFIG_DIR/origintrail_noderc_tmp) "Adding node wallets to node config file 1/2" - + perform_step mv $CONFIG_DIR/origintrail_noderc_tmp $CONFIG_DIR/.origintrail_noderc "Adding node wallets to node config file 2/2" perform_step cp $OTNODE_DIR/installer/data/otnode.service /lib/systemd/system/ "Copying otnode service file" - + systemctl daemon-reload perform_step systemctl enable otnode "Enabling otnode" perform_step systemctl start otnode "Starting otnode" @@ -411,4 +411,4 @@ If the logs do not show and the screen hangs, press ctrl+c to exit the installat " read -p "Press enter to continue..." -journalctl -u otnode --output cat -fn 200 \ No newline at end of file +journalctl -u otnode --output cat -fn 200 diff --git a/package-lock.json b/package-lock.json index cf09c0f316..28d3231823 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "origintrail_node", - "version": "6.0.14", + "version": "6.0.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "origintrail_node", - "version": "6.0.14", + "version": "6.0.15", "license": "ISC", "dependencies": { "@comunica/query-sparql": "^2.4.3", @@ -15569,9 +15569,9 @@ "dev": true }, "node_modules/protobufjs": { - "version": "6.11.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", - "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -31816,9 +31816,9 @@ "dev": true }, "protobufjs": { - "version": "6.11.3", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.3.tgz", - "integrity": "sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "requires": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", diff --git a/package.json b/package.json index c10bb71d29..2c8c7ec700 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "origintrail_node", - "version": "6.0.14", + "version": "6.0.15", "description": "OTNode V6", "main": "index.js", "type": "module", diff --git a/src/constants/constants.js b/src/constants/constants.js index 6b92211067..9458748ae7 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -542,12 +542,6 @@ export const CONTRACT_EVENT_FETCH_INTERVALS = { DEVELOPMENT: 4 * 1000, }; -export const FIXED_GAS_LIMIT_METHODS = { - submitCommit: 600000, - submitUpdateCommit: 600000, - sendProof: 500000, -}; - export const BLOCK_TIME_MILLIS = { OTP: 12_000, HARDHAT: 5_000, diff --git a/src/modules/blockchain/implementation/web3-service.js b/src/modules/blockchain/implementation/web3-service.js index e003f881d8..5759b4d1bf 100644 --- a/src/modules/blockchain/implementation/web3-service.js +++ b/src/modules/blockchain/implementation/web3-service.js @@ -8,7 +8,6 @@ import { DEFAULT_BLOCKCHAIN_EVENT_SYNC_PERIOD_IN_MILLS, MAXIMUM_NUMBERS_OF_BLOCKS_TO_FETCH, TRANSACTION_QUEUE_CONCURRENCY, - FIXED_GAS_LIMIT_METHODS, TRANSACTION_POLLING_TIMEOUT_MILLIS, TRANSACTION_CONFIRMATIONS, BLOCK_TIME_MILLIS, @@ -348,14 +347,7 @@ class Web3Service { while (result === undefined) { try { /* eslint-disable no-await-in-loop */ - let gasLimit; - - if (FIXED_GAS_LIMIT_METHODS[functionName]) { - gasLimit = FIXED_GAS_LIMIT_METHODS[functionName]; - } else { - gasLimit = await contractInstance.estimateGas[functionName](...args); - } - + const gasLimit = await contractInstance.estimateGas[functionName](...args); const gas = gasLimit ?? this.convertToWei(900, 'kwei'); this.logger.info( diff --git a/src/service/sharding-table-service.js b/src/service/sharding-table-service.js index a1200c0deb..87688c0a42 100644 --- a/src/service/sharding-table-service.js +++ b/src/service/sharding-table-service.js @@ -152,6 +152,7 @@ class ShardingTableService { firstAssertionId, hashFunctionId, ) { + const kbSize = assertionSize < BYTES_IN_KILOBYTE ? BYTES_IN_KILOBYTE : assertionSize; const peerRecords = await this.findNeighbourhood( blockchainId, this.blockchainModuleManager.encodePacked( @@ -177,20 +178,13 @@ class ShardingTableService { const r0 = await this.blockchainModuleManager.getR0(blockchainId); - const minBidSuggestion = this.blockchainModuleManager - .toBigNumber(blockchainId, '1') - .mul(epochsNumber) - .mul(r0); - const bidSuggestion = this.blockchainModuleManager .toBigNumber(blockchainId, this.blockchainModuleManager.convertToWei(blockchainId, ask)) - .mul(assertionSize) + .mul(kbSize) .mul(epochsNumber) .mul(r0) .div(BYTES_IN_KILOBYTE); - return bidSuggestion.lte(minBidSuggestion) - ? minBidSuggestion.toString() - : bidSuggestion.toString(); + return bidSuggestion.toString(); } async findEligibleNodes(neighbourhood, bid, r1, r0) { diff --git a/src/service/validation-service.js b/src/service/validation-service.js index a6cd284152..0786db76d0 100644 --- a/src/service/validation-service.js +++ b/src/service/validation-service.js @@ -34,7 +34,6 @@ class ValidationService { this.validateAssertionId(assertion, assertionId); // TODO: get assertion data in one call - await this.validateAssertionSize(blockchain, assertionId, assertion); await this.validateTriplesNumber(blockchain, assertionId, assertion); await this.validateChunkSize(blockchain, assertionId, assertion); @@ -56,7 +55,8 @@ class ValidationService { } const assertionSize = assertionMetadata.getAssertionSizeInBytes(assertion); if (blockchainAssertionSize !== assertionSize) { - throw Error( + // todo after corrective component is implemented, update this logic + this.logger.warn( `Invalid assertion size, value read from blockchain: ${blockchainAssertionSize}, calculated: ${assertionSize}`, ); } @@ -90,7 +90,8 @@ class ValidationService { const calculatedAssertionId = this.validationModuleManager.calculateRoot(assertion); if (assertionId !== calculatedAssertionId) { - throw Error( + // todo after corrective component is implemented, update this logic + this.logger.warn( `Invalid assertion id. Received value: ${assertionId}, calculated: ${calculatedAssertionId}`, ); } diff --git a/test/unit/service/validation-service.test.js b/test/unit/service/validation-service.test.js index 7cb77e625e..69dafd7e39 100644 --- a/test/unit/service/validation-service.test.js +++ b/test/unit/service/validation-service.test.js @@ -49,22 +49,23 @@ describe('Validation service test', async () => { }); it('Tries to validate assertion but fails due to assertion size mismatch', async () => { - let errorThrown = false; - try { - await validationService.validateAssertion( - '0xde58cc52a5ce3a04ae7a05a13176226447ac02489252e4d37a72cbe0aea46b42', - 'hardhat', - { - '@context': 'https://schema.org', - '@id': 'https://tesla.modelX/2321', - '@type': 'Car', - name: 'Tesla Model X', - }, - ); - } catch (error) { - errorThrown = true; - } - expect(errorThrown).to.be.true; + // todo after corrective component is implemented, update this logic + // let errorThrown = false; + // try { + // await validationService.validateAssertion( + // '0xde58cc52a5ce3a04ae7a05a13176226447ac02489252e4d37a72cbe0aea46b42', + // 'hardhat', + // { + // '@context': 'https://schema.org', + // '@id': 'https://tesla.modelX/2321', + // '@type': 'Car', + // name: 'Tesla Model X', + // }, + // ); + // } catch (error) { + // errorThrown = true; + // } + // expect(errorThrown).to.be.true; }); it('Tries to validate assertion but fails due to triple number mismatch', async () => { @@ -136,34 +137,35 @@ describe('Validation service test', async () => { }); it('Tries to validate assertion but fails due to validation manager returning wrong assertion id', async () => { + // todo after corrective component is implemented, update this logic // Will lead to mismatch with passed assertion id - validationService.validationModuleManager.calculateRoot = (assertion) => ''; - - let errorThrown = false; - try { - await validationService.validateAssertion( - '0xde58cc52a5ce3a04ae7a05a13176226447ac02489252e4d37a72cbe0aea46b42', - 'hardhat', - { - '@context': 'https://schema.org', - '@id': 'https://tesla.modelX/2321', - '@type': 'Car', - name: 'Tesla Model X', - brand: { - '@type': 'Brand', - name: 'Tesla', - }, - model: 'Model X', - manufacturer: { - '@type': 'Organization', - name: 'Tesla, Inc.', - }, - fuelType: 'Electric', - }, - ); - } catch (error) { - errorThrown = true; - } - expect(errorThrown).to.be.true; + // validationService.validationModuleManager.calculateRoot = (assertion) => ''; + // + // let errorThrown = false; + // try { + // await validationService.validateAssertion( + // '0xde58cc52a5ce3a04ae7a05a13176226447ac02489252e4d37a72cbe0aea46b42', + // 'hardhat', + // { + // '@context': 'https://schema.org', + // '@id': 'https://tesla.modelX/2321', + // '@type': 'Car', + // name: 'Tesla Model X', + // brand: { + // '@type': 'Brand', + // name: 'Tesla', + // }, + // model: 'Model X', + // manufacturer: { + // '@type': 'Organization', + // name: 'Tesla, Inc.', + // }, + // fuelType: 'Electric', + // }, + // ); + // } catch (error) { + // errorThrown = true; + // } + // expect(errorThrown).to.be.true; }); });