-
Notifications
You must be signed in to change notification settings - Fork 0
A jsonrpc command line tool for devlopment and testing.
License
pluveto/jsonrpc-cli
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
jsonrpc-cli
========
A jsonrpc command line utility for devlopment and testing.
Usage
--------
jsonrpc-cli --endpoint <endpoint> [options] <method> [<params>]
Params can be the following formats:
1. JSON string, e.g. `{"a": 1, "b": 2}`
2. JSON file, e.g. `@/path/to/file.json`
3. Key-value pair
Examples
- `a=int(1) b=null()` generates `{"a": 1, "b": null}`
- `--a=1 --b=2` generates `{"a": "1", "b": "2"}`
- `-a 1 -b 2` generates `{"a": "1", "b": "2"}`
4. Array separated by comma, e.g. `1,2,3` generates `[1, 2, 3]`
Examples
--------
# call `add` method with params `{"a": 1, "b": 2}`
JSONRPC_ENDPOINT=http://localhost:3000 jsonrpc add 1 2
# alternatively
JSONRPC_ENDPOINT=http://localhost:3000 jsonrpc add 1,2
# call `vector_product` method with params `{"a": [1, 2, 3], "b": [4, 5, 6]}`
JSONRPC_ENDPOINT=http://localhost:3000 jsonrpc vector_product {"a": [1, 2, 3], "b": [4, 5, 6]}
Options
--------
-h, --help output usage information
-V, --version output the version number
-v, --rpc-version <version> jsonrpc version, default: 2.0
-e, --endpoint <endpoint> jsonrpc server endpoint
-i, --id <id> jsonrpc id, e.g. "test", "int(1)", "null()"
-d, --verbose verbose output for debugging
NOTE: `--endpoint` can be set by environment variable `JSONRPC_ENDPOINT`.
Build and Install
--------
Released binaries are available at <https://github.com/pluveto/jsonrpc-cli/releases>. Or you can build it from source code:
git clone https://github.com/pluveto/jsonrpc-cli
cd jsonrpc-cli
Default PREFIX is `/usr/local`, you can change it by `make PREFIX=/path/to/prefix install`.
make
make install
License
--------
This program is licensed under the MIT license.
About
A jsonrpc command line tool for devlopment and testing.
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published