-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: adding docs/rpc_nodes.json re #3105 * chore: updated dotenv and axios version to fix dependencies vulnerabilities * docs: updated rpc json file and added a convert-to-md file
- Loading branch information
1 parent
fa8b6f0
commit dd6eddb
Showing
6 changed files
with
176 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const path = require('path'); | ||
const rpcData: RpcType = require(path.resolve(__dirname, '../website/static/docs/rpc_nodes.json')); | ||
|
||
type Provider = {id: string, name: string, website: string, status_page: string}; | ||
type RpcEndpoint = {provider: string, url: string, net: string} | ||
type RpcType = {providers: Provider[], rpc_endpoints: RpcEndpoint[]}; | ||
|
||
// Create a mapping of provider IDs to their names | ||
const providers = rpcData.providers.reduce((providerMapping: Record<string, string>, provider) => { | ||
providerMapping[provider.id] = provider.name; | ||
return providerMapping; | ||
}, {}); | ||
|
||
// Generate the markdown table header | ||
let markdownTable = "| Provider | Net | URL | Header |\n"; | ||
markdownTable += "|------------------|--------------|------------------------------------------|---------------------------------------------------------------------------------|\n"; | ||
|
||
// Iterate over each RPC endpoint and generate the table rows | ||
rpcData.rpc_endpoints.forEach(endpoint => { | ||
const providerName = providers[endpoint.provider] || "Unknown Provider"; | ||
const url = endpoint.url; | ||
const net = endpoint.net; | ||
const headerUrl = `${url}/chains/main/blocks/head/header`; | ||
const row = `| ${providerName.padEnd(16)} | ${net.padEnd(12)} | ${url.padEnd(40)} | [Check](${headerUrl}) |\n`; | ||
markdownTable += row; | ||
}); | ||
|
||
// Output the generated markdown table | ||
console.log(markdownTable); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"providers": [ | ||
{ | ||
"id": "ecadinfra", | ||
"name": "ECAD Infra", | ||
"website": "https://www.ecadinfra.com/", | ||
"status_page": "" | ||
}, | ||
{ | ||
"id": "smartpy", | ||
"name": "SmartPy", | ||
"website": "https://smartpy.io", | ||
"status_page": "" | ||
}, | ||
{ | ||
"id": "tezosfoundation", | ||
"name": "Tezos Foundation", | ||
"website": "https://tezos.foundation", | ||
"status_page": "" | ||
}, | ||
{ | ||
"id": "tzkt", | ||
"name": "TzKT", | ||
"website": "https://tzkt.io", | ||
"status_page": "" | ||
} | ||
], | ||
"rpc_endpoints": [ | ||
{ | ||
"net": "mainnet", | ||
"url": "https://mainnet.tezos.ecadinfra.com", | ||
"provider": "ecadinfra" | ||
}, | ||
{ | ||
"net": "ghostnet", | ||
"url": "https://ghostnet.tezos.ecadinfra.com", | ||
"provider": "ecadinfra" | ||
}, | ||
{ | ||
"net": "mainnet", | ||
"url": "https://mainnet.smartpy.io", | ||
"provider": "smartpy" | ||
}, | ||
{ | ||
"net": "ghostnet", | ||
"url": "https://ghostnet.smartpy.io", | ||
"provider": "smartpy" | ||
}, | ||
{ | ||
"net": "mainnet", | ||
"url": "https://rpc.tzbeta.net", | ||
"provider": "tezosfoundation" | ||
}, | ||
{ | ||
"net": "ghostnet", | ||
"url": "https://rpc.ghostnet.teztnets.com", | ||
"provider": "tezosfoundation" | ||
}, | ||
{ | ||
"net": "parisnet", | ||
"url": "https://rpc.pariscnet.teztnets.com", | ||
"provider": "tezosfoundation" | ||
}, | ||
{ | ||
"net": "quebecnet", | ||
"url": "https://rpc.quebecnet.teztnets.com", | ||
"provider": "tezosfoundation" | ||
}, | ||
{ | ||
"net": "mainnet", | ||
"url": "https://rpc.tzkt.io/mainnet", | ||
"provider": "tzkt" | ||
}, | ||
{ | ||
"net": "ghostnet", | ||
"url": "https://rpc.tzkt.io/ghostnet", | ||
"provider": "tzkt" | ||
}, | ||
{ | ||
"net": "parisnet", | ||
"url": "https://rpc.tzkt.io/parisnet", | ||
"provider": "tzkt" | ||
}, | ||
{ | ||
"net": "quebecnet", | ||
"url": "https://rpc.tzkt.io/quebecnet", | ||
"provider": "tzkt" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters