diff --git a/core/src/cli/commands/coordinator/serve.rs b/core/src/cli/commands/coordinator/serve.rs index 8f2c547..88d0ecb 100644 --- a/core/src/cli/commands/coordinator/serve.rs +++ b/core/src/cli/commands/coordinator/serve.rs @@ -28,7 +28,7 @@ impl DriaOracle { Ok(None) => { log::info!("Task {} ignored.", task_id) } - Err(e) => log::error!("Could not process task: {:?}", e), + Err(e) => log::error!("Could not process task {}: {:?}", task_id, e), } Ok(()) @@ -41,7 +41,7 @@ impl DriaOracle { }; if let Err(err) = handle_request(self, status, event.taskId, event.protocol).await { - log::error!("Could not process task: {:?}", err); + log::error!("Could not process task {}: {:?}", event.taskId, err); } } diff --git a/core/src/compute/generation/postprocess/swan.rs b/core/src/compute/generation/postprocess/swan.rs index f46304f..59e7a41 100644 --- a/core/src/compute/generation/postprocess/swan.rs +++ b/core/src/compute/generation/postprocess/swan.rs @@ -43,7 +43,12 @@ impl PostProcess for SwanPurchasePostProcessor { .map(|end| input[start..start + end].to_string()) }) .ok_or_else(|| { - eyre::eyre!("could not find {} ~ {}", self.start_marker, self.end_marker) + eyre::eyre!( + "could not find {} ~ {} in result: {}", + input, + self.start_marker, + self.end_marker + ) })?; // collect the chosen addresses diff --git a/misc/arweave.js b/misc/arweave.js index 7761e3a..e5c5f7d 100644 --- a/misc/arweave.js +++ b/misc/arweave.js @@ -17,30 +17,34 @@ * Can be piped to `pbcopy` on macOS to copy the output to clipboard. */ -// parse input -let input = process.argv[2]; -if (!input) { - console.error("No input provided."); - return; -} +async function main() { + // parse input + let input = process.argv[2]; + if (!input) { + console.error("No input provided."); + return; + } + + let arweaveTxId; + if (input.startsWith("0x")) { + // if it starts with 0x, we assume its all hex + arweaveTxId = JSON.parse( + Buffer.from(input.slice(2), "hex").toString() + ).arweave; + } else if (input.startsWith("{")) { + // if it starts with {, we assume its a JSON string + console.log("input", input); + arweaveTxId = JSON.parse(input).arweave; + } else { + // otherwise, we assume its a base64 txid + arweaveTxId = input; + } -let arweaveTxId; -if (input.startsWith("0x")) { - // if it starts with 0x, we assume its all hex - arweaveTxId = JSON.parse( - Buffer.from(input.slice(2), "hex").toString() - ).arweave; -} else if (input.startsWith("{")) { - // if it starts with {, we assume its a JSON string - console.log("input", input); - arweaveTxId = JSON.parse(input).arweave; -} else { - // otherwise, we assume its a base64 txid - arweaveTxId = input; + // construct the URL + // download the actual response from Arweave + const url = `https://arweave.net/${arweaveTxId}`; + const res = await fetch(url); + console.log(await res.text()); } -// construct the URL -// download the actual response from Arweave -const url = `https://arweave.net/${arweaveTxId}`; -const res = await fetch(url); -console.log(await res.text()); +main().catch(console.error);