Skip to content

Commit f442006

Browse files
committed
add examples with parameters
1 parent c7350a6 commit f442006

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,32 @@ $ ./jsonrpc-cli --user=rpcuser --pass=rpcpassword http://localhost:28332/ getbl
3333
588589
3434
```
3535

36+
## With method parameters
37+
38+
### params as separate command-line args
39+
40+
```
41+
$ ./jsonrpc-cli --user=rpcuser --pass=rpcpassword http://localhost:28332/ estimatesmartfee 1 ECONOMICAL
42+
43+
{
44+
"_feerate": "0.00027031",
45+
"blocks": 1,
46+
"feerate": 0.00027031
47+
}
48+
```
49+
50+
### params as a json string
51+
52+
```
53+
$ ./jsonrpc-cli --user=rpcuser --pass=rpcpassword http://localhost:28332/ estimatesmartfee '[1,"ECONOMICAL"]'
54+
55+
{
56+
"_feerate": "0.00027031",
57+
"blocks": 1,
58+
"feerate": 0.00027031
59+
}
60+
```
61+
3662
## Server's full json response.
3763

3864
For this, we specify --resultonly=off
@@ -264,6 +290,7 @@ $ ./jsonrpc-cli --help
264290

265291
# Todos
266292

293+
* read method parameters from stdin
267294
* make test cases
268295
* Support batching (maybe)
269296

0 commit comments

Comments
 (0)