@@ -28,14 +28,16 @@ import { createClient } from 'polkadot-api';
2828import { getWsProvider } from "polkadot-api/ws-provider" ;
2929import { 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
3333const args = process . argv . slice ( 2 ) . filter ( arg => ! arg . startsWith ( '--' ) ) ;
3434const NODE_WS = args [ 0 ] || 'ws://localhost:10000' ;
3535const SEED = args [ 1 ] || '//Alice' ;
3636const IPFS_GATEWAY_URL = args [ 2 ] || DEFAULT_IPFS_GATEWAY_URL ;
3737// Derive API URL from gateway URL (port 8283 -> 5011)
3838const IPFS_API_URL = IPFS_GATEWAY_URL . replace ( ':8283' , ':5011' ) ;
39+ // Image size preset: small, big32, big64, big96
40+ const IMAGE_SIZE = args [ 3 ] || 'big96' ;
3941const 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