Created
April 15, 2020 21:41
-
-
Save tynes/a64e9f3bb4fc356e9c68da835944c20e to your computer and use it in GitHub Desktop.
Bash script for going through an auction
This file contains hidden or 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
#!/bin/bash | |
# First argument must be the path to | |
# the hsd gitrepo, ie ./hsd-auction $PWD/hsd | |
HSD_="$1/bin/hsd" | |
HSW_CLI="$1/bin/hsw-cli" | |
HSD_CLI="$1/bin/hsd-cli" | |
export HSD_NETWORK=regtest | |
ADDRESS=$($HSW_CLI account get default | jq -r .receiveAddress) | |
$HSD_CLI rpc generatetoaddress 10 "$ADDRESS" > /dev/null | |
NAME=$($HSD_CLI rpc grindname) | |
$HSW_CLI rpc sendopen "$NAME" > /dev/null | |
$HSD_CLI rpc generatetoaddress 1 "$ADDRESS" > /dev/null | |
BLOCKS_TO_BID=$($HSD_CLI rpc getnameinfo "$NAME" | jq -r .info.stats.blocksUntilBidding) | |
$HSD_CLI rpc generatetoaddress "$BLOCKS_TO_BID" "$ADDRESS" > /dev/null | |
$HSW_CLI rpc sendbid "$NAME" 1 1 > /dev/null | |
BLOCKS_TO_REVEAL=$($HSD_CLI rpc getnameinfo "$NAME" | jq -r .info.stats.blocksUntilReveal) | |
$HSD_CLI rpc generatetoaddress "$BLOCKS_TO_REVEAL" "$ADDRESS" > /dev/null | |
$HSW_CLI rpc sendreveal "$NAME" > /dev/null | |
BLOCKS_TO_CLOSE=$($HSD_CLI rpc getnameinfo "$NAME" | jq -r .info.stats.blocksUntilClose) | |
$HSD_CLI rpc generatetoaddress "$BLOCKS_TO_CLOSE" "$ADDRESS" > /dev/null | |
$HSW_CLI rpc sendupdate "$NAME" '{"records": [{"type": "NS", "ns": "ns1.dns.live."}]}' > /dev/null | |
$HSD_CLI rpc generatetoaddress 25 "$ADDRESS" > /dev/null | |
$HSD_CLI rpc getnameresource "$NAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment