-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.ps1
More file actions
9 lines (8 loc) · 699 Bytes
/
demo.ps1
File metadata and controls
9 lines (8 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
# Demo flow for the blockchain API.
$base = 'http://127.0.0.1:8000'
Invoke-RestMethod -Method Post -Uri "$base/transactions" -ContentType 'application/json' -Body '{"sender":"alice","recipient":"bob","amount":2.5}'
Invoke-RestMethod -Method Post -Uri "$base/transactions" -ContentType 'application/json' -Body '{"sender":"bob","recipient":"charlie","amount":1.2}'
Invoke-RestMethod -Method Post -Uri "$base/mine" -ContentType 'application/json' -Body '{"miner":"miner1"}'
Invoke-RestMethod -Method Get -Uri "$base/balance/miner1"
Invoke-RestMethod -Method Post -Uri "$base/save" -ContentType 'application/json' -Body '{"path":"data/chain.json"}'
Invoke-RestMethod -Method Get -Uri "$base/chain"