From 40b3180a47bc15a06f786830985627c18b301a37 Mon Sep 17 00:00:00 2001 From: apostolof Date: Wed, 17 Feb 2021 20:05:35 +0200 Subject: [PATCH 1/8] refactor: use env var for ipfs repo path --- packages/concordia-pinner/src/constants.js | 1 + .../src/options/ipfsOptions.js | 42 +++++++++++-------- .../concordia-pinner/src/utils/orbitUtils.js | 1 + 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/packages/concordia-pinner/src/constants.js b/packages/concordia-pinner/src/constants.js index 7bfe01f..6e18d38 100644 --- a/packages/concordia-pinner/src/constants.js +++ b/packages/concordia-pinner/src/constants.js @@ -1,4 +1,5 @@ import path from 'path'; export const ORBIT_DIRECTORY_DEFAULT = path.join(__dirname, '..', 'orbitdb'); +export const IPFS_DIRECTORY_DEFAULT = path.join(__dirname, '..', 'ipfs'); export const LOGS_PATH = path.join(__dirname, '..', 'logs'); diff --git a/packages/concordia-pinner/src/options/ipfsOptions.js b/packages/concordia-pinner/src/options/ipfsOptions.js index 191fffc..56e1fbb 100644 --- a/packages/concordia-pinner/src/options/ipfsOptions.js +++ b/packages/concordia-pinner/src/options/ipfsOptions.js @@ -1,30 +1,36 @@ import getLibp2pBundle from './libp2pBundle'; import { getSwarmAddresses } from '../utils/ipfsUtils'; import { logger } from '../utils/logger'; +import { IPFS_DIRECTORY_DEFAULT } from '../constants'; const getIpfsOptions = async () => getSwarmAddresses() .then((swarmAddresses) => { logger.info(`Swarm addresses used: ${swarmAddresses.join(', ')}`); return swarmAddresses; }) - .then((swarmAddresses) => ({ - repo: 'ipfs', - config: { - Profile: 'server', - Addresses: { - Swarm: swarmAddresses, + .then((swarmAddresses) => { + const IPFS_DIRECTORY = process.env.IPFS_DIRECTORY || IPFS_DIRECTORY_DEFAULT; + logger.info(`Setting up IPFS in repo: ${IPFS_DIRECTORY}`); + + return ({ + repo: IPFS_DIRECTORY, + config: { + Profile: 'server', + Addresses: { + Swarm: swarmAddresses, + }, + }, + libp2p: getLibp2pBundle(swarmAddresses), + EXPERIMENTAL: { + pubsub: true, + }, + preload: { + enabled: false, + }, + init: { + emptyRepo: true, }, - }, - libp2p: getLibp2pBundle(swarmAddresses), - EXPERIMENTAL: { - pubsub: true, - }, - preload: { - enabled: false, - }, - init: { - emptyRepo: true, - }, - })); + }); + }); export default getIpfsOptions; diff --git a/packages/concordia-pinner/src/utils/orbitUtils.js b/packages/concordia-pinner/src/utils/orbitUtils.js index e13877a..d1c3326 100644 --- a/packages/concordia-pinner/src/utils/orbitUtils.js +++ b/packages/concordia-pinner/src/utils/orbitUtils.js @@ -25,6 +25,7 @@ export const createOrbitInstance = async (ipfs, contractAddress) => { EthereumContractIdentityProvider.setContractAddress(contractAddress); const ORBIT_DIRECTORY = process.env.ORBIT_DIRECTORY || ORBIT_DIRECTORY_DEFAULT; + logger.info(`Setting up OrbitDB in directory: ${ORBIT_DIRECTORY}`); return OrbitDB.createInstance(ipfs, { directory: ORBIT_DIRECTORY }); }; From 0cb9b7dc677e7fd4f3e564c8b4b49d2ff77de410 Mon Sep 17 00:00:00 2001 From: apostolof Date: Wed, 17 Feb 2021 20:05:55 +0200 Subject: [PATCH 2/8] fix: use concatenation for long string --- packages/concordia-pinner/src/utils/drizzleUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/concordia-pinner/src/utils/drizzleUtils.js b/packages/concordia-pinner/src/utils/drizzleUtils.js index a5a4649..ec9fa83 100644 --- a/packages/concordia-pinner/src/utils/drizzleUtils.js +++ b/packages/concordia-pinner/src/utils/drizzleUtils.js @@ -12,8 +12,8 @@ function getContractsDownloadRequest() { const HOST = pinnerApiHost; const PORT = pinnerApiPort; - const contractsProviderAddress = `http://${contractsProviderHost}:${contractsProviderPort}/contracts/\ - ${contractsVersionHash}`; + const contractsProviderAddress = `http://${contractsProviderHost}:${contractsProviderPort}/contracts/` + + `${contractsVersionHash}`; const selfAddress = `${HOST}:${PORT}`; logger.info(`Trying contracts provider address: ${contractsProviderAddress}`); From cbbdb8c4d1ac95694b6ef7e7ddcca4c62cea7bcf Mon Sep 17 00:00:00 2001 From: apostolof Date: Wed, 17 Feb 2021 20:24:17 +0200 Subject: [PATCH 3/8] refactor: extract host protocol to env vars --- packages/concordia-app/src/utils/drizzleUtils.js | 2 +- packages/concordia-contracts-provider/src/constants.js | 7 ++++++- .../utils/contractsProviderUtils.js | 2 +- packages/concordia-pinner/src/utils/drizzleUtils.js | 2 +- packages/concordia-pinner/src/utils/ipfsUtils.js | 4 +++- .../src/configuration/breezeConfiguration.js | 2 +- .../src/constants/configuration/defaults.js | 10 +++++----- packages/concordia-shared/src/utils/rendezvous.js | 5 ----- 8 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 packages/concordia-shared/src/utils/rendezvous.js diff --git a/packages/concordia-app/src/utils/drizzleUtils.js b/packages/concordia-app/src/utils/drizzleUtils.js index 269d89f..d4f288f 100755 --- a/packages/concordia-app/src/utils/drizzleUtils.js +++ b/packages/concordia-app/src/utils/drizzleUtils.js @@ -20,7 +20,7 @@ function getContractsDownloadRequest() { const xhrRequest = new XMLHttpRequest(); xhrRequest.open('GET', - `http://${contractsProviderHost}:${contractsProviderPort}/contracts/${contractsVersionHash}`, + `${contractsProviderHost}:${contractsProviderPort}/contracts/${contractsVersionHash}`, false); xhrRequest.setRequestHeader('Access-Control-Allow-Origin', `${HOST}:${PORT}`); xhrRequest.setRequestHeader('Access-Control-Allow-Credentials', 'true'); diff --git a/packages/concordia-contracts-provider/src/constants.js b/packages/concordia-contracts-provider/src/constants.js index fff76bd..24143a5 100755 --- a/packages/concordia-contracts-provider/src/constants.js +++ b/packages/concordia-contracts-provider/src/constants.js @@ -1,7 +1,12 @@ import path from 'path'; const UPLOAD_CONTRACTS_DIRECTORY = path.join(__dirname, '..', 'contracts-uploads'); -const CORS_ALLOWED_ORIGINS = ['http://127.0.0.1:7000', 'http://localhost:7000']; +const CORS_ALLOWED_ORIGINS = [ + 'http://127.0.0.1:7000', 'http://localhost:7000', + 'https://127.0.0.1:7000', 'https://localhost:7000', + 'http://127.0.0.1:4444', 'http://localhost:4444', + 'https://127.0.0.1:4444', 'https://localhost:4444', +]; const LOGS_PATH = path.join(__dirname, '..', 'logs'); export default { diff --git a/packages/concordia-contracts/utils/contractsProviderUtils.js b/packages/concordia-contracts/utils/contractsProviderUtils.js index 5777da1..74f038e 100644 --- a/packages/concordia-contracts/utils/contractsProviderUtils.js +++ b/packages/concordia-contracts/utils/contractsProviderUtils.js @@ -5,7 +5,7 @@ const { contractsProviderPort } = require('concordia-shared/src/environment/inte const { contracts } = require('../index'); const uploadContractsToProviderUnirest = (versionHash, tag) => { - const uploadPath = `http://${contractsProviderHost}:${contractsProviderPort}/contracts/${versionHash}`; + const uploadPath = `${contractsProviderHost}:${contractsProviderPort}/contracts/${versionHash}`; const request = unirest('POST', uploadPath) .field('tag', tag); diff --git a/packages/concordia-pinner/src/utils/drizzleUtils.js b/packages/concordia-pinner/src/utils/drizzleUtils.js index ec9fa83..7ff5f0b 100644 --- a/packages/concordia-pinner/src/utils/drizzleUtils.js +++ b/packages/concordia-pinner/src/utils/drizzleUtils.js @@ -12,7 +12,7 @@ function getContractsDownloadRequest() { const HOST = pinnerApiHost; const PORT = pinnerApiPort; - const contractsProviderAddress = `http://${contractsProviderHost}:${contractsProviderPort}/contracts/` + const contractsProviderAddress = `${contractsProviderHost}:${contractsProviderPort}/contracts/` + `${contractsVersionHash}`; const selfAddress = `${HOST}:${PORT}`; diff --git a/packages/concordia-pinner/src/utils/ipfsUtils.js b/packages/concordia-pinner/src/utils/ipfsUtils.js index fabc85f..4a8ffe3 100644 --- a/packages/concordia-pinner/src/utils/ipfsUtils.js +++ b/packages/concordia-pinner/src/utils/ipfsUtils.js @@ -9,4 +9,6 @@ export const getResolvedRendezvousUrl = async () => dnsLookup(rendezvousHost, { .catch((error) => logger.error(new Error(`DNS lookup of ${rendezvousHost} failed.\n${error}`))); export const getSwarmAddresses = async () => getResolvedRendezvousUrl() - .then((resolvedRendezvousUrl) => [`/ip4/${resolvedRendezvousUrl.address}/tcp/${rendezvousPort}/wss/p2p-webrtc-star`]); + .then((resolvedRendezvousUrl) => [ + `${resolvedRendezvousUrl.address}/tcp/${rendezvousPort}/wss/p2p-webrtc-star`, + ]); diff --git a/packages/concordia-shared/src/configuration/breezeConfiguration.js b/packages/concordia-shared/src/configuration/breezeConfiguration.js index e1ab0e0..e936ebe 100644 --- a/packages/concordia-shared/src/configuration/breezeConfiguration.js +++ b/packages/concordia-shared/src/configuration/breezeConfiguration.js @@ -9,7 +9,7 @@ const getBreezeConfiguration = (identityProvider) => ({ Swarm: [ // Use local signaling server (see also rendezvous script in package.json) // For more information: https://github.com/libp2p/js-libp2p-webrtc-star - `/ip4/${rendezvousHost}/tcp/${rendezvousPort}/wss/p2p-webrtc-star`, + `${rendezvousHost}/tcp/${rendezvousPort}/wss/p2p-webrtc-star`, // Use the following public servers if needed // '/dns4/wrtc-star1.par.dwebops.pub/tcp/443/wss/p2p-webrtc-star', diff --git a/packages/concordia-shared/src/constants/configuration/defaults.js b/packages/concordia-shared/src/constants/configuration/defaults.js index 6c68265..51f07c4 100644 --- a/packages/concordia-shared/src/constants/configuration/defaults.js +++ b/packages/concordia-shared/src/constants/configuration/defaults.js @@ -1,20 +1,20 @@ // Contracts provider -const CONTRACTS_PROVIDER_HOST_DEFAULT = '127.0.0.1'; +const CONTRACTS_PROVIDER_HOST_DEFAULT = 'http://127.0.0.1'; const CONTRACTS_PROVIDER_PORT_DEFAULT = '8400'; const CONTRACTS_VERSION_HASH_DEFAULT = 'latest'; // Pinner -const PINNER_API_HOST_DEFAULT = '127.0.0.1'; +const PINNER_API_HOST_DEFAULT = 'http://127.0.0.1'; const PINNER_API_PORT_DEFAULT = 4444; // Rendezvous -const RENDEZVOUS_HOST_DEFAULT = '127.0.0.1'; +const RENDEZVOUS_HOST_DEFAULT = '/ip4/127.0.0.1'; const RENDEZVOUS_PORT_DEFAULT = '9090'; // Web3 (probably ganache) -const WEB3_HOST_DEFAULT = '127.0.0.1'; +const WEB3_HOST_DEFAULT = 'http://127.0.0.1'; const WEB3_PORT_DEFAULT = '8545'; -const WEB3_HOST_TEST_DEFAULT = '127.0.0.1'; +const WEB3_HOST_TEST_DEFAULT = 'http://127.0.0.1'; const WEB3_PORT_TEST_DEFAULT = '8546'; const WEB3_PORT_SOCKET_TIMEOUT_DEFAULT = 30000; const WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS_DEFAULT = 3; diff --git a/packages/concordia-shared/src/utils/rendezvous.js b/packages/concordia-shared/src/utils/rendezvous.js deleted file mode 100644 index 8d862fc..0000000 --- a/packages/concordia-shared/src/utils/rendezvous.js +++ /dev/null @@ -1,5 +0,0 @@ -const { rendezvousHost, rendezvousPort } = require('../environment/interpolated/rendezvous'); - -const getRendezvousUrl = () => `http://${rendezvousHost}:${rendezvousPort}`; - -module.exports = getRendezvousUrl; From e245364f038b34749790ce8a37309105d555325f Mon Sep 17 00:00:00 2001 From: apostolof Date: Wed, 17 Feb 2021 20:40:58 +0200 Subject: [PATCH 4/8] fix: remove protocol from web3 host --- .../concordia-shared/src/constants/configuration/defaults.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/concordia-shared/src/constants/configuration/defaults.js b/packages/concordia-shared/src/constants/configuration/defaults.js index 51f07c4..4fc34a3 100644 --- a/packages/concordia-shared/src/constants/configuration/defaults.js +++ b/packages/concordia-shared/src/constants/configuration/defaults.js @@ -12,9 +12,9 @@ const RENDEZVOUS_HOST_DEFAULT = '/ip4/127.0.0.1'; const RENDEZVOUS_PORT_DEFAULT = '9090'; // Web3 (probably ganache) -const WEB3_HOST_DEFAULT = 'http://127.0.0.1'; +const WEB3_HOST_DEFAULT = '127.0.0.1'; const WEB3_PORT_DEFAULT = '8545'; -const WEB3_HOST_TEST_DEFAULT = 'http://127.0.0.1'; +const WEB3_HOST_TEST_DEFAULT = '127.0.0.1'; const WEB3_PORT_TEST_DEFAULT = '8546'; const WEB3_PORT_SOCKET_TIMEOUT_DEFAULT = 30000; const WEB3_PORT_SOCKET_CONNECT_MAX_ATTEMPTS_DEFAULT = 3; From 62d613d730727fdd335b4aeec034c62bba1ef9e3 Mon Sep 17 00:00:00 2001 From: apostolof Date: Wed, 17 Feb 2021 22:05:24 +0200 Subject: [PATCH 5/8] fix: resolve rendezvous host only when docker prefix used --- .../concordia-pinner/src/options/ipfsOptions.js | 3 +-- packages/concordia-pinner/src/utils/ipfsUtils.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/concordia-pinner/src/options/ipfsOptions.js b/packages/concordia-pinner/src/options/ipfsOptions.js index 56e1fbb..e32f5f8 100644 --- a/packages/concordia-pinner/src/options/ipfsOptions.js +++ b/packages/concordia-pinner/src/options/ipfsOptions.js @@ -7,8 +7,7 @@ const getIpfsOptions = async () => getSwarmAddresses() .then((swarmAddresses) => { logger.info(`Swarm addresses used: ${swarmAddresses.join(', ')}`); return swarmAddresses; - }) - .then((swarmAddresses) => { + }).then((swarmAddresses) => { const IPFS_DIRECTORY = process.env.IPFS_DIRECTORY || IPFS_DIRECTORY_DEFAULT; logger.info(`Setting up IPFS in repo: ${IPFS_DIRECTORY}`); diff --git a/packages/concordia-pinner/src/utils/ipfsUtils.js b/packages/concordia-pinner/src/utils/ipfsUtils.js index 4a8ffe3..3491c5f 100644 --- a/packages/concordia-pinner/src/utils/ipfsUtils.js +++ b/packages/concordia-pinner/src/utils/ipfsUtils.js @@ -5,10 +5,17 @@ import { logger } from './logger'; const dnsLookup = util.promisify(dns.lookup); -export const getResolvedRendezvousUrl = async () => dnsLookup(rendezvousHost, { family: 4 }) - .catch((error) => logger.error(new Error(`DNS lookup of ${rendezvousHost} failed.\n${error}`))); +export const getResolvedRendezvousUrl = async () => { + if (rendezvousHost.startsWith('/docker/')) { + return dnsLookup(rendezvousHost.substring('/docker/'.length), { family: 4 }) + .then((resolvedDomain) => `/ip4/${resolvedDomain.address}`) + .catch((error) => logger.error(new Error(`DNS lookup of ${rendezvousHost} failed.\n${error}`))); + } + + return Promise.resolve(rendezvousHost); +}; export const getSwarmAddresses = async () => getResolvedRendezvousUrl() - .then((resolvedRendezvousUrl) => [ - `${resolvedRendezvousUrl.address}/tcp/${rendezvousPort}/wss/p2p-webrtc-star`, + .then((resolvedRendezvousHost) => [ + `${resolvedRendezvousHost}/tcp/${rendezvousPort}/wss/p2p-webrtc-star`, ]); From 10d6cdda1a1edf018f59acc2bc69f53bcd85aa1f Mon Sep 17 00:00:00 2001 From: apostolof Date: Wed, 17 Feb 2021 22:18:39 +0200 Subject: [PATCH 6/8] fix: update rendezvous docker image used --- docker/Makefile | 2 +- docker/docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index 9e9ec61..c5a6b9e 100755 --- a/docker/Makefile +++ b/docker/Makefile @@ -34,7 +34,7 @@ run-ganache-test: # Rendezvous targets run-rendezvous: - @docker run -d -p 9090:9090 --name concordia-rendezvous --net=concordia_concordia_network libp2p/js-libp2p-webrtc-star:version-0.20.5 + @docker run -d -p 9090:9090 --name concordia-rendezvous --net=concordia_concordia_network libp2p/js-libp2p-webrtc-star:version-0.21.1 # Contracts targets build-contracts: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index db5f1ea..d6eaf70 100755 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -21,7 +21,7 @@ services: restart: always rendezvous: - image: libp2p/js-libp2p-webrtc-star:version-0.20.5 + image: libp2p/js-libp2p-webrtc-star:version-0.21.1 container_name: concordia-rendezvous networks: concordia_network: From 3a68f69e4846ff6009f2c1e6b2bea89fae13a772 Mon Sep 17 00:00:00 2001 From: apostolof Date: Wed, 17 Feb 2021 22:18:56 +0200 Subject: [PATCH 7/8] fix: final fixes for local runs --- docker/Makefile | 12 ++++++------ docker/env/concordia.env | 2 +- docker/env/contracts-provider.env | 1 + docker/env/contracts.env | 2 +- docker/env/pinner.env | 8 +++++--- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docker/Makefile b/docker/Makefile index c5a6b9e..679592f 100755 --- a/docker/Makefile +++ b/docker/Makefile @@ -74,21 +74,21 @@ run-app-host-chain: build-contracts-provider: @docker build ../ -f ./concordia-contracts-provider/Dockerfile -t ecentrics/concordia-contracts-provider --build-arg TZ=Europe/Athens run-contracts-provider-staging: - @docker run -d -v ${CONTRACTS_PROVIDER_VOLUMES}/contracts:/mnt/concordia/contracts -v ${CONTRACTS_PROVIDER_VOLUMES}/contracts:/mnt/concordia/logs --env-file=./env/contracts-provider.env -p 8400:8400 --name concordia-contracts-provider --net=concordia_concordia_network ecentrics/concordia-contracts-provider:latest + @docker run -d -v ${CONTRACTS_PROVIDER_VOLUMES}:/mnt/concordia --env-file=./env/contracts-provider.env -p 8400:8400 --name concordia-contracts-provider --net=concordia_concordia_network ecentrics/concordia-contracts-provider:latest run-contracts-provider: - @docker run -d -v ${CONTRACTS_PROVIDER_VOLUMES}/contracts:/mnt/concordia/contracts -v ${CONTRACTS_PROVIDER_VOLUMES}/contracts:/mnt/concordia/logs --env-file=./env/contracts-provider.env -e NODE_ENV=production -p 8400:8400 --name concordia-contracts-provider --net=concordia_concordia_network ecentrics/concordia-contracts-provider:latest + @docker run -d -v ${CONTRACTS_PROVIDER_VOLUMES}:/mnt/concordia --env-file=./env/contracts-provider.env -e NODE_ENV=production -p 8400:8400 --name concordia-contracts-provider --net=concordia_concordia_network ecentrics/concordia-contracts-provider:latest # Pinner targets build-pinner: @docker build ../ -f ./concordia-pinner/Dockerfile -t ecentrics/concordia-pinner --build-arg TZ=Europe/Athens run-pinner-staging: - @docker run -d -v ${PINNER_VOLUMES}/orbitdb:/mnt/concordia/orbitdb -v ${PINNER_VOLUMES}:/mnt/concordia/logs --env-file=./env/pinner.env -p 4444:4444 --name concordia-pinner --net=concordia_concordia_network ecentrics/concordia-pinner:latest + @docker run -d -v ${PINNER_VOLUMES}:/mnt/concordia --env-file=./env/pinner.env -p 4444:4444 --name concordia-pinner --net=concordia_concordia_network ecentrics/concordia-pinner:latest run-pinner: - @docker run -d -v ${PINNER_VOLUMES}/orbitdb:/mnt/concordia/orbitdb -v ${PINNER_VOLUMES}:/mnt/concordia/logs --env-file=./env/pinner.env -e NODE_ENV=production -p 4444:4444 --name concordia-pinner --net=concordia_concordia_network ecentrics/concordia-pinner:latest + @docker run -d -v ${PINNER_VOLUMES}:/mnt/concordia --env-file=./env/pinner.env -e NODE_ENV=production -p 4444:4444 --name concordia-pinner --net=concordia_concordia_network ecentrics/concordia-pinner:latest run-pinner-staging-host: - @docker run -d -v ${PINNER_VOLUMES}/orbitdb:/mnt/concordia/orbitdb -v ${PINNER_VOLUMES}:/mnt/concordia/logs --env-file=./env/pinner.env --net=host --name concordia-pinner ecentrics/concordia-pinner:latest + @docker run -d -v ${PINNER_VOLUMES}:/mnt/concordia --env-file=./env/pinner.env --net=host --name concordia-pinner ecentrics/concordia-pinner:latest run-pinner-host: - @docker run -d -v ${PINNER_VOLUMES}/orbitdb:/mnt/concordia/orbitdb -v ${PINNER_VOLUMES}:/mnt/concordia/logs --env-file=./env/pinner.env -e NODE_ENV=production --net=host --name concordia-pinner ecentrics/concordia-pinner:latest + @docker run -d -v ${PINNER_VOLUMES}:/mnt/concordia --env-file=./env/pinner.env -e NODE_ENV=production --net=host --name concordia-pinner ecentrics/concordia-pinner:latest # Other clean-images: diff --git a/docker/env/concordia.env b/docker/env/concordia.env index 42652e7..4f270ad 100755 --- a/docker/env/concordia.env +++ b/docker/env/concordia.env @@ -1,4 +1,4 @@ # Variables needed in runtime (in browser) -REACT_APP_RENDEZVOUS_HOST=127.0.0.1 +REACT_APP_RENDEZVOUS_HOST=/ip4/127.0.0.1 REACT_APP_RENDEZVOUS_PORT=9090 USE_EXTERNAL_CONTRACTS_PROVIDER=true diff --git a/docker/env/contracts-provider.env b/docker/env/contracts-provider.env index 9d43b56..bb882ef 100644 --- a/docker/env/contracts-provider.env +++ b/docker/env/contracts-provider.env @@ -1,2 +1,3 @@ UPLOAD_CONTRACTS_DIRECTORY=/mnt/concordia/contracts/ LOGS_PATH=/mnt/concordia/logs/ +#CORS_ALLOWED_ORIGINS="http://127.0.0.1:7000;http://localhost:7000;http://127.0.0.1:4444;127.0.0.1:4444" diff --git a/docker/env/contracts.env b/docker/env/contracts.env index 4e68772..c1f2ed9 100755 --- a/docker/env/contracts.env +++ b/docker/env/contracts.env @@ -3,6 +3,6 @@ MIGRATE_NETWORK=env WEB3_HOST=concordia-ganache WEB3_PORT=8545 -CONTRACTS_PROVIDER_HOST=concordia-contracts-provider +CONTRACTS_PROVIDER_HOST=http://concordia-contracts-provider CONTRACTS_PROVIDER_PORT=8400 CONTRACTS_VERSION_TAG=docker diff --git a/docker/env/pinner.env b/docker/env/pinner.env index 65b605e..e59052d 100644 --- a/docker/env/pinner.env +++ b/docker/env/pinner.env @@ -1,15 +1,17 @@ USE_EXTERNAL_CONTRACTS_PROVIDER=true +IPFS_DIRECTORY=/mnt/concordia/ipfs ORBIT_DIRECTORY=/mnt/concordia/orbitdb LOGS_PATH=/mnt/concordia/logs/ -CONTRACTS_PROVIDER_HOST=concordia-contracts-provider +CONTRACTS_PROVIDER_HOST=http://concordia-contracts-provider CONTRACTS_PROVIDER_PORT=8400 -CONTRACTS_VERSION_HASH=latest +CONTRACTS_VERSION_HASH=docker PINNER_API_HOST=127.0.0.1 PINNER_API_PORT=4444 -RENDEZVOUS_HOST=concordia-rendezvous +RENDEZVOUS_HOST=/docker/concordia-rendezvous +#RENDEZVOUS_HOST=/ip4/172.20.0.2 RENDEZVOUS_PORT=9090 WEB3_HOST=concordia-ganache From 13724e04c2108d6448b2a58450168c5993c7a672 Mon Sep 17 00:00:00 2001 From: apostolof Date: Wed, 17 Feb 2021 22:39:37 +0200 Subject: [PATCH 8/8] fix: update production envs --- docker/env/pinner.env | 1 - jenkins/Jenkinsfile | 16 ++++++++-------- jenkins/env/concordia.production.jenkins.env | 6 +++--- jenkins/env/concordia.staging.jenkins.env | 6 +++--- jenkins/env/contracts.production.jenkins.env | 2 +- jenkins/env/contracts.provider.production.env | 3 ++- jenkins/env/contracts.provider.staging.env | 3 ++- jenkins/env/contracts.staging.jenkins.env | 2 +- jenkins/env/pinner.production.jenkins.env | 8 +++++--- jenkins/env/pinner.staging.jenkins.env | 8 +++++--- 10 files changed, 30 insertions(+), 25 deletions(-) diff --git a/docker/env/pinner.env b/docker/env/pinner.env index e59052d..0c7f948 100644 --- a/docker/env/pinner.env +++ b/docker/env/pinner.env @@ -11,7 +11,6 @@ PINNER_API_HOST=127.0.0.1 PINNER_API_PORT=4444 RENDEZVOUS_HOST=/docker/concordia-rendezvous -#RENDEZVOUS_HOST=/ip4/172.20.0.2 RENDEZVOUS_PORT=9090 WEB3_HOST=concordia-ganache diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile index eb980d3..a4eda81 100755 --- a/jenkins/Jenkinsfile +++ b/jenkins/Jenkinsfile @@ -449,7 +449,7 @@ pipeline { -p 9090:9090 \ --name concordia-rendezvous \ --net=ecentrics_concordia_staging_network \ - libp2p/js-libp2p-webrtc-star:version-0.20.5' + libp2p/js-libp2p-webrtc-star:version-0.21.1' } else { sh 'docker network connect ecentrics_concordia_staging_network concordia-rendezvous || true' } @@ -476,7 +476,7 @@ pipeline { sh (script: """docker run \ -d \ - -v concordia-contracts-provider-staging:/mnt/concordia/contracts \ + -v concordia-contracts-provider-staging:/mnt/concordia \ --env-file=./jenkins/env/contracts.provider.staging.env \ -p 8450:8450 \ --name concordia-contracts-provider-staging \ @@ -503,7 +503,7 @@ pipeline { sh (script: 'docker run \ -d \ - -v concordia-ganache-staging:/mnt/concordia/ganache_keys \ + -v concordia-ganache-staging:/mnt/concordia \ -p 8555:8555 \ --env-file=./jenkins/env/ganache.staging.jenkins.env \ --name concordia-ganache-staging \ @@ -556,7 +556,7 @@ pipeline { sh """docker run \ -d \ - -v concordia-pinner-staging:/mnt/concordia/orbitdb \ + -v concordia-pinner-staging:/mnt/concordia/ \ -p 5555:5555 \ --env-file=./jenkins/env/pinner.staging.jenkins.env \ --name concordia-pinner-staging \ @@ -613,7 +613,7 @@ pipeline { -p 9090:9090 \ --name concordia-rendezvous \ --net=ecentrics_concordia_production_network \ - libp2p/js-libp2p-webrtc-star:version-0.20.5' + libp2p/js-libp2p-webrtc-star:version-0.21.1' } else { sh 'docker network connect ecentrics_concordia_production_network concordia-rendezvous || true' } @@ -640,7 +640,7 @@ pipeline { sh (script: """docker run \ -d \ - -v concordia-contracts-provider-production:/mnt/concordia/contracts \ + -v concordia-contracts-provider-production:/mnt/concordia \ --env-file=./jenkins/env/contracts.provider.production.env \ -e NODE_ENV=production \ -p 8400:8400 \ @@ -668,7 +668,7 @@ pipeline { sh (script: 'docker run \ -d \ - -v concordia-ganache-production:/mnt/concordia/ganache_keys \ + -v concordia-ganache-production:/mnt/concordia \ -p 8545:8545 \ --env-file=./jenkins/env/ganache.production.jenkins.env \ --name concordia-ganache-production \ @@ -721,7 +721,7 @@ pipeline { sh """docker run \ -d \ - -v concordia-pinner-production:/mnt/concordia/orbitdb \ + -v concordia-pinner-production:/mnt/concordia \ -p 4444:4444 \ -e NODE_ENV=production \ --env-file=./jenkins/env/pinner.production.jenkins.env \ diff --git a/jenkins/env/concordia.production.jenkins.env b/jenkins/env/concordia.production.jenkins.env index 9dc3550..e41a5c5 100755 --- a/jenkins/env/concordia.production.jenkins.env +++ b/jenkins/env/concordia.production.jenkins.env @@ -4,13 +4,13 @@ LETSENCRYPT_HOST=concordia.ecentrics.net LETSENCRYPT_EMAIL=ecentricsgr@gmail.com # Variables needed in runtime (in browser) -REACT_APP_CONCORDIA_HOST=concordia.ecentrics.net +REACT_APP_CONCORDIA_HOST=https://concordia.ecentrics.net REACT_APP_CONCORDIA_PORT=7777 -REACT_APP_RENDEZVOUS_HOST=rendezvous.ecentrics.net +REACT_APP_RENDEZVOUS_HOST=/dns4/rendezvous.ecentrics.net REACT_APP_RENDEZVOUS_PORT=9090 REACT_APP_USE_EXTERNAL_CONTRACTS_PROVIDER=true -REACT_APP_CONTRACTS_PROVIDER_HOST=contracts.concordia.ecentrics.net +REACT_APP_CONTRACTS_PROVIDER_HOST=https://contracts.concordia.ecentrics.net REACT_APP_CONTRACTS_PROVIDER_PORT=8400 REACT_APP_CONTRACTS_VERSION_HASH=stable diff --git a/jenkins/env/concordia.staging.jenkins.env b/jenkins/env/concordia.staging.jenkins.env index 49278b2..9a6c237 100755 --- a/jenkins/env/concordia.staging.jenkins.env +++ b/jenkins/env/concordia.staging.jenkins.env @@ -4,13 +4,13 @@ LETSENCRYPT_HOST=staging.concordia.ecentrics.net LETSENCRYPT_EMAIL=ecentricsgr@gmail.com # Variables needed in runtime (in browser) -REACT_APP_CONCORDIA_HOST=staging.concordia.ecentrics.net +REACT_APP_CONCORDIA_HOST=https://staging.concordia.ecentrics.net REACT_APP_CONCORDIA_PORT=7000 -REACT_APP_RENDEZVOUS_HOST=rendezvous.ecentrics.net +REACT_APP_RENDEZVOUS_HOST=/dns4/rendezvous.ecentrics.net REACT_APP_RENDEZVOUS_PORT=9090 REACT_APP_USE_EXTERNAL_CONTRACTS_PROVIDER=true -REACT_APP_CONTRACTS_PROVIDER_HOST=staging.contracts.concordia.ecentrics.net +REACT_APP_CONTRACTS_PROVIDER_HOST=https://staging.contracts.concordia.ecentrics.net REACT_APP_CONTRACTS_PROVIDER_PORT=8450 REACT_APP_CONTRACTS_VERSION_HASH=latest diff --git a/jenkins/env/contracts.production.jenkins.env b/jenkins/env/contracts.production.jenkins.env index de1fc9d..1cef914 100755 --- a/jenkins/env/contracts.production.jenkins.env +++ b/jenkins/env/contracts.production.jenkins.env @@ -3,6 +3,6 @@ MIGRATE_NETWORK=env WEB3_HOST=concordia-ganache-production WEB3_PORT=8545 -CONTRACTS_PROVIDER_HOST=contracts.concordia.ecentrics.net +CONTRACTS_PROVIDER_HOST=https://contracts.concordia.ecentrics.net CONTRACTS_PROVIDER_PORT=8400 CONTRACTS_VERSION_TAG=stable diff --git a/jenkins/env/contracts.provider.production.env b/jenkins/env/contracts.provider.production.env index e2b1437..8916775 100755 --- a/jenkins/env/contracts.provider.production.env +++ b/jenkins/env/contracts.provider.production.env @@ -5,4 +5,5 @@ LETSENCRYPT_EMAIL=ecentricsgr@gmail.com CONTRACTS_PROVIDER_PORT=8400 UPLOAD_CONTRACTS_DIRECTORY=/mnt/concordia/contracts/ -CORS_ALLOWED_ORIGINS="concordia.ecentrics.net;http://concordia.ecentrics.net;https://concordia.ecentrics.net;concordia.ecentrics.net:7777;http://concordia.ecentrics.net:7777;https://concordia.ecentrics.net:7777;127.0.0.1;http://127.0.0.1;127.0.0.1:7777;http://127.0.0.1" +LOGS_PATH=/mnt/concordia/logs/ +CORS_ALLOWED_ORIGINS="https://concordia.ecentrics.net;http://127.0.0.1:4444;127.0.0.1:4444" diff --git a/jenkins/env/contracts.provider.staging.env b/jenkins/env/contracts.provider.staging.env index 489ded6..cc49be6 100755 --- a/jenkins/env/contracts.provider.staging.env +++ b/jenkins/env/contracts.provider.staging.env @@ -5,4 +5,5 @@ LETSENCRYPT_EMAIL=ecentricsgr@gmail.com CONTRACTS_PROVIDER_PORT=8450 UPLOAD_CONTRACTS_DIRECTORY=/mnt/concordia/contracts/ -#CORS_ALLOWED_ORIGINS="staging.concordia.ecentrics.net;http://staging.concordia.ecentrics.net;https://staging.concordia.ecentrics.net;staging.concordia.ecentrics.net:7000;http://staging.concordia.ecentrics.net:7000;https://staging.concordia.ecentrics.net:7000;172.21.0.4;http://172.21.0.4;127.0.0.1;http://127.0.0.1" +LOGS_PATH=/mnt/concordia/logs/ +CORS_ALLOWED_ORIGINS="https://staging.concordia.ecentrics.net;http://127.0.0.1:5555;127.0.0.1:5555" diff --git a/jenkins/env/contracts.staging.jenkins.env b/jenkins/env/contracts.staging.jenkins.env index 924f433..106a637 100755 --- a/jenkins/env/contracts.staging.jenkins.env +++ b/jenkins/env/contracts.staging.jenkins.env @@ -3,6 +3,6 @@ MIGRATE_NETWORK=env WEB3_HOST=concordia-ganache-staging WEB3_PORT=8555 -CONTRACTS_PROVIDER_HOST=staging.contracts.concordia.ecentrics.net +CONTRACTS_PROVIDER_HOST=https://staging.contracts.concordia.ecentrics.net CONTRACTS_PROVIDER_PORT=8450 CONTRACTS_VERSION_TAG=latest diff --git a/jenkins/env/pinner.production.jenkins.env b/jenkins/env/pinner.production.jenkins.env index 5558f2c..87052f7 100755 --- a/jenkins/env/pinner.production.jenkins.env +++ b/jenkins/env/pinner.production.jenkins.env @@ -5,15 +5,17 @@ LETSENCRYPT_EMAIL=ecentricsgr@gmail.com USE_EXTERNAL_CONTRACTS_PROVIDER=true ORBIT_DIRECTORY=/mnt/concordia/orbitdb +IPFS_DIRECTORY=/mnt/concordia/ipfs +LOGS_PATH=/mnt/concordia/logs/ -CONTRACTS_PROVIDER_HOST=contracts.concordia.ecentrics.net +CONTRACTS_PROVIDER_HOST=https://contracts.concordia.ecentrics.net CONTRACTS_PROVIDER_PORT=8400 CONTRACTS_VERSION_HASH=stable -PINNER_API_HOST=127.0.0.1 +PINNER_API_HOST=https://127.0.0.1 PINNER_API_PORT=4444 -RENDEZVOUS_HOST=rendezvous.ecentrics.net +RENDEZVOUS_HOST=/dns4/rendezvous.ecentrics.net RENDEZVOUS_PORT=9090 WEB3_HOST=ganache.ecentrics.net diff --git a/jenkins/env/pinner.staging.jenkins.env b/jenkins/env/pinner.staging.jenkins.env index d4998d2..1410813 100755 --- a/jenkins/env/pinner.staging.jenkins.env +++ b/jenkins/env/pinner.staging.jenkins.env @@ -5,15 +5,17 @@ LETSENCRYPT_EMAIL=ecentricsgr@gmail.com USE_EXTERNAL_CONTRACTS_PROVIDER=true ORBIT_DIRECTORY=/mnt/concordia/orbitdb +IPFS_DIRECTORY=/mnt/concordia/ipfs +LOGS_PATH=/mnt/concordia/logs/ -CONTRACTS_PROVIDER_HOST=staging.contracts.concordia.ecentrics.net +CONTRACTS_PROVIDER_HOST=https://staging.contracts.concordia.ecentrics.net CONTRACTS_PROVIDER_PORT=8450 CONTRACTS_VERSION_HASH=latest -PINNER_API_HOST=127.0.0.1 +PINNER_API_HOST=https://127.0.0.1 PINNER_API_PORT=5555 -RENDEZVOUS_HOST=rendezvous.ecentrics.net +RENDEZVOUS_HOST=/dns4/rendezvous.ecentrics.net RENDEZVOUS_PORT=9090 WEB3_HOST=staging.ganache.ecentrics.net