Skip to content

Instantly share code, notes, and snippets.

@plowsof
Last active February 18, 2023 05:57
Show Gist options
  • Save plowsof/97beade04012780bb8d89266455af99b to your computer and use it in GitHub Desktop.
Save plowsof/97beade04012780bb8d89266455af99b to your computer and use it in GitHub Desktop.
benchmark creating 300 accounts with 5k sub addresses each then saving / opening
curl http://localhost:18092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_wallet","params":{"filename":"brb20hours","password":"","language":"English"}}' -H 'Content-Type: application/json'
curl http://localhost:18092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"brb20hours","password":""}}' -H 'Content-Type: application/json'
gen_addresses () {
x=1
while [ $x -le 300 ]
do
curl -s -o /dev/null http://localhost:18092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"account '"${x}"'"}}' -H 'Content-Type: application/json'
curl -s -o /dev/null http://localhost:18092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":'"${x}"',"label":"new-subs","count":5000}}' -H 'Content-Type: application/json'
((x+=1))
done
}
time gen_addresses
echo "save"
time curl http://localhost:18092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"store"}' -H 'Content-Type: application/json'
echo "close"
time curl http://localhost:18092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"close_wallet"}' -H 'Content-Type: application/json'
echo "open"
time curl http://localhost:18092/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"open_wallet","params":{"filename":"brb20hours","password":""}}' -H 'Content-Type: application/json'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment