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;