Skip to main content

Cli for interacting with the MoneroDaemon-RPC API

Project description

Monero-api-cli

Cli for interacting with the MoneroDaemon-RPC API

Banner
monero-api-cli is a Python cli application meant for remotely interacting with a Monero Daemon via its RPC API
Under the hood it mostly uses the Prompt-Toolkit module for its REPL interface and Requests for the actual interaction with the API

Usage:

$ monero-api-cli --help
usage: [-h] [-v] [--daemon-address DAEMON_ADDRESS] [--config-file CONFIG_FILE] {help,get_info} ...

Cli for interacting with the MoneroDaemon-RPC API

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  --daemon-address DAEMON_ADDRESS
                        Which daemon address to use, format: [IPv4 address]:[Port number]
  --config-file CONFIG_FILE
                        Path to config file

RPC methods:
  {help,get_info}
    help                Help information regarding a command
    get_info            Invoke the get_info RPC method

If you call the app with no additional arguments it will enter into a REPL cli mode otherwise it will just take the argument as a RPC method.

Available RPC Methods/Arguments:

help

helpimage

If no additional arguments are passed it will go into REPL mode
Otherwise it will just take the argument and display the help message associated with it

get_info

Calls the get_info RPC method

version (REPL only)

Print current version

exit (REPL only)

Exit the cli REPL mode
You can also use Ctrl+C to exit

Available options:

-h, --help

Show help message and exits

-v, --version

Show current version and exit

--daemon-address

Which daemon address to use, format: [IPv4 address]:[Port number]

--config-file

Path for a config file
Check Config File section for more details

Example usage:

example

Config File:

Default location for config file is /etc/monero-api-cli/monero-api-cli.config for MacOS/Linux
And C:\ProgramData\MoneroApiCli\monero-api-cli.confg for Windows
Example config file located at root of this repo, named monero-api-config.config

# Config File INI/TOML like syntax
# Lines starting with # are comments and have their respective default options
[settings]
# Which daemon address to use, format: [IPv4 address]:[Port number]
daemon-address = 127.0.0.1:18081

Dependencies:

Because the app is bundled using pyinstaller dependencies are not required on the binary versions
The dependencies are only required when working direclty with the source
Install all python module dependencies with: pip install -r requirements.txt

Name PyPi Name What is it used for?
Python N/A Necessary for interpreting source code
Requests module requests Used in the implementation of interacting with the API
Prompt Toolkit module prompt_toolkit Used in the implementation of REPL cli mode

How to install

From PyPi via pip

pip install monero-api-cli
You can either use the source code with the Python interpretor directly
Or you could use the provided binary available at dist/monero-api-cli for MacOS/Linux and dist/monero-api-cli.exe for Windows

Step 0:

Clone this repo :P

$ git clone https://github.com/Dvd-Znf/monero-api-cli

Step 1 (With binary):

Use the provided binary
Dependencies are already bundled in, you dont need to install anything!

$ cd monero-api-cli
$ ./dist/monero-api-cli  # MacOS/Linux     
PS> ./dist/monero-api-cli.exe # Windows     

If you get permisions error add execute permisions with: chmod +x <path to binary>

Step 1 (From source, recommended for development):

Make sure you have all dependencies installed
Then just use the Python interpretor on the launcher.py script

$ cd monero-api-cli   
$ python launcher.py     

Or you can run the source directly as a module

$ python -m src.monero_api_cli

Why make this from zero when python-monero module already exists?

This is not meant as a replacement for python-monero module!
Instead, this is an independent cli application for interacting with monerod via its RPC API
i.e. cli-app & no wallet RPC
This is mostly meant for monero node operators who would like a nice, intuitive and easy way to interact with their daemon
This is the reason I made this.
python-monero last update to its source code was more than a year ago, even tho it could use some improvements, at least to its docs.
This is activly developed.
After first realse you may integrate monero-api-cli into whatever you want but thats not my problem/focus.

Can't you ssh into your node then just use monerod?

Some setups require the daemon to be non-interactive
Also that sound super laaaameeeeeee

TODO:

  • Add ability to switch daemon address from REPL interactive mode
    • Create a separate function for IP address validation

TODO for v1.0.0:

  • Implement more of the API :P

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monero-api-cli-0.2.0.tar.gz (12.5 kB view hashes)

Uploaded Source

Built Distribution

monero_api_cli-0.2.0-py3-none-any.whl (12.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page