Skip to content

Commit e61d55d

Browse files
BM-1684: docs/02-10 (#1195)
* update check-links.ts to wildcard domains for ignored URLs
1 parent 328a39b commit e61d55d

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

documentation/scripts/check-links.ts

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,56 @@
11
import { readFile } from "node:fs/promises";
22
import { glob } from "glob";
33

4-
// Add ignore list configuration
54
const IGNORED_URL_PREFIXES = new Set([
65
"https://github.com/boundless-xyz",
7-
"https://sepolia.etherscan.io",
6+
"https://etherscan.io",
87
"https://polygonscan.com",
98
"https://zkevm.polygonscan.com",
10-
"https://basescan.org",
11-
"https://sepolia.basescan.org",
12-
"https://arbiscan.io",
13-
"https://sepolia.arbiscan.io",
14-
"https://snowtrace.io",
15-
"https://testnet.snowtrace.io",
9+
"https://basescan.org",
10+
"https://arbiscan.io",
11+
"https://snowtrace.io",
1612
"https://lineascan.build",
17-
"https://sepolia.lineascan.build",
1813
"https://crates.io",
1914
"https://ethereum.org",
2015
"https://staking.boundless.network",
2116
"https://app.aragon.org",
22-
"https://etherscan.io",
2317
"https://docs.alchemy.com/"
2418
]);
2519

2620
async function checkRemoteUrl(url: string): Promise<boolean> {
27-
// Check if URL starts with any of the ignored prefixes
28-
if ([...IGNORED_URL_PREFIXES].some((prefix) => url.startsWith(prefix))) {
29-
return true;
21+
try {
22+
const currentUrl = new URL(url);
23+
24+
// Check if the URL's hostname matches or is a subdomain of any ignored prefix
25+
for (const prefix of IGNORED_URL_PREFIXES) {
26+
try {
27+
const ignoredUrl = new URL(prefix);
28+
29+
// Check for an exact hostname match OR a subdomain match
30+
// e.g., "sepolia.etherscan.io" ends with ".etherscan.io"
31+
if (
32+
currentUrl.hostname === ignoredUrl.hostname ||
33+
currentUrl.hostname.endsWith(`.${ignoredUrl.hostname}`)
34+
) {
35+
return true; // It's an ignored URL, so we return true immediately
36+
}
37+
} catch {
38+
// Handle cases where a prefix in the list isn't a full URL,
39+
// and just do a simple startsWith check as a fallback.
40+
if (url.startsWith(prefix)) {
41+
return true;
42+
}
43+
}
44+
}
45+
} catch {
46+
// If the url itself is invalid, we can't fetch it.
47+
return false;
3048
}
3149

50+
51+
// If no match was found, try to fetch the URL
3252
try {
3353
const response = await fetch(url);
34-
3554
return response.status >= 200 && response.status < 300;
3655
} catch {
3756
return false;

documentation/site/pages/zkc/mining/enable.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ x-base-environment: &base-environment
6868
RUST_LOG: ${RUST_LOG:-info}
6969
RISC0_HOME: /usr/local/risc0
7070
RUST_BACKTRACE: 1
71-
REWARD_ADDRESS: "0x1234...5678" // [!code hl] [!code focus]
71+
POVW_LOG_ID: "0x1234...5678" // [!code hl] [!code focus]
7272
```
7373
7474
## *Optional but highly recommended*: Delegate Reward Power to Reward Address

documentation/site/pages/zkc/mining/wallet-setup.mdx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,7 @@ It is recommended to separate the staking wallet from the rewards address. The r
5656

5757
#### Enable ZK Mining
5858

59-
When [enabling ZK mining](/zkc/mining/enable), provers specify the following environment variables:
60-
61-
```bash
62-
export REWARD_ADDRESS="0x0000...0000"
63-
export REWARD_ADDRESS_PRIVATE_KEY="..."
64-
```
59+
Please see [Enabling ZK Mining](/zkc/mining/enable).
6560

6661
#### Stake $ZKC
6762

0 commit comments

Comments
 (0)