Skip to content

Commit 8a74c5c

Browse files
committed
Parametrize image size
1 parent 62d465c commit 8a74c5c

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.github/workflows/integration-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ jobs:
169169
170170
- name: Test store-big-data (Westend parachain)
171171
working-directory: examples
172-
run: just run-test-store-big-data "${{ env.TEST_DIR }}"
172+
run: just run-test-store-big-data "${{ env.TEST_DIR }}" "big32"
173173

174174
- name: Test authorize-preimage-and-store (Westend parachain)
175175
working-directory: examples
@@ -211,7 +211,7 @@ jobs:
211211
212212
- name: Test store-big-data (Polkadot solochain)
213213
working-directory: examples
214-
run: just run-test-store-big-data "${{ env.TEST_DIR }}"
214+
run: just run-test-store-big-data "${{ env.TEST_DIR }}" "big32"
215215

216216
- name: Test authorize-preimage-and-store (Polkadot solochain)
217217
working-directory: examples

examples/justfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,13 +462,14 @@ run-test-store-chunked-data test_dir ws_url="ws://localhost:10000" seed="//Alice
462462
# Run store-big-data test only (services must already be running via start-services)
463463
# Parameters:
464464
# test_dir - Test directory where services are running
465+
# image_size - Image size preset: small, big32, big64, big96 (default: big64)
465466
# ws_url - WebSocket URL of the Bulletin chain node (default: ws://localhost:10000)
466467
# seed - Account seed phrase or dev seed (default: //Alice)
467-
# http_ipfs_api - IPFS API URL (default: http://127.0.0.1:5011)
468-
run-test-store-big-data test_dir ws_url="ws://localhost:10000" seed="//Alice" http_ipfs_api="http://127.0.0.1:5011":
468+
# ipfs_gateway_url - IPFS Gateway URL (default: http://127.0.0.1:8283)
469+
run-test-store-big-data test_dir image_size="big64" ws_url="ws://localhost:10000" seed="//Alice" ipfs_gateway_url="http://127.0.0.1:8283":
469470
#!/usr/bin/env bash
470471
set -e
471-
node store_big_data.js "{{ ws_url }}" "{{ seed }}" "{{ http_ipfs_api }}"
472+
node store_big_data.js "{{ ws_url }}" "{{ seed }}" "{{ ipfs_gateway_url }}" "{{ image_size }}"
472473

473474
# Run authorize-preimage-and-store test only (services must already be running via start-services)
474475
# Parameters:

examples/store_big_data.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ import { createClient } from 'polkadot-api';
2828
import { getWsProvider } from "polkadot-api/ws-provider";
2929
import { bulletin } from './.papi/descriptors/dist/index.mjs';
3030

31-
// Command line arguments: [ws_url] [seed] [ipfs_gateway_url]
31+
// Command line arguments: [ws_url] [seed] [ipfs_gateway_url] [image_size]
3232
// Note: --signer-disc=XX flag is also supported for parallel runs
3333
const args = process.argv.slice(2).filter(arg => !arg.startsWith('--'));
3434
const NODE_WS = args[0] || 'ws://localhost:10000';
3535
const SEED = args[1] || '//Alice';
3636
const IPFS_GATEWAY_URL = args[2] || DEFAULT_IPFS_GATEWAY_URL;
3737
// Derive API URL from gateway URL (port 8283 -> 5011)
3838
const IPFS_API_URL = IPFS_GATEWAY_URL.replace(':8283', ':5011');
39+
// Image size preset: small, big32, big64, big96
40+
const IMAGE_SIZE = args[3] || 'big96';
3941
const NUM_SIGNERS = 16;
4042

4143
// -------------------- queue --------------------
@@ -213,7 +215,7 @@ async function main() {
213215
const filePath = path.join(tmpDir, "image.jpeg");
214216
const downloadedFilePath = path.join(tmpDir, "downloaded.jpeg");
215217
const downloadedFileByDagPath = path.join(tmpDir, "downloadedByDag.jpeg");
216-
generateTextImage(filePath, "Hello, Bulletin big64 - " + new Date().toString(), "big64");
218+
generateTextImage(filePath, `Hello, Bulletin ${IMAGE_SIZE} - ` + new Date().toString(), IMAGE_SIZE);
217219

218220
// Init WS PAPI client and typed api.
219221
client = createClient(getWsProvider(NODE_WS));

0 commit comments

Comments
 (0)