Skip to content

Commit

Permalink
fix check
Browse files Browse the repository at this point in the history
  • Loading branch information
RomarQ committed Jan 20, 2025
1 parent c51e61c commit bb9c570
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions typescript-api/scripts/scrapeMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const CHAINS = ["moonbase", "moonriver", "moonbeam"];
const fetchMetadata = async (port = 9933) => {
const maxRetries = 60;
const sleepTime = 500;
const url = `http://localhost:${port}`;
const url = `http://127.0.0.1:${port}`;
const payload = {
id: "1",
jsonrpc: "2.0",
Expand Down Expand Up @@ -75,7 +75,7 @@ async function main() {
const metadata = await fetchMetadata();
fs.writeFileSync(`metadata-${chain}.json`, JSON.stringify(metadata, null, 2));
console.log(`✅ Metadata for ${chain} written to metadata-${chain}.json`);
nodes[chain].kill();
nodes[chain]?.kill();
await new Promise((resolve) => setTimeout(resolve, 2000));
} catch (error) {
console.error(`❌ Error getting metadata for ${chain}`);
Expand All @@ -86,7 +86,7 @@ async function main() {

process.on("SIGINT", () => {
for (const chain of CHAINS) {
nodes[chain].kill();
nodes[chain]?.kill();
}
process.exit();
});
Expand All @@ -98,6 +98,6 @@ main()
})
.finally(() => {
for (const chain of CHAINS) {
nodes[chain].kill();
nodes[chain]?.kill();
}
});

0 comments on commit bb9c570

Please sign in to comment.