-
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
17491e9
commit 5aa1117
Showing
5 changed files
with
38 additions
and
93 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
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
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
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
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,36 +1,29 @@ | ||
BINARY=secretcli | ||
CHAINID_1="pulsar-2" | ||
CHAINID_1="pulsar-3" | ||
CONTRACT_PATH=./cosmwasm/artifacts/std_reference.wasm | ||
RPC="https://rpc.testnet.secretsaturn.net" | ||
RPC="https://rpc.pulsar3.scrttestnet.com:443" | ||
NODE="--node $RPC" | ||
TXFLAG="$NODE --chain-id $CHAINID_1 --gas-prices 1uscrt --gas-adjustment 1.3" | ||
TXFLAG="$NODE --chain-id $CHAINID_1 --gas-prices 1uscrt --gas-adjustment 1.3 --broadcast-mode block --gas auto" | ||
|
||
export DEMOWALLET=$($BINARY keys show relayer -a --keyring-backend=test --keyring-dir=./relayer-data/ ) && echo $DEMOWALLET; | ||
$BINARY query wasm list-code $NODE | ||
export DEMOWALLET=$($BINARY keys show relayer2 -a --keyring-backend=test ) && echo $DEMOWALLET; | ||
|
||
# deploy smart contract | ||
$BINARY tx compute store $CONTRACT_PATH --from $DEMOWALLET --keyring-backend=test --keyring-dir=./cw-relayer/data/ $TXFLAG -y | ||
sleep 5 | ||
|
||
$BINARY tx compute instantiate 19480 '{}' --label=newtest --from $DEMOWALLET --keyring-backend=test --keyring-dir=./cw-relayer/data/ -y | ||
sleep 5 | ||
$BINARY tx compute store $CONTRACT_PATH --from $DEMOWALLET --keyring-backend=test $TXFLAG -y | ||
|
||
#instantiate contract | ||
$BINARY tx compute instantiate 1 '{}' --label=newthings --from $DEMOWALLET --keyring-backend=test --keyring-dir=./cw-relayer/newrelayerdata/ --sign-mode=direct $TXFLAG -y | ||
sleep 5 | ||
$BINARY tx compute instantiate 1 '{}' --label=test --from $DEMOWALLET --keyring-backend=test -y | ||
|
||
## query contract address | ||
CONTRACT=$($BINARY query compute list-contract-by-code "19480" $NODE --output json | jq -r '.[0].contract_address') | ||
# query contract address | ||
CONTRACT=$($BINARY query compute list-contract-by-code "1" $NODE --output json | jq -r '.[0].contract_address') | ||
echo $CONTRACT | ||
|
||
#sample | ||
#adding relayer | ||
ADD_RELAYERS='{"add_relayers": {"relayers": ["secret19uywplnd25gzxgc3t8pyqsl2tcse8heag2s6av"]}}' | ||
$BINARY tx compute execute $CONTRACT "$ADD_RELAYERS" --keyring-dir=./relayer-data --keyring-backend=test --from $DEMOWALLET --dry-run -y | ||
sleep 5 | ||
$BINARY tx compute execute $CONTRACT "$ADD_RELAYERS" --from $DEMOWALLET --keyring-backend=test $TXFLAG -y | ||
|
||
#sample price tx | ||
RELAY='{"force_relay": {"symbol_rates": [["ATOM","14"]], "resolve_time":"10", "request_id":"2"}}' | ||
$BINARY tx compute execute $CONTRACT "$RELAY" --keyring-backend=test --keyring-dir=./cw-relayer/data/ --sign-mode=direct --from $DEMOWALLET $TXFLAG --offline | ||
sleep 5 | ||
$BINARY tx compute execute $CONTRACT "$RELAY" --keyring-backend=test --sign-mode=direct --from $DEMOWALLET $TXFLAG | ||
|
||
QUERY='{"get_ref": {"symbol": "ATOM"}}' | ||
$BINARY query compute query $CONTRACT "$QUERY" $NODE --output json |