spacemesh-local-testnet
Advanced tools
Comparing version 1.1.3 to 1.1.4
{ | ||
"name": "spacemesh-local-testnet", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "CLI tool to start a spacemesh network locally", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -41,3 +41,37 @@ "use strict"; | ||
}; | ||
console.log(chalk_1.default.bold.blue('Started ELK. Kibana URL: http://localhost:5601')); | ||
console.log(chalk_1.default.bold.blue('Waiting for Kibana to be ready')); | ||
for (;;) { | ||
let res = null; | ||
try { | ||
res = yield node_fetch_1.default('http://localhost:5601/api/saved_objects/index-pattern/*?overwrite=true', { | ||
method: 'post', | ||
body: JSON.stringify({ | ||
attributes: { title: '*', timeFieldName: '@timestamp' } | ||
}), | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'kbn-xsrf': 'reporting', | ||
Authorization: 'Basic ZWxhc3RpYzpzcGFjZW1lc2g=' | ||
}, | ||
redirect: 'follow' | ||
}).then(res => res.text()); | ||
} | ||
catch (e) { | ||
console.log('Error: ', e.message.toString()); | ||
if (!e.message.toString().includes('socket hang up')) { | ||
throw e; | ||
} | ||
else { | ||
res = 'Kibana server is not ready yet'; | ||
} | ||
} | ||
if (res === 'Kibana server is not ready yet') { | ||
yield sleep_promise_1.default(5000); | ||
} | ||
else { | ||
console.log(chalk_1.default.bold.blue('Kibana is ready')); | ||
break; | ||
} | ||
} | ||
console.log(chalk_1.default.bold.green('Started ELK. Kibana URL: http://localhost:5601')); | ||
} | ||
@@ -339,2 +373,15 @@ let config = command.config; | ||
console.log(chalk_1.default.bold.green(`Poet Activated`)); | ||
// Delete Index Pattern | ||
// var myHeaders = new Headers(); | ||
// myHeaders.append("kbn-xsrf", "reporting"); | ||
// myHeaders.append("Authorization", "Basic ZWxhc3RpYzpzcGFjZW1lc2g="); | ||
// var requestOptions = { | ||
// method: 'DELETE', | ||
// headers: myHeaders, | ||
// redirect: 'follow' | ||
// }; | ||
// fetch("http://localhost:5601/api/saved_objects/index-pattern/*", requestOptions) | ||
// .then(response => response.text()) | ||
// .then(result => console.log(result)) | ||
// .catch(error => console.log('error', error)); | ||
console.log(boxen_1.default('Network Started', { | ||
@@ -341,0 +388,0 @@ padding: 1, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56737
719