Skip to content

Commit

Permalink
Merge pull request #1571 from OriginTrail/prerelease/testnet
Browse files Browse the repository at this point in the history
OriginTrail Testnet Release v5.0.4
  • Loading branch information
djordjekovac authored Jun 7, 2021
2 parents 7d536d6 + 774ae5f commit e4e26b7
Show file tree
Hide file tree
Showing 78 changed files with 1,980 additions and 573 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/TEST-bdd-5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ jobs:
- run: cp .origintrail_noderc.travis .origintrail_noderc
- run: npm run bootstrap
- run: npm run test:bdd -- --tags=@fifth --world-parameters '{"appDataBaseDir":"$CUCUMBER_ARTIFACTS_DIR","keepFailedArtifacts":true}';
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: my-artifact
path: /home/runner/work/ot-node/ot-node/artifacts
15 changes: 7 additions & 8 deletions .github/workflows/TEST-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- run: npm install
- run: mkdir -p $ARTIFACTS_DIR
- run: sudo chmod -R 777 $ARTIFACTS_DIR
- run: mkdir -p $CUCUMBER_ARTIFACTS_DIR
- run: sudo chmod -R 777 $CUCUMBER_ARTIFACTS_DIR
- run: sudo ./setup_arangodb.sh
- run: cp .origintrail_noderc.travis .origintrail_noderc
- run: npm install
- run: npm run ganache > $ARTIFACTS_DIR/ganache.log & npm run truffle:deploy:ganache > $ARTIFACTS_DIR/truffle-migrate.log;
- run: ./test/docker/check_image.sh;
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: my-artifact
path: /home/runner/work/ot-node/ot-node/artifacts
15 changes: 7 additions & 8 deletions .github/workflows/TEST-truffle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- run: npm install
- run: mkdir -p $ARTIFACTS_DIR
- run: sudo chmod -R 777 $ARTIFACTS_DIR
- run: mkdir -p $CUCUMBER_ARTIFACTS_DIR
- run: sudo chmod -R 777 $CUCUMBER_ARTIFACTS_DIR
- run: sudo ./setup_arangodb.sh
- run: cp .origintrail_noderc.travis .origintrail_noderc
- run: npm run truffle:test > $ARTIFACTS_DIR/truffle-test.log;
- run: npm run truffle:deploy:ganache > $ARTIFACTS_DIR/truffle-migrate.log;
- run: npm run ganache > $ARTIFACTS_DIR/run-ganache1.log & npm run truffle:test > $ARTIFACTS_DIR/truffle-test.log;
- run: npm run ganache > $ARTIFACTS_DIR/run-ganache2.log & npm run truffle:deploy:ganache > $ARTIFACTS_DIR/truffle-migrate.log;
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: my-artifact
path: /home/runner/work/ot-node/ot-node/artifacts
16 changes: 7 additions & 9 deletions .github/workflows/TEST-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,28 @@ env:
NODE_ENV: development
ARTIFACTS_DIR: artifacts
CUCUMBER_ARTIFACTS_DIR: artifacts/cucumber
SEQUELIZEDB: artifacts/system.db
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [9.x]
steps:
- run: mkdir -p $ARTIFACTS_DIR
- run: ls -l /home/runner/work/ot-node/ot-node/
- run: mkdir -p $CUCUMBER_ARTIFACTS_DIR
- run: ls -l /home/runner/work/ot-node/ot-node/artifacts
- run: echo hello > $ARTIFACTS_DIR/world.txt
- run: echo hello > $CUCUMBER_ARTIFACTS_DIR/world.txt
- run: cd artifacts && pwd
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: mkdir -p $ARTIFACTS_DIR
- run: sudo chmod -R 777 $ARTIFACTS_DIR
- run: mkdir -p $CUCUMBER_ARTIFACTS_DIR
- run: sudo chmod -R 777 $CUCUMBER_ARTIFACTS_DIR
- run: sudo ./setup_arangodb.sh
- run: cp .origintrail_noderc.travis .origintrail_noderc
- run: npm run lint
- run: npm run test:unit > $ARTIFACTS_DIR/mocha-logs.log
- run: npm run lint > $ARTIFACTS_DIR/lint.log
- run: npm run test > $ARTIFACTS_DIR/unit.log;
- uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ manual-testing-scripts
node.log
keys
data
modules/blockchain_interface/ethereum/build/*
tools/local-network-setup/temporary-config-files
modules/Blockchain/Ethereum/test/development.test.js
modules/Blockchain/Ethereum/build/
modules/Blockchain/XDai/build/
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
OriginTrail Node
================

[![Build Status](https://travis-ci.org/OriginTrail/ot-node.svg?branch=master)](https://travis-ci.org/OriginTrail/ot-node)
[comment]: # (TODO: Insert badges for github builds)
![badge](https://img.shields.io/docker/automated/origintrail/ot-node)

__OriginTrail is an ecosystem dedicated to making global supply chains work together by enabling a universal, collaborative and trusted data exchange.__

This repository contains a work-in-progress code for a network node.

__OriginTrail Decentralized Network (ODN)__ is currently running in the __OriginTrail v4 Freedom-Gemini Mainnet__ stage. For further information about the roadmap please see our [website](https://tech.origintrail.io/roadmap).
__OriginTrail Decentralized Network (ODN)__ is currently running in the __OriginTrail v5 Mainnet__ stage.
For further information about the roadmap please see our [website](https://tech.origintrail.io/roadmap).

[Please see our main documentation page for more information](http://docs.origintrail.io)

Expand All @@ -34,15 +36,15 @@ The key issues OriginTrail tackles are:

The OriginTrail Ecosystem is built on 3 main pillars:

***Neutrality
###Neutrality

Being an open-source, decentralized system, based on open global standards, neutrality is crucial for the OriginTrail ecosystem as it prevents vendor lock-ins, ensures integrity, and effectively breaks data silos. Neutrality means adopting co-creation principles, working with other blockchain ecosystems and solutions builders even as they may be competing in the same market on the application level.

***Usability
###Usability

Both blockchain environments, as well as OriginTrail, are fundamental technologies. In order to ensure the onboarding of enterprises, there needs to be a great focus on enhancing the user experience, as solutions need to meet the expectations of rapid value generation.

***Inclusiveness
###Inclusiveness

Continuing to form partnerships with technological and business global leaders that can employ the OriginTrail ecosystem for their communities. Catering to the needs of leading global communities requires us to be making strides in designing technical infrastructure and business models that support the adoption of the OriginTrail in diverse business communities.

Expand Down
86 changes: 16 additions & 70 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
"implementations": [
{
"blockchain_title": "Ethereum",
"network_id": "development",
"hub_contract_address": "0x2B7ca432a13e0D035BC46F0d6bf3cde1E72A10E5",
"identity_filepath": "erc725_identity.json",
"network_id": "stargazer",
"hub_contract_address": "0x0987197628Bb06133B6FA2409eb4cF9FCaFe8d3a",
"identity_filepath": "stargazer_identity.json",
"gas_limit": "2000000",
"gas_price": "20000000000",
"max_allowed_gas_price" : 100000000000,
Expand All @@ -68,38 +68,13 @@
"node_wallet": "",
"node_private_key": "",
"management_wallet": "",
"plugins": [
{
"enabled": false,
"provider": "Hyperledger",
"name": "fingerprint-plugin",
"config": {
"url": "URL",
"auth": {
"user": "USER",
"pass": "PASS"
}
}
}
]
},
{
"blockchain_title": "xDai",
"network_id": "xdai:testnet",
"rpc_server_url": "https://xdai.poanetwork.dev",
"hub_contract_address": "0x17324BdB37c607c0742e95eFc98973221E1eB9b4",
"identity_filepath": "xdai_erc725_identity.json",
"gas_limit": "2000000",
"gas_price": "1000000000",
"dc_price_factor" : "3",
"dh_price_factor" : "2",
"trac_price_in_base_currency" : "0.4"
"plugins": []
},
{
"blockchain_title": "Ethereum",
"network_id": "ganache_7545",
"hub_contract_address": "0x2B7ca432a13e0D035BC46F0d6bf3cde1E72A10E5",
"identity_filepath": "ganache_7545_erc725_identity.json",
"network_id": "copernicus",
"hub_contract_address": "0x791ee543738B997B7A125bc849005B62aFD35578",
"identity_filepath": "copernicus_identity.json",
"gas_limit": "2000000",
"gas_price": "20000000000",
"max_allowed_gas_price" : 100000000000,
Expand All @@ -109,49 +84,20 @@
"node_wallet": "",
"node_private_key": "",
"management_wallet": "",
"plugins": [
{
"enabled": false,
"provider": "Hyperledger",
"name": "fingerprint-plugin",
"config": {
"url": "URL",
"auth": {
"user": "USER",
"pass": "PASS"
}
}
}
]
"plugins": []
},
{
"blockchain_title": "Ethereum",
"network_id": "ganache_8545",
"hub_contract_address": "0x2B7ca432a13e0D035BC46F0d6bf3cde1E72A10E5",
"identity_filepath": "ganache_8545_erc725_identity.json",
"blockchain_title": "xDai",
"network_id": "xdai:testnet",
"rpc_server_url": "https://xdai.poanetwork.dev",
"hub_contract_address": "0x17324BdB37c607c0742e95eFc98973221E1eB9b4",
"identity_filepath": "xdai_erc725_identity.json",
"gas_limit": "2000000",
"gas_price": "20000000000",
"max_allowed_gas_price" : 100000000000,
"gas_price": "1000000000",
"dc_price_factor" : "3",
"dh_price_factor" : "2",
"trac_price_in_base_currency" : "0.00005",
"node_wallet": "",
"node_private_key": "",
"management_wallet": "",
"plugins": [
{
"enabled": false,
"provider": "Hyperledger",
"name": "fingerprint-plugin",
"config": {
"url": "URL",
"auth": {
"user": "USER",
"pass": "PASS"
}
}
}
]
"trac_price_in_base_currency" : "0.4",
"plugins": []
}
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
up: async (queryInterface) => {
await queryInterface.sequelize.query('DELETE FROM commands WHERE name = \'dhLitigationInitiatedCommand\'');
},
down: async () => { },
};
42 changes: 42 additions & 0 deletions migrations/202106011054103-update-column-types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const constats = require('../modules/constants');

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface
.changeColumn('public_keys', 'public_key', {
type: Sequelize.TEXT,
});
await queryInterface
.changeColumn('public_keys', 'timestamp', {
type: Sequelize.BIGINT,
});
await queryInterface
.changeColumn('offers', 'data_set_id', {
type: Sequelize.STRING,
unique: false,
});
await queryInterface
.changeColumn('offers', 'price_factor_used_for_price_calculation', {
type: Sequelize.STRING,
});
},
down: async (queryInterface, Sequelize) => {
await queryInterface
.changeColumn('public_keys', 'public_key', {
type: Sequelize.STRING,
});
await queryInterface
.changeColumn('public_keys', 'timestamp', {
type: Sequelize.INTEGER,
});
await queryInterface
.changeColumn('offers', 'data_set_id', {
type: Sequelize.STRING,
unique: true,
});
await queryInterface
.changeColumn('offers', 'price_factor_used_for_price_calculation', {
type: Sequelize.INTEGER,
});
},
};
2 changes: 1 addition & 1 deletion models/offers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = (sequelize, DataTypes) => {
number_of_verified_replications: DataTypes.INTEGER,
trac_in_base_currency_used_for_price_calculation: DataTypes.STRING,
gas_price_used_for_price_calculation: DataTypes.STRING,
price_factor_used_for_price_calculation: DataTypes.INTEGER,
price_factor_used_for_price_calculation: DataTypes.STRING,
offer_finalize_transaction_hash: DataTypes.STRING(128),
blockchain_id: DataTypes.STRING,
replication_start_timestamp: DataTypes.STRING,
Expand Down
4 changes: 2 additions & 2 deletions models/public_keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ module.exports = (sequelize, DataTypes) => {
primaryKey: true,
defaultValue: () => uuidv4(),
},
public_key: DataTypes.STRING,
public_key: DataTypes.TEXT,
node_erc: DataTypes.STRING,
node_id: DataTypes.STRING,
timestamp: {
type: DataTypes.INTEGER,
type: DataTypes.BIGINT,
defaultValue: () => Date.now(),
},
}, {});
Expand Down
15 changes: 15 additions & 0 deletions modules/Blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,21 @@ class Blockchain {
return this.pluginService.execute(name, data);
}

/**
* Gets the version variable from a contract, might throw an error if the variable doesn't exist
* @param contractName
* @param blockchain_id
* @param {Boolean} showUninitialized - Return all implementations, not only initialized ones
* @returns {Object} - An object containing the blockchain_id string and the response promise
*/
getContractVersion(contractName, blockchain_id, showUninitialized = false) {
const implementation = this._getImplementationFromId(blockchain_id, showUninitialized);
return {
blockchain_id: implementation.getBlockchainId(),
response: implementation.getContractVersion(contractName),
};
}

/**
* Gets profile by wallet
* @param identity
Expand Down
14 changes: 14 additions & 0 deletions modules/Blockchain/Ethereum/abi/holding.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "version",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
Expand Down
Loading

0 comments on commit e4e26b7

Please sign in to comment.