Skip to content

Commit fe4399d

Browse files
authored
metadata tx (#70)
1 parent 23345b6 commit fe4399d

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

scripts/ga/info.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# ~~~~~~~~~~~~ CHANGE THIS ~~~~~~~~~~~~
44

5-
METADATA_URL="https://raw.githubusercontent.com/Ryun1/metadata/refs/heads/main/cip108/no-confidence.jsonld"
6-
METADATA_HASH="f95826679a0097b5132f0af398676402e77bce0cf2d08ca7d0ffe1952d4f6872"
5+
METADATA_URL="ipfs://bafkreif2mbndv6nqpect6hbpyunfbu6lnbo2nmqo6rla5kgowbxz45sh6y"
6+
METADATA_HASH="3721b453df890ba0690c68efad99373aa80afb3e40c059fc6c859e41fb8867be"
77

88
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99

scripts/ga/parameter.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

33
# ~~~~~~~~~~~~ CHANGE THIS ~~~~~~~~~~~~
4-
METADATA_URL="ipfs://bafkreie7nigppy74jyjoibe5ovxy2wulrnk7pn6iocpyrpdhbwtec6mufi"
5-
METADATA_HASH="281f512aff1ab91a0ed3207d3f7a03e55f9dc179cb0f6f3c9ffaf9743dd11e8d"
4+
METADATA_URL="ipfs://bafkreia5vseqm3hqmds45gje4szvekwkzd4mebzeepbh2cdlr3krxcj2ou"
5+
METADATA_HASH="dfa2df398319b48e80a2caf02f4165bf12b6689d0ed57eee5e13dfa94857ed71"
66
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77

88
# Define directory paths

scripts/simple/metadata-tx.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
# ~~~~~~~~~~~~ CHANGE THIS ~~~~~~~~~~~~
4+
5+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6+
7+
# Define directory paths
8+
keys_dir="./keys"
9+
txs_dir="./txs"
10+
tx_path_stub="$txs_dir/metadata-transaction"
11+
tx_unsigned_path="$tx_path_stub.unsigned"
12+
tx_signed_path="$tx_path_stub.signed"
13+
14+
# Get the script's directory
15+
script_dir=$(dirname "$0")
16+
17+
# Get the container name from the get-container script
18+
container_name="$("$script_dir/../helper/get-container.sh")"
19+
20+
if [ -z "$container_name" ]; then
21+
echo "Failed to determine a running container."
22+
exit 1
23+
fi
24+
25+
echo "Using running container: $container_name"
26+
27+
# Function to execute cardano-cli commands inside the container
28+
container_cli() {
29+
docker exec -ti $container_name cardano-cli "$@"
30+
}
31+
32+
echo "Building transaction"
33+
34+
container_cli conway transaction build \
35+
--tx-in $(container_cli conway query utxo --address $(cat $keys_dir/payment.addr) --out-file /dev/stdout | jq -r 'keys[0]') \
36+
--change-address $(cat $keys_dir/payment.addr) \
37+
--metadata-json-file "$txs_dir/metadata.json" \
38+
--out-file "$tx_unsigned_path"
39+
40+
container_cli conway transaction sign \
41+
--tx-body-file "$tx_unsigned_path" \
42+
--signing-key-file $keys_dir/payment.skey \
43+
--out-file "$tx_signed_path"
44+
45+
# Submit the transaction
46+
echo "Submitting transaction"
47+
48+
container_cli conway transaction submit --tx-file $tx_signed_path

0 commit comments

Comments
 (0)