-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14fd8f8
commit 7780400
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
#!/bin/bash | ||
cast_output=$(cast call 0x9fb0F63B569f9FD8718Bbb2856a4b6F2458C2d70 "upload_to_arweave(string)" "hello world!" --rpc-url https://testnet-rpc.wvm.dev) | ||
cast_output=$(cast call 0x9fb0F63B569f9FD8718Bbb2856a4b6F2458C2d70 "upload_to_arweave(string)" "Hello, world!" --rpc-url https://testnet-rpc.wvm.dev) | ||
|
||
data_hex=$(echo "$cast_output" | cut -c 129-214) | ||
# Add debug output to see the exact string we're working with | ||
echo "Raw output: $cast_output" | ||
|
||
# Use grep to extract the hex string more reliably | ||
data_hex=$(echo "$cast_output" | grep -o '0x[0-9a-fA-F]\+' | tail -n 1 | sed 's/^0x//') | ||
|
||
# Add debug output for the extracted hex | ||
echo "Extracted hex: $data_hex" | ||
|
||
# Decode the hex data to get the Arweave transaction hash | ||
tx_hash=$(echo "$data_hex" | xxd -r -p) | ||
|
||
# Generate the viewblock.io URL using the extracted transaction hash | ||
viewblock_url="https://viewblock.io/arweave/tx/$tx_hash" | ||
viewblock_url="https://viewblock.io/arweave/tx/$(echo "$tx_hash" | tr -d ' +')" | ||
|
||
# Output the URL | ||
echo "$viewblock_url" | ||
echo "The transaction will take ~5-10 minutes to confirm. View it here: $viewblock_url" |