2020-08-08 15:10:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# vim: set expandtab ts=2 sw=2:
|
|
|
|
|
2020-10-11 18:12:01 +00:00
|
|
|
_lotus_token=$(./lotus auth create-token --perm admin)
|
2020-08-08 15:10:09 +00:00
|
|
|
|
|
|
|
runAPI() {
|
|
|
|
curl -X POST \
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
--data '{"jsonrpc":"2.0","id":2,"method":"Filecoin.'"$1"'","params":'"${2:-null}"'}' \
|
2020-10-11 18:12:01 +00:00
|
|
|
'http://127.0.0.1:1234/rpc/v0?token='"$_lotus_token"
|
2020-08-08 15:10:09 +00:00
|
|
|
}
|