Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pluveto/jsonrpc-cli
A jsonrpc command line tool for devlopment and testing.
https://github.com/pluveto/jsonrpc-cli
Last synced: 4 days ago
JSON representation
A jsonrpc command line tool for devlopment and testing.
- Host: GitHub
- URL: https://github.com/pluveto/jsonrpc-cli
- Owner: pluveto
- License: mit
- Created: 2023-11-17T09:39:30.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2023-11-18T03:41:10.000Z (12 months ago)
- Last Synced: 2024-10-08T05:21:56.753Z (about 1 month ago)
- Language: Rust
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
jsonrpc-cli
========A jsonrpc command line utility for devlopment and testing.
Usage
--------jsonrpc-cli --endpoint [options] []
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 jsonrpc version, default: 2.0
-e, --endpoint jsonrpc server endpoint
-i, --id jsonrpc id, e.g. "test", "int(1)", "null()"
-d, --verbose verbose output for debuggingNOTE: `--endpoint` can be set by environment variable `JSONRPC_ENDPOINT`.
Build and Install
--------Released binaries are available at . Or you can build it from source code:
git clone https://github.com/pluveto/jsonrpc-cli
cd jsonrpc-cliDefault PREFIX is `/usr/local`, you can change it by `make PREFIX=/path/to/prefix install`.
make
make installLicense
--------This program is licensed under the MIT license.