From 4fb4ba51f5f20fe97c729da91f89aa81d8f3e715 Mon Sep 17 00:00:00 2001 From: llunaCreixent Date: Wed, 26 Apr 2023 11:15:13 +0200 Subject: [PATCH 1/7] Allow non-iterative requests --- src/utils.js | 11 ++- test/iterative.test.js | 156 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+), 3 deletions(-) create mode 100644 test/iterative.test.js diff --git a/src/utils.js b/src/utils.js index a2008129..1e0200b0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -62,20 +62,25 @@ async function request(endpoint, userOptions) { try { return fetch(url, request).then((response) => { const contentType = response.headers.get('Content-Type'); - + const transferEncoding = response.headers.get('Transfer-Encoding'); if (contentType && contentType.includes('application/json')) { return response.json().then((json) => { if (response.status >= 400) { throw new RequestError(url, json, response.status); } - return json; }); } else { if (response.status >= 400) { throw new RequestError(url, response.body, response.status); } - + if (transferEncoding && transferEncoding.includes('chunked')) { + console.log("chunked"); + return response.text().then((text) => { + console.log(text.toString()); + return JSON.parse(text.toString()); + }); + } return response.body; } }); diff --git a/test/iterative.test.js b/test/iterative.test.js new file mode 100644 index 00000000..25a5e4f6 --- /dev/null +++ b/test/iterative.test.js @@ -0,0 +1,156 @@ +import { execSync } from 'child_process'; + +import { getTokenContract } from '~/common/getContracts'; +import getContracts from '~/common/getContracts'; +import { ZERO_ADDRESS } from '~/common/constants'; +import createCore from './helpers/core'; +import getAccount from './helpers/account'; + +import web3 from './helpers/web3'; +import { + deploySafe, + deploySafeAndToken, + addTrustConnection, +} from './helpers/transactions'; + +const TEST_TRUST_NETWORK = [ + [0, 1, 25], + [1, 0, 50], + [1, 2, 10], + [2, 1, 20], + [2, 3, 5], + [3, 2, 15], + [3, 0, 25], + [3, 4, 25], + [4, 3, 15], + [4, 1, 10], + [2, 5, 50], // Unidirectional +]; + +async function wait(ms) { + return new Promise((resolve) => { + setTimeout(resolve, ms); + }); +} + +async function deployTestNetwork( + core, + accounts, + connections = TEST_TRUST_NETWORK, +) { + // Deploy Safe and Token for each test account + let results = []; + for (const account of accounts) { + results.push(await deploySafeAndToken(core, account)); + } + + const safeAddresses = []; + const tokenAddresses = []; + + results.forEach((result) => { + const { safeAddress, tokenAddress } = result; + + safeAddresses.push(safeAddress); + tokenAddresses.push(tokenAddress); + }); + + const connectionTasks = connections.map((connection) => { + return addTrustConnection(core, accounts[connection[0]], { + user: safeAddresses[connection[1]], + canSendTo: safeAddresses[connection[0]], + limitPercentage: connection[2], + }); + }); + + await Promise.all(connectionTasks); + + return { + safeAddresses, + tokenAddresses, + }; +} + +const executeTests = (core) => { + describe('Token', () => { + let accounts; + let signupBonus; + let contracts; + let hubAddress; + let safeAddresses; + let tokenAddresses; + const isPathfinderServer = core.options.pathfinderType === 'server'; + const testPathfinderName = isPathfinderServer ? 'server' : 'binary'; + const tokenOwnerAddressProperty = isPathfinderServer + ? 'token_owner' + : 'tokenOwnerAddress'; + const transferStepsProperty = isPathfinderServer ? 'maxTransfers' : 'hops'; + + beforeAll(async () => { + accounts = new Array(6).fill({}).map((item, index) => { + return getAccount(index); + }); + // Retrieve the value of the initial UBI payout (called signupBonus) from the deployed Hub contract + + hubAddress = core.options.hubAddress; + contracts = await getContracts(web3, { + hubAddress: hubAddress, + proxyFactoryAddress: ZERO_ADDRESS, + safeMasterAddress: ZERO_ADDRESS, + }); + const { hub } = contracts; + signupBonus = await hub.methods.signupBonus().call(); + + const result = await deployTestNetwork(core, accounts); + + safeAddresses = result.safeAddresses; + tokenAddresses = result.tokenAddresses; + }); + + it('should check if safe has enough funds for token to be deployed', async () => { + const safeAddress = await deploySafe(core, accounts[0]); + + expect( + await core.token.isFunded(accounts[0], { + safeAddress, + }), + ).toBe(true); + }); + + describe('Find transitive transfer steps', () => { + it(`should return max flow and possible path when using ${testPathfinderName} pathfinder.`, async () => { + const value = new web3.utils.BN(core.utils.toFreckles(1)); + console.log("hi"); + const result = await core.token.findTransitiveTransfer(accounts[0], { + from: safeAddresses[0], + to: safeAddresses[4], + value, + }); + // const text = result.text(); + // console.log(text); + // console.log("end: ", text.toString()); + expect(result.transferSteps.length).toBe(2); + expect(result.transferSteps[0].from).toBe(safeAddresses[0]); + expect(result.transferSteps[0].to).toBe(safeAddresses[3]); + expect(result.transferSteps[0].value).toBe(core.utils.toFreckles(1)); + expect(result.transferSteps[0][tokenOwnerAddressProperty]).toBe( + safeAddresses[0], + ); + expect(result.transferSteps[1].from).toBe(safeAddresses[3]); + expect(result.transferSteps[1].to).toBe(safeAddresses[4]); + expect(result.transferSteps[1].value).toBe(core.utils.toFreckles(1)); + expect(result.transferSteps[1][tokenOwnerAddressProperty]).toBe( + safeAddresses[3], + ); + // The `pathfinder` stops searching for max flow as soon as it found a + // successful solution, therefore it returns a lower max flow than it + // actually is (25). + expect(result.maxFlowValue).toBe(core.utils.toFreckles(1)); + }); + }); + }); +}; + +// Execute tests with server pathfinder +executeTests(createCore()); +// Execute tests with cli pathfinder +// executeTests(createCore({ pathfinderType: 'cli' })); From 0c6a3b23dc1207a21efde1bccf1f35c5d1f37afc Mon Sep 17 00:00:00 2001 From: llunaCreixent Date: Mon, 15 May 2023 08:59:33 +0200 Subject: [PATCH 2/7] Process ndjson from pathfinder responses --- src/token.js | 9 ++++- src/utils.js | 108 ++++++++++++++++++++++++++++++++++++--------------- 2 files changed, 83 insertions(+), 34 deletions(-) diff --git a/src/token.js b/src/token.js index 67de65de..cc5027c5 100644 --- a/src/token.js +++ b/src/token.js @@ -18,6 +18,7 @@ import { getVersion } from '~/safe'; * @param {Object} userOptions - search arguments * @param {string} pathfinderType - pathfinder execution type * @param {number} pathfinderMaxTransferSteps - default pathfinder server max transfer steps + * @param {Boolean} returnIterativeFirstMatch - if true, the pathfinder service iteratively optimizes the result and returns the first match with 'value'. Only available when pathfinderType is 'cli' * * @return {Object[]} - transaction steps */ @@ -27,6 +28,7 @@ export async function findTransitiveTransfer( userOptions, pathfinderType, pathfinderMaxTransferSteps, + returnIterativeFirstMatch = false, ) { let result; if (pathfinderType == 'cli') { @@ -39,6 +41,7 @@ export async function findTransitiveTransfer( utils, userOptions, pathfinderMaxTransferSteps, + returnIterativeFirstMatch, ); } return result; @@ -109,6 +112,7 @@ async function findTransitiveTransferCli(web3, utils, userOptions) { * @param {string} userOptions.to - receiver Safe address * @param {BN} userOptions.value - value of Circles tokens * @param {number} userOptions.maxTransfers - limit of steps returned by the pathfinder service + * @param {Boolean} returnIterativeFirstMatch - if true, the pathfinder service iteratively optimizes the result and returns the first match with 'value'. Only available when pathfinderType is 'cli' * * @return {Object[]} - transaction steps */ @@ -117,6 +121,7 @@ async function findTransitiveTransferServer( utils, userOptions, pathfinderMaxTransferSteps, + returnIterativeFirstMatch, ) { const options = checkOptions(userOptions, { from: { @@ -136,7 +141,6 @@ async function findTransitiveTransferServer( try { const response = await utils.requestPathfinderAPI({ - method: 'POST', data: { id: crypto.randomUUID(), method: 'compute_transfer', @@ -145,9 +149,9 @@ async function findTransitiveTransferServer( to: options.to, value: options.value.toString(), max_transfers: options.maxTransfers, + iterative: returnIterativeFirstMatch, }, }, - isTrailingSlash: false, }); return response.result; } catch (error) { @@ -586,6 +590,7 @@ export default function createTokenModule( options, pathfinderType, pathfinderMaxTransferSteps, + true, ); if (web3.utils.toBN(response.maxFlowValue).lt(options.value)) { throw new TransferError( diff --git a/src/utils.js b/src/utils.js index 1e0200b0..241b2190 100644 --- a/src/utils.js +++ b/src/utils.js @@ -17,7 +17,79 @@ import { getTokenContract, getSafeContract } from '~/common/getContracts'; /** @access private */ const transactionQueue = new TransactionQueue(); -async function request(endpoint, userOptions) { +async function processResponseJson(response) { + return new Promise((resolve, reject) => { + const getJson = (response) => { + return response.json().then((json) => { + if (response.status >= 400) { + throw new RequestError(response.url, json, response.status); + } + return json; + }); + }; + const contentType = response.headers.get('Content-Type'); + if (contentType && contentType.includes('application/json')) { + getJson(response).then(resolve).catch(reject); + } else { + if (response.status >= 400) { + reject(new RequestError(response.url, response.body, response.status)); + } + resolve(response.body); + } + }) +} + +async function processResponseNdjson(response, data) { + let buffer = '' + let jsons = [] + let final + return new Promise((resolve, reject) => { + resolve(response.body) + }) + .then(res => { + return new Promise((resolve, reject) => { + res.on('readable', () => { + console.log("readable...*"); + let result + const decoder = new TextDecoder() + while (null !== (result = res.read())) { + buffer += decoder.decode(result) + let idx = buffer.indexOf("\n") + while(idx !== -1) { + const text = buffer.substring(0, idx) + try { + const jsonText = JSON.parse(text) + console.log(jsonText) + jsons.push(jsonText) + if (jsonText.result.maxFlowValue === data.params.value) { + final = jsonText + res.destroy() + } + } catch(error) { + console.warn(text) + } + buffer = buffer.substring(idx + 1) + idx = buffer.indexOf("\n") + } + } + }) + res.on('end', () => { // If haven't received a matching result yet, then return the last result + console.log("END!"); + console.log({final}); + console.log({jsons}); + resolve(jsons.pop()) + }); + res.on("close", function (err) { + console.log("Stream has been destroyed and file has been closed"); + console.log({final}); + console.log({jsons}); + resolve(final ? final : jsons.pop()) + }) + }) + }) +} + +async function request(endpoint, userOptions, processResponse = processResponseJson) { const options = checkOptions(userOptions, { path: { type: 'array', @@ -60,30 +132,7 @@ async function request(endpoint, userOptions) { const url = `${endpoint}/${path.join('/')}${slash}${paramsStr}`; try { - return fetch(url, request).then((response) => { - const contentType = response.headers.get('Content-Type'); - const transferEncoding = response.headers.get('Transfer-Encoding'); - if (contentType && contentType.includes('application/json')) { - return response.json().then((json) => { - if (response.status >= 400) { - throw new RequestError(url, json, response.status); - } - return json; - }); - } else { - if (response.status >= 400) { - throw new RequestError(url, response.body, response.status); - } - if (transferEncoding && transferEncoding.includes('chunked')) { - console.log("chunked"); - return response.text().then((text) => { - console.log(text.toString()); - return JSON.parse(text.toString()); - }); - } - return response.body; - } - }); + return fetch(url, request).then(response => processResponse(response, data)); } catch (err) { throw new RequestError(url, err.message); } @@ -1125,17 +1174,12 @@ export default function createUtilsModule(web3, contracts, globalOptions) { * @namespace core.utils.requestPathfinderAPI * * @param {Object} userOptions - Pathfinder API query options - * @param {string} userOptions.method - HTTP method * @param {Object} userOptions.data - Request body (JSON) * * @return {Object} - API response */ requestPathfinderAPI: async (userOptions) => { const options = checkOptions(userOptions, { - method: { - type: 'string', - default: 'GET', - }, data: { type: 'object', default: {}, @@ -1143,10 +1187,10 @@ export default function createUtilsModule(web3, contracts, globalOptions) { }); return request(pathfinderServiceEndpoint, { data: options.data, - method: options.method, + method: 'POST', path: [], isTrailingSlash: false, - }); + }, processResponseNdjson); }, /** From 659fd175b98cb0df5665a1ff8383c6b15e994e59 Mon Sep 17 00:00:00 2001 From: llunaCreixent Date: Mon, 15 May 2023 09:48:26 +0200 Subject: [PATCH 3/7] Make lint happy --- src/utils.js | 106 ++++++++++++++++------------ test/iterative.test.js | 156 ----------------------------------------- 2 files changed, 60 insertions(+), 202 deletions(-) delete mode 100644 test/iterative.test.js diff --git a/src/utils.js b/src/utils.js index 241b2190..ed35ed9e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -36,60 +36,68 @@ async function processResponseJson(response) { } resolve(response.body); } - }) + }); } async function processResponseNdjson(response, data) { - let buffer = '' - let jsons = [] - let final - return new Promise((resolve, reject) => { - resolve(response.body) - }) - .then(res => { + let buffer = ''; + let jsons = []; + let final; + return new Promise((resolve) => { + resolve(response.body); + }).then((res) => { return new Promise((resolve, reject) => { res.on('readable', () => { - console.log("readable...*"); - let result - const decoder = new TextDecoder() + // console.log('readable...*'); + let result; + const decoder = new TextDecoder(); while (null !== (result = res.read())) { - buffer += decoder.decode(result) - let idx = buffer.indexOf("\n") - while(idx !== -1) { - const text = buffer.substring(0, idx) + buffer += decoder.decode(result); + let idx = buffer.indexOf('\n'); + while (idx !== -1) { + const text = buffer.substring(0, idx); try { - const jsonText = JSON.parse(text) - console.log(jsonText) - jsons.push(jsonText) + const jsonText = JSON.parse(text); + // console.log(jsonText); + jsons.push(jsonText); if (jsonText.result.maxFlowValue === data.params.value) { - final = jsonText - res.destroy() + final = jsonText; + res.destroy(); } - } catch(error) { - console.warn(text) + } catch (error) { + // console.warn(text); + reject(error); } - buffer = buffer.substring(idx + 1) - idx = buffer.indexOf("\n") + buffer = buffer.substring(idx + 1); + idx = buffer.indexOf('\n'); } } - }) - res.on('end', () => { // If haven't received a matching result yet, then return the last result - console.log("END!"); - console.log({final}); - console.log({jsons}); - resolve(jsons.pop()) }); - res.on("close", function (err) { - console.log("Stream has been destroyed and file has been closed"); - console.log({final}); - console.log({jsons}); - resolve(final ? final : jsons.pop()) - }) - }) - }) + res.on('end', () => { + // If haven't received a matching result yet, then return the last result + // console.log('END!'); + // console.log({ final }); + // console.log({ jsons }); + resolve(jsons.pop()); + }); + res.on('close', function (err) { + // console.log('Stream has been destroyed and file has been closed'); + // console.log({ final }); + // console.log({ jsons }); + if (err) { + reject(err); + } + resolve(final); + }); + }); + }); } -async function request(endpoint, userOptions, processResponse = processResponseJson) { +async function request( + endpoint, + userOptions, + processResponse = processResponseJson, +) { const options = checkOptions(userOptions, { path: { type: 'array', @@ -132,7 +140,9 @@ async function request(endpoint, userOptions, processResponse = processResponseJ const url = `${endpoint}/${path.join('/')}${slash}${paramsStr}`; try { - return fetch(url, request).then(response => processResponse(response, data)); + return fetch(url, request).then((response) => + processResponse(response, data), + ); } catch (err) { throw new RequestError(url, err.message); } @@ -1185,12 +1195,16 @@ export default function createUtilsModule(web3, contracts, globalOptions) { default: {}, }, }); - return request(pathfinderServiceEndpoint, { - data: options.data, - method: 'POST', - path: [], - isTrailingSlash: false, - }, processResponseNdjson); + return request( + pathfinderServiceEndpoint, + { + data: options.data, + method: 'POST', + path: [], + isTrailingSlash: false, + }, + processResponseNdjson, + ); }, /** diff --git a/test/iterative.test.js b/test/iterative.test.js deleted file mode 100644 index 25a5e4f6..00000000 --- a/test/iterative.test.js +++ /dev/null @@ -1,156 +0,0 @@ -import { execSync } from 'child_process'; - -import { getTokenContract } from '~/common/getContracts'; -import getContracts from '~/common/getContracts'; -import { ZERO_ADDRESS } from '~/common/constants'; -import createCore from './helpers/core'; -import getAccount from './helpers/account'; - -import web3 from './helpers/web3'; -import { - deploySafe, - deploySafeAndToken, - addTrustConnection, -} from './helpers/transactions'; - -const TEST_TRUST_NETWORK = [ - [0, 1, 25], - [1, 0, 50], - [1, 2, 10], - [2, 1, 20], - [2, 3, 5], - [3, 2, 15], - [3, 0, 25], - [3, 4, 25], - [4, 3, 15], - [4, 1, 10], - [2, 5, 50], // Unidirectional -]; - -async function wait(ms) { - return new Promise((resolve) => { - setTimeout(resolve, ms); - }); -} - -async function deployTestNetwork( - core, - accounts, - connections = TEST_TRUST_NETWORK, -) { - // Deploy Safe and Token for each test account - let results = []; - for (const account of accounts) { - results.push(await deploySafeAndToken(core, account)); - } - - const safeAddresses = []; - const tokenAddresses = []; - - results.forEach((result) => { - const { safeAddress, tokenAddress } = result; - - safeAddresses.push(safeAddress); - tokenAddresses.push(tokenAddress); - }); - - const connectionTasks = connections.map((connection) => { - return addTrustConnection(core, accounts[connection[0]], { - user: safeAddresses[connection[1]], - canSendTo: safeAddresses[connection[0]], - limitPercentage: connection[2], - }); - }); - - await Promise.all(connectionTasks); - - return { - safeAddresses, - tokenAddresses, - }; -} - -const executeTests = (core) => { - describe('Token', () => { - let accounts; - let signupBonus; - let contracts; - let hubAddress; - let safeAddresses; - let tokenAddresses; - const isPathfinderServer = core.options.pathfinderType === 'server'; - const testPathfinderName = isPathfinderServer ? 'server' : 'binary'; - const tokenOwnerAddressProperty = isPathfinderServer - ? 'token_owner' - : 'tokenOwnerAddress'; - const transferStepsProperty = isPathfinderServer ? 'maxTransfers' : 'hops'; - - beforeAll(async () => { - accounts = new Array(6).fill({}).map((item, index) => { - return getAccount(index); - }); - // Retrieve the value of the initial UBI payout (called signupBonus) from the deployed Hub contract - - hubAddress = core.options.hubAddress; - contracts = await getContracts(web3, { - hubAddress: hubAddress, - proxyFactoryAddress: ZERO_ADDRESS, - safeMasterAddress: ZERO_ADDRESS, - }); - const { hub } = contracts; - signupBonus = await hub.methods.signupBonus().call(); - - const result = await deployTestNetwork(core, accounts); - - safeAddresses = result.safeAddresses; - tokenAddresses = result.tokenAddresses; - }); - - it('should check if safe has enough funds for token to be deployed', async () => { - const safeAddress = await deploySafe(core, accounts[0]); - - expect( - await core.token.isFunded(accounts[0], { - safeAddress, - }), - ).toBe(true); - }); - - describe('Find transitive transfer steps', () => { - it(`should return max flow and possible path when using ${testPathfinderName} pathfinder.`, async () => { - const value = new web3.utils.BN(core.utils.toFreckles(1)); - console.log("hi"); - const result = await core.token.findTransitiveTransfer(accounts[0], { - from: safeAddresses[0], - to: safeAddresses[4], - value, - }); - // const text = result.text(); - // console.log(text); - // console.log("end: ", text.toString()); - expect(result.transferSteps.length).toBe(2); - expect(result.transferSteps[0].from).toBe(safeAddresses[0]); - expect(result.transferSteps[0].to).toBe(safeAddresses[3]); - expect(result.transferSteps[0].value).toBe(core.utils.toFreckles(1)); - expect(result.transferSteps[0][tokenOwnerAddressProperty]).toBe( - safeAddresses[0], - ); - expect(result.transferSteps[1].from).toBe(safeAddresses[3]); - expect(result.transferSteps[1].to).toBe(safeAddresses[4]); - expect(result.transferSteps[1].value).toBe(core.utils.toFreckles(1)); - expect(result.transferSteps[1][tokenOwnerAddressProperty]).toBe( - safeAddresses[3], - ); - // The `pathfinder` stops searching for max flow as soon as it found a - // successful solution, therefore it returns a lower max flow than it - // actually is (25). - expect(result.maxFlowValue).toBe(core.utils.toFreckles(1)); - }); - }); - }); -}; - -// Execute tests with server pathfinder -executeTests(createCore()); -// Execute tests with cli pathfinder -// executeTests(createCore({ pathfinderType: 'cli' })); From 4855b19f9b699fbc32adcece099db10444a0e917 Mon Sep 17 00:00:00 2001 From: llunaCreixent Date: Wed, 17 May 2023 12:55:23 +0200 Subject: [PATCH 4/7] Expose pathfinder2 port for testing --- .github/workflows/tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 303b10a6..522b9b8d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@v3 with: repository: CirclesUBI/circles-docker.git - ref: main + ref: test-iterative path: circles-docker - name: Setup docker repo @@ -45,7 +45,7 @@ jobs: - name: Container setup via docker-compose without pathfinder working-directory: circles-docker - run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build + run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build - name: Download and migrate contracts working-directory: circles-docker @@ -53,11 +53,11 @@ jobs: - name: Try starting failed services working-directory: circles-docker - run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build + run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build - name: Container setup via docker-compose for pathfinder working-directory: circles-docker - run: docker compose -f docker-compose.pathfinder-pull.yml -p circles up --detach --build + run: docker compose -f docker-compose.pathfinder-pull.yml -f docker-compose.expose-ports.yml -p circles up --detach --build - name: Install dependencies working-directory: circles-core From b397a5d97284615a29cdb8e842bbf26c814894cf Mon Sep 17 00:00:00 2001 From: llunaCreixent Date: Wed, 17 May 2023 13:02:42 +0200 Subject: [PATCH 5/7] Expose ports for testing --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 522b9b8d..edc08178 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,11 +53,11 @@ jobs: - name: Try starting failed services working-directory: circles-docker - run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build + run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -f docker-compose.expose-ports.yml -p circles up --detach --remove-orphans --build - name: Container setup via docker-compose for pathfinder working-directory: circles-docker - run: docker compose -f docker-compose.pathfinder-pull.yml -f docker-compose.expose-ports.yml -p circles up --detach --build + run: docker compose -f docker-compose.pathfinder-pull.yml -p circles up --detach --build - name: Install dependencies working-directory: circles-core From 1aadcdd8ed3fc5e387ae956d6549373dc96b8f0e Mon Sep 17 00:00:00 2001 From: llunaCreixent Date: Wed, 17 May 2023 13:04:13 +0200 Subject: [PATCH 6/7] Remove export ports --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index edc08178..acfeaa88 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -53,7 +53,7 @@ jobs: - name: Try starting failed services working-directory: circles-docker - run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -f docker-compose.expose-ports.yml -p circles up --detach --remove-orphans --build + run: docker compose -f docker-compose.yml -f docker-compose.relayer-pull.yml -f docker-compose.api-pull.yml -p circles up --detach --remove-orphans --build - name: Container setup via docker-compose for pathfinder working-directory: circles-docker From ba50a4feff3191de0896a3c134a91c9a6da54e4f Mon Sep 17 00:00:00 2001 From: llunaCreixent Date: Thu, 18 May 2023 09:29:34 +0200 Subject: [PATCH 7/7] Use pathfinder2 port in .env --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index db7e61b4..eafd5f82 100644 --- a/.env.example +++ b/.env.example @@ -4,7 +4,7 @@ RPC_URL=http://localhost:8545 # Service Endpoints API_SERVICE_ENDPOINT=http://api.circles.local GRAPH_NODE_ENDPOINT=http://graph.circles.local -PATHFINDER_SERVICE_ENDPOINT=http://localhost:8081 +PATHFINDER_SERVICE_ENDPOINT=http://localhost:54389 RELAY_SERVICE_ENDPOINT=http://relay.circles.local # Database Endpoint