├── LICENSE ├── README.md ├── qr-small.png └── xmrpc.sh /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2019, The Monero Project 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software without 17 | specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | Parts of the project are originally copyright (c) 2012-2013 The Cryptonote 31 | developers. 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # xmrpc 2 | 3 | A small utility for calling the Monero JSON RPC interface(s). 4 | 5 | When developing software that uses the Monero RPC interface, one often ends up 6 | using `curl` to test the methods. This little script just aids the lazy from 7 | typing out the long `curl` commands or formatting the JSON payload. 8 | 9 | ## Install 10 | 11 | Just copy [xmrpc.sh](./xmrpc.sh) to somewhere in your `PATH`. 12 | 13 | ## Usage 14 | 15 | xmrpc.sh [host:]port method [name:value ...] 16 | 17 | ### Examples 18 | 19 | xmrpc.sh 28081 get_version 20 | xmrpc.sh node.xmr.to:18081 get_version 21 | xmrpc.sh 28081 get_block height:123456 22 | xmrpc.sh 28081 get_block hash:aaaac8fe6bd05f32aa68b9bd13d66d2056335a1a4a88c788f7a07ab8a1e64912 23 | xmrpc.sh 28084 get_transfers in:true 24 | xmrpc.sh 28084 get_address account_index:0 address_index:[0,1] 25 | 26 | ### Searching 27 | 28 | If you have the Monero source tree and set an enviroment variable `MONERO_ROOT` 29 | to its path, you can then use the `doc` command to search methods and get the 30 | expected parameters from the code. For example: 31 | 32 | xmrpc.sh doc transfer 33 | xmrpc.sh doc ".*bulk.*pay" 34 | xmrpc.sh doc ".*pay" 35 | xmrpc.sh doc ".*" 36 | 37 | ## Supporting the project 38 | 39 | If you use it and want to donate, XMR donations to: 40 | 41 | ``` 42 | 451ytzQg1vUVkuAW73VsQ72G96FUjASi4WNQse3v8ALfjiR5vLzGQ2hMUdYhG38Fi15eJ5FJ1ZL4EV1SFVi228muGX4f3SV 43 | ``` 44 | 45 | ![QR code](./qr-small.png) 46 | 47 | would be very much appreciated. 48 | 49 | ## License 50 | 51 | Please see the [LICENSE](./LICENSE) file. 52 | 53 | [//]: # ( vim: set tw=80: ) 54 | -------------------------------------------------------------------------------- /qr-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jtgrassie/xmrpc/defdc6228ba85c14b6d5e48668281663ddaeee1f/qr-small.png -------------------------------------------------------------------------------- /xmrpc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2014-2019, The Monero Project 4 | # 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # 1. Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # 2. Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # 3. Neither the name of the copyright holder nor the names of its contributors 18 | # may be used to endorse or promote products derived from this software without 19 | # specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 25 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 28 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | usage() { 33 | me="$(basename $0)" 34 | echo -e "$(cat <