Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit ecacdef

Browse files
authored
chore: Enable Arweave as an experimental subnet network (#705)
* chore: Enable Arweave as experimental network * Reduce experimental filter to one if statement * Update README with list of experimental networks
1 parent de05317 commit ecacdef

File tree

4 files changed

+26
-23
lines changed

4 files changed

+26
-23
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ For the JSON output, the following event types exist:
130130
Set the flag `--experimental` to run subnets not yet considered safe for
131131
production use. _Run this at your own risk!_
132132

133-
No subnets currently in experimental mode.
133+
Checker Modules currently in experimental mode:
134+
135+
- [Arweave](https://github.com/CheckerNetwork/arweave-checker/)
134136

135137
### `$ checker --help`
136138

commands/checker.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ export const checker = async ({ json, recreateCheckerIdOnError, experimental })
9595
}
9696
})
9797

98-
if (experimental) {
99-
console.error('No experimental subnets available at this point')
100-
}
101-
10298
const contracts = []
10399

104100
const fetchRequest = new ethers.FetchRequest(
@@ -129,7 +125,8 @@ export const checker = async ({ json, recreateCheckerIdOnError, experimental })
129125
source: activity.source || 'Zinnia'
130126
})
131127
},
132-
onMetrics: m => metrics.submit('zinnia', m)
128+
onMetrics: m => metrics.submit('zinnia', m),
129+
experimental
133130
}),
134131
runPingLoop({ CHECKER_ID }),
135132
runMachinesLoop({ CHECKER_ID }),

lib/zinnia.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ const ZINNIA_DIST_TAG = 'v0.20.3'
1111
const SUBNETS = [
1212
{
1313
subnet: 'spark',
14-
ipnsKey: 'k51qzi5uqu5dlej5gtgal40sjbowuau5itwkr6mgyuxdsuhagjxtsfqjd6ym3g'
14+
ipnsKey: 'k51qzi5uqu5dlej5gtgal40sjbowuau5itwkr6mgyuxdsuhagjxtsfqjd6ym3g',
15+
experimental: false
16+
},
17+
{
18+
subnet: 'arweave',
19+
ipnsKey: 'k51qzi5uqu5dgwm6tk4gibgfqbqjopwdtlphvyczrixay6oesadjdxt1eorimg',
20+
experimental: true
1521
}
16-
// , {
17-
// subnet: 'arweave',
18-
// ipnsKey: 'k51qzi5uqu5dgwm6tk4gibgfqbqjopwdtlphvyczrixay6oesadjdxt1eorimg'
19-
// }
2022
]
2123
const {
2224
TARGET_ARCH = os.arch(),
@@ -231,7 +233,8 @@ export async function run ({
231233
subnetSourcesDir,
232234
onActivity,
233235
onMetrics,
234-
isUpdated = false
236+
isUpdated = false,
237+
experimental = false
235238
}) {
236239
const zinniadExe = getRuntimeExecutable({ runtime: 'zinnia', executable: 'zinniad' })
237240

@@ -263,8 +266,9 @@ export async function run ({
263266
const { signal } = controller
264267
const childProcesses = []
265268

266-
for (const { subnet } of SUBNETS) {
267-
if (!matchesSubnetFilter(subnet)) continue
269+
for (const { subnet, experimental: subnetIsExperimental } of SUBNETS) {
270+
const skipExperimentalSubnet = !experimental && subnetIsExperimental
271+
if (!matchesSubnetFilter(subnet) || skipExperimentalSubnet) continue
268272

269273
// all paths are relative to `runtimeBinaries`
270274
const childProcess = execa(
@@ -358,7 +362,8 @@ export async function run ({
358362
subnetSourcesDir,
359363
onActivity,
360364
onMetrics,
361-
isUpdated: true
365+
isUpdated: true,
366+
experimental
362367
})
363368
}
364369

test/checker.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ describe('Checker', () => {
1919
assert.strictEqual(ps.exitCode, null)
2020
stopChecker()
2121
})
22-
// No experimental subnets available at this point
23-
// it('runs experimental subnets', () => {
24-
// it('runs Bacalhau', async () => {
25-
// const ps = startChecker(['--experimental'])
26-
// await streamMatch(ps.stdout, 'Bacalhau subnet started.')
27-
// stopChecker()
28-
// })
29-
// })
22+
it('runs experimental subnets', () => {
23+
it('runs Arweave', async () => {
24+
const ps = startChecker(['--experimental'])
25+
await streamMatch(ps.stdout, 'Arweave subnet started.')
26+
stopChecker()
27+
})
28+
})
3029
it('outputs events', async () => {
3130
const ps = startChecker()
3231
await Promise.all([

0 commit comments

Comments
 (0)