diff --git a/CHANGELOG.md b/CHANGELOG.md index d514f5b..d242725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ +## [v2.2.5](https://github.com/luguslabs/archipel/releases/tag/v2.2.5) + +[#284](https://github.com/luguslabs/archipel/issues/284) : isServiceReadyToStart function ko. migrate curl to axios missing + ## [v2.2.4](https://github.com/luguslabs/archipel/releases/tag/v2.2.4) [#282](https://github.com/luguslabs/archipel/issues/282) : Curl removed in polkadot 0.9.11 fix diff --git a/cli/package.json b/cli/package.json index 05d83ad..841e6a2 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "archipel-cli", - "version": "2.2.4", + "version": "2.2.5", "description": "Archipel CLI is a component that generates configuration and bootstraps an Archipel federation. ", "main": "src/app.js", "scripts": { diff --git a/cli/src/cli.js b/cli/src/cli.js index 6b05a06..e0104f2 100644 --- a/cli/src/cli.js +++ b/cli/src/cli.js @@ -14,7 +14,7 @@ const runCli = async args => { try { // Set cli version program - .version('2.2.4'); + .version('2.2.5'); // Init command program diff --git a/orchestrator/package.json b/orchestrator/package.json index 8e754b4..dc9c7c1 100644 --- a/orchestrator/package.json +++ b/orchestrator/package.json @@ -1,6 +1,6 @@ { "name": "archipel-orchestrator", - "version": "2.2.4", + "version": "2.2.5", "description": "Archipel Orchestrator is the decision making component in Archipel federation.", "main": "src/app.js", "scripts": { diff --git a/orchestrator/src/polkadot.js b/orchestrator/src/polkadot.js index 7343d18..0de3c1b 100644 --- a/orchestrator/src/polkadot.js +++ b/orchestrator/src/polkadot.js @@ -365,17 +365,25 @@ class Polkadot { return true; } - // Construct command to check system_health - const commandSystemHealth = ['curl', 'http://localhost:' + config.polkadotRpcPort, '-H', 'Content-Type:application/json;charset=utf-8', '-d', - `{ - "jsonrpc":"2.0", - "id":1, - "method":"system_health" - }`]; - - // Call system_health command in docker container - const resultSystemHealth = await this.docker.dockerExecute(containerName, commandSystemHealth); - debug('isServiceReadyToStart', `Command system_health result: "${resultSystemHealth}"`); + const parameters = `{ + "jsonrpc":"2.0", + "id":1, + "method":"system_health" + }`; + + const instanceAxios = axios.create({ + headers: {'Content-Type': 'application/json;charset=utf-8'} + }); + const resultPost = await instanceAxios.post('http://127.0.0.1:'+config.polkadotRpcPort, parameters); + + let resultSystemHealth = ''; + if(resultPost && resultPost.data){ + resultSystemHealth = JSON.stringify(resultPost.data); + debug('isServiceReadyToStart', `Command system_health result: "${resultSystemHealth}"`); + } + else{ + debug('isServiceReadyToStart', `Command system_health ko: "${resultPost}"`); + } // Checking if system_health gives a result if (!resultSystemHealth.includes('"result":')) { diff --git a/ui/package.json b/ui/package.json index 0a4b9ad..ce70c30 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "archipel-ui", - "version": "2.2.4", + "version": "2.2.5", "private": true, "author": "Lugus Labs", "license": "apache 2",