-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit-and-publish.sh
33 lines (22 loc) · 986 Bytes
/
init-and-publish.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Build
cargo build --release
# Initialize the oracle
./target/release/pm-oracle-cli init
# Initialize the publisher
./target/release/pm-publisher-cli init
# Extract the publisher_account_id from the JSON file
PUBLISHER_ADDRESS=$(jq -r '.data.publisher_account_id' ./pragma_miden.json)
# Publish using the extracted address
./target/release/pm-publisher-cli publish "$PUBLISHER_ADDRESS" BTC/USD 98179840000 2 1738593825
# Register the publisher
./target/release/pm-oracle-cli register-publisher "$PUBLISHER_ADDRESS"
# Reproduce this step for the second publisher
./target/release/pm-publisher-cli init
PUBLISHER_ADDRESS=$(jq -r '.data.publisher_account_id' ./pragma_miden.json)
./target/release/pm-publisher-cli publish "$PUBLISHER_ADDRESS" BTC/USD 98179880000 2 1738593825
./target/release/pm-oracle-cli register-publisher "$PUBLISHER_ADDRESS"
# Wait for registration to complete
sleep 5
# Query the BTC/USD entry
./target/release/pm-oracle-cli median BTC/USD