Skip to content

Instantly share code, notes, and snippets.

@spirobel
Created January 26, 2022 23:40
Show Gist options
  • Save spirobel/4067786d142a5f08540e530e585610d8 to your computer and use it in GitHub Desktop.
Save spirobel/4067786d142a5f08540e530e585610d8 to your computer and use it in GitHub Desktop.
two scripts to create and open monero wallets via the wallet rpc (using curl)
#!/bin/sh
IP=127.0.0.1
PORT=18082
METHOD="create_wallet"
PARAMS="{\"filename\":\"emptywallet\",\"language\":\"English\"}"
curl \
-u username:password --digest \
http://$IP:$PORT/json_rpc \
-d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \
-H 'Content-Type: application/json'
#!/bin/sh
IP=127.0.0.1
PORT=18082
METHOD="open_wallet"
PARAMS="{\"filename\":\"emptywallet\"}"
curl \
-u username:password --digest \
http://$IP:$PORT/json_rpc \
-d '{"jsonrpc":"2.0","id":"0","method":"'$METHOD'","params":'"$PARAMS"'}' \
-H 'Content-Type: application/json'
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment