Last active
February 27, 2025 09:40
-
-
Save pyropy/2d7c3ca02820a756bcd6155e7491831f to your computer and use it in GitHub Desktop.
Revisions
-
pyropy renamed this gist
Feb 27, 2025 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
pyropy revised this gist
Feb 27, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const retrievalTasks = [ EOF # Call the binary with the generated config file and write output to the log file XDG_CACHE_HOME=/downloads ./zinnia run main.js > "$LOG_FILE" 2>&1 # Clean up config file after execution rm -f "$CONFIG_FILE" -
pyropy created this gist
Feb 27, 2025 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ #!/bin/bash # Define the JSON file JSON_FILE="tasks.json" # Check if jq is installed if ! command -v jq &> /dev/null; then echo "jq is required but not installed. Please install jq first." exit 1 fi # Counter for log filenames INDEX=0 # Read JSON array and iterate over items jq -c '.[]' "$JSON_FILE" | while IFS= read -r task; do # Define config file and log file CONFIG_FILE="config.js" LOG_FILE="output_${INDEX}.log" # Create config.js with JSON content cat <<EOF > "$CONFIG_FILE" // Specifies which round to analyze (default: undefined, uses current round) export const roundId = undefined // Limits the number of tasks to process (default: undefined, processes all tasks) export const maxTasks = undefined // Focuses spot check on a specific storage provider (default: undefined, spot checks all miners) export const minerId = undefined // Sets a size limit for single spot check data retrieval (default: undefined, no size limit) export const maxByteLength = undefined // Array of tasks to execute retrievals (default: [] - tasks will be loaded from the network) export const retrievalTasks = [ $task ] EOF # Call the binary with the generated config file and write output to the log file ./zinnia run main.js > "$LOG_FILE" 2>&1 # Clean up config file after execution rm -f "$CONFIG_FILE" # Increment log index ((INDEX++)) done