Skip to content

Instantly share code, notes, and snippets.

@randomlogin
Last active March 23, 2021 03:20
Show Gist options
  • Save randomlogin/d110b89a55152551a99ba459e3f8896d to your computer and use it in GitHub Desktop.
Save randomlogin/d110b89a55152551a99ba459e3f8896d to your computer and use it in GitHub Desktop.
getbids-not-showing-all-bids.sh
export HSD_NETWORK=regtest
curl http://x:api-key@127.0.0.1:14037 -X POST --data '{"method": "generate","params": [2050]}' #pass the initial lock period
#create 2 wallets, populate them with some hns
hsw-cli mkwallet qwerty
hsw-cli send $(hsw-cli address default --id qwerty | grep -oP '(?<="address": ")[^"]*') 10000 --id=primary #grep extracts address
hsw-cli mkwallet asdfg
hsw-cli send $(hsw-cli address default --id asdfg | grep -oP '(?<="address": ")[^"]*') 10000 --id=primary
curl http://x:api-key@127.0.0.1:14037 -X POST --data '{"method": "generate","params": [1]}'
#make bids
hsw-rpc sendopen sense
curl http://x:api-key@127.0.0.1:14037 -X POST --data '{"method": "generate","params": [6]}'
hsw-rpc selectwallet qwerty
hsw-rpc sendbid sense 1 1
curl http://x:api-key@127.0.0.1:14037 -X POST --data '{"method": "generate","params": [1]}'
hsw-rpc selectwallet asdfg
hsw-rpc sendbid sense 20 21
curl http://x:api-key@127.0.0.1:14037 -X POST --data '{"method": "generate","params": [1]}'
#view the bids from different wallets
printf "\n\nchecking from the first wallet\n\n"
hsw-rpc selectwallet qwerty
hsw-rpc getbids sense
printf "\n\nchecking from the second wallet\n\n"
hsw-rpc selectwallet asdfg
hsw-rpc getbids sense
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment