{"id":19421507,"url":"https://github.com/sitbon/hydra-hypy","last_synced_at":"2026-05-16T02:04:46.832Z","repository":{"id":137573859,"uuid":"540574266","full_name":"sitbon/hydra-hypy","owner":"sitbon","description":"The hypy Python library for Hydra Chain","archived":false,"fork":false,"pushed_at":"2022-09-23T18:57:58.000Z","size":129,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-07T18:31:41.351Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hydraverse.github.io/hypy/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sitbon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"halospaced","patreon":null,"open_collective":null,"ko_fi":"halospace","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://www.paypal.com/donate/?hosted_button_id=MYKWPQCWBVK6J","https://explorer.hydrachain.org/address/HUo97u33iEdkEWBiLZEitAsGRXHUcmdfHQ"]}},"created_at":"2022-09-23T18:43:08.000Z","updated_at":"2022-09-23T18:55:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"c2a4063e-7d10-4353-8205-8fd7d7f1950f","html_url":"https://github.com/sitbon/hydra-hypy","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitbon%2Fhydra-hypy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitbon%2Fhydra-hypy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitbon%2Fhydra-hypy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitbon%2Fhydra-hypy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sitbon","download_url":"https://codeload.github.com/sitbon/hydra-hypy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240599194,"owners_count":19826959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T13:28:32.876Z","updated_at":"2026-05-16T02:04:46.795Z","avatar_url":"https://github.com/sitbon.png","language":"Python","funding_links":["https://github.com/sponsors/halospaced","https://ko-fi.com/halospace","https://www.paypal.com/donate/?hosted_button_id=MYKWPQCWBVK6J","https://explorer.hydrachain.org/address/HUo97u33iEdkEWBiLZEitAsGRXHUcmdfHQ"],"categories":[],"sub_categories":[],"readme":"# Hydra Chain Integration \u0026 Tools Library\n\nThis is a Python support library for the Hydra Chain project (https://hydrachain.org) aimed at simplifying the process of using and developing apps for the blockchain.\n\nPrimarily, `hypy` (pronounced \"hippie\") currently provides:\n- RPC tools to access the Hydra JSON-RPC service.\n- A flexible command line tool with simple integration.\n- Application infrastructure to extend apps \u0026 tools.\n- Integrated apps for common tasks such as monitoring or connecting to new nodes.\n\n# Quick Start\n\nIf you know what this is and just want to get going, install:\n\n`$ pip install halo-hypy`\n\nAnd then run!\n\n`$ hy --help`\n\nFull download/install and usage instructions follow.\n\n# Usage\n\nThis library connects to a Hydra node on a local system or over a network.\n\nThe primary tool to interface with the node is called `hycli`, and for the most part behaves exactly the same as `hydra-cli`,\nwith some nicer output options:\n\n```shell\nhalo@blade:~ ֍ hycli getinfo\ngetinfo                \n  .version             180506\n  .protocolversion     70017\n  .walletversion       169900\n  .balance             28047.31917165\n  .stake               1452.99760027\n  .locked              \n    .used              128\n    .free              65408\n    .total             65536\n    .locked            65536\n    .chunks_used       2\n    .chunks_free       2\n  .blocks              155763\n  .timeoffset          0\n  .connections         8\n  .proxy               \n  .difficulty          \n    .proof-of-work     1.52587890625e-05\n    .proof-of-stake    797825.1819042678\n  .testnet             True\n  .moneysupply         20931869.76468454\n  .burnedcoins         73748.17511400\n  .keypoololdest       1635530802\n  .keypoolsize         2000\n  .unlocked_until      1741407462\n  .relayfee            0.004\n  .errors \n```\n\nThere's also `hytop`, which periodically displays useful node status info in a human-readable format:\n\n```commandline\nhalo@blade:~ ֍ hytop -C\n\nnow                           2022-01-05 16:21:36.930567-08:00\nutcnow                        2022-01-06 00:21:36.930584\nconnectioncount               8\napr                           107.2079665372164\n\nstakinginfo\n  .enabled                    True\n  .staking                    True\n  .difficulty                 797825.1819042678\n  .search-interval            1:51:28\n  .weight                     28047.31917165\n  .netstakeweight             3918664.173517\n  .expectedtime               4:58:03\n\nwalletinfo\n  .walletname                 ''\n  .balance                    28047.31917165\n  .stake                      1452.99760027\n  .txcount                    2769\n  .unlocked_until             2025-03-07 20:17:42\n```\n\nAnd `peerscan`, which attempts to connect to new nodes:\n\n```commandline\nhalo@blade:~ ֍ peerscan -vv\n\nINFO:hypy:server reports 327 connections\nINFO:hypy:loaded 327 peers\nINFO:hypy:loaded 1201 nodes\nINFO:hypy:trying 883 potential new peers\nINFO:hypy:server now reports 329 connections\n```\n\n# Clone \u0026 Install\n\nThis is both a library that you can import into your Python code and a command line tool that you can use and extend.\n\nWhen installing `hypy`, the command line tools become available as well.\n\nTo install the latest from git without cloning the repository,  jump down to the [Remote Installation](#Remote-Installation) section.\n\n### Clone/Download Sources:\n\n```commandline\n֍ git clone https://github.com/hydraverse/hypy\n\nCloning into 'hypy'...\n...\n```\n\n### Environment\n\nThe simplest way to use `hypy` is to install it at the system level, but sometimes it can be hard to manage varying Python\nversion needs and dependencies.\n\nIf installing at the system level, jump down to the [Installation](#Installing) section.\n\nOtherwise, you can choose between `venv`, `Anaconda`, `pipenv` and many others;\nhowever, `venv` is considered to be the supported environment for this library.\n\n#### Virtualenv\n\nIn case you'd like to use/install `hypy` within a virtual environment, run\nthe following within the library's top folder:\n\n```commandline\n֍ mkdir .env\n֍ python3 -m venv .env/hypy\n...\n֍ source .env/hypy/bin/activate\n(hypy) ֍ which python\n/home/halo/.env/hypy/bin/python\n(hypy) ֍ pip install --upgrade pip  # Ensure that pip is the newest version.\n...\n```\n\nRequires the Debian/Ubuntu package `python3-venv`.\n\n#### Anaconda\n\n[Installing Conda on Linux](https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html#install-linux-silent)\nsummary:\n\n```commandline\n\n֍ wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh\n\n֍ chmod +x Anaconda*.sh\n\n֍ ./Anaconda*.sh\n```\n\n##### Create \u0026 Activate Anaconda Environment:\n\n```commandline\n֍ conda create -n hypy python=3.8.10\n\n֍ conda activate hypy\n```\n\n# Installing\n\n### From Source\n\nInstalling from the cloned `hypy` library folder:\n\n`֍ pip install .`\n\n### Remote Installation \u003ca name=\"Remote-Installation\"\u003e\u003c/a\u003e\n\nInstalling directly from GitHub:\n\n`֍ pip install git+https://github.com/hydraverse/hypy`\n\nOr to get a specific branch, tag, or revision:\n\n`֍ pip install git+https://github.com/hydraverse/hypy@v2.3.1`\n\nThis example installs the `v2.3.1` tagged version.\n\n### Uninstall\n\n`֍ pip uninstall hypy`\n\n### Packaging\n\nYou can create a redistributable wheel package for later installation with the following command:\n\n```commandline\n(hypy) ֍ pip install build\n(hypy) ֍ python -m build\n```\n\n# Use: `hy`\n\n`hy` is the *Hydra Chain Tool*, a command-line toolkit meant to run standalone modules, aka `apps`, with convenient access to instantiated library objects.\n\nSome apps are provided by the library, and the `hy` module provides you with a means to\nintegrate your own apps and run them as if they were part of the tool. More on that in the example app below.\n\nRunning an app on the command line looks something like this **(note: '֍' is the command shell prompt)**:\n\n```commandline\n֍ hy [-h] \u003csome-app\u003e [-h] [options] [app params]\n```\n\nUse the `-h` option *before* the app name to see a list of apps, and after to get usage for a particular app.\n\nThe primary apps currently available are `cli` and `test`. These are provided as system-level\ncommands alongside `hy` when you install `hypy`.\n\nThis means that instead of calling `hy cli ...`, for example, you can use `hycli ...` instead.\n\nNote that all program options (except `-h` or `-v`) must appear *after* the app name.\n\n# Run Unit Tests\n\n`hy test - [-k \"\u003ctest_name_pattern\u003e or \u003ctest_name_pattern\u003e ...\"]`\n\nThis command is also available globally (with slight variation, no need for `-` param) after installation as `hytest`.\n\nYou can also specify different parameters for the tests with environment variables, such as `HYPY_LOG`.\nThese variables also work with `hy`.\n\n```commandline\n(hypy) halo@blade:hypy ֍ HY_RPC_WALLET=watch HY_LOG=ERROR hy test -\n=========================== test session starts ============================\nplatform linux -- Python 3.8.10, pytest-6.2.5, py-1.11.0, pluggy-1.0.0\nrootdir: /home/halo/pr/hy/hypy\ncollected 13 items                                                         \n\nhydra/test/app/cli.py::HydraCLIAppTest::test_app_cli_runnable PASSED [  7%]\nhydra/test/rpc.py::HydraRPCTest::test_rpc_stub PASSED                [ 15%]\nhydra/app/txvio.py::TxVIOAppTest::test_0_txvio_runnable PASSED       [ 23%]\nhydra/app/txvio.py::TxVIOAppTest::test_1_txvio_run PASSED            [ 30%]\nhydra/app/ascan.py::AScanAppTest::test_0_ascan_runnable PASSED       [ 38%]\nhydra/app/ascan.py::AScanAppTest::test_1_ascan_run PASSED            [ 46%]\nhydra/app/atrace.py::ATraceAppTest::test_0_atrace_runnable PASSED    [ 53%]\nhydra/app/atrace.py::ATraceAppTest::test_1_atrace_run PASSED         [ 61%]\nhydra/app/lstx.py::TxListAppTest::test_0_lstx_runnable PASSED        [ 69%]\nhydra/app/lstx.py::TxListAppTest::test_1_lstx_run PASSED             [ 76%]\nhydra/app/peerscan.py::PeerScanTest::test_0_peerscan_runnable PASSED [ 84%]\nhydra/app/peerscan.py::PeerScanTest::test_1_peerscan_run PASSED      [ 92%]\nhydra/app/top.py::TopAppTest::test_0_top_runnable PASSED             [100%]\n\n=========================== 13 passed in 37.17s ============================\n```\n\n### Standalone Testing\n\nWhen developing ouside the library, tests can be run for standalone Application implementations.\n\n`hy-test examples/my_hydra_app.py`\n\n\n# Full Usage: `hy`\n\n**NOTE:** Tab-completion is available with `argcomplete` but per-app parameters\nwon't be shown, only the primary `hy` parameters.\n\n*(Instructions for tab completion coming soon)*\n\n### `hy`\n\n```commandline\n֍ hy -h\n\nusage: hy [-h] [-v] [-l LOG] [--rpc RPC] [--rpc-wallet RPC_WALLET]\n          [--rpc-testnet] [-J] [-j] [-f]\n          {cli,test,ascan,atrace,lstx,txvio,peerscan,top} ...\n\nHyPy Library Application Tool.\n\npositional arguments:\n  {cli,test,ascan,atrace,lstx,txvio,peerscan,top}\n                        application to run.\n  ARGS                  application args.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -v, --verbose         verbose level (up to 3x) (env: HYPY_V).\n  -l LOG, --log LOG     log level (name: error,warning,info,debug,notset)\n                        (env: HYPY_LOG).\n  --rpc RPC             rpc url (env: HY_RPC)\n  --rpc-wallet RPC_WALLET\n                        rpc wallet name override (env: HY_RPC_WALLET)\n  --rpc-testnet         rpc testnet override (env: HY_RPC_WALLET)\n  -J, --json-pretty     output parseable json\n  -j, --json            output parseable json\n  -f, --full            output full names (non-json only)\n```\n\n### `cli`\n\n```commandline\n֍ hycli -h\n\nusage: hy cli ... [-f] ...\n\noptional arguments:\n  ...\n\ncli:\n  rpc cli interface\n\n  -f, --full            output full names (non-json only)\n  CALL                  rpc function to call\n  PARAM                 rpc function parameters\n```\n\nOnly the last section in an app's help message (`cli` in the above case) will differ\nbetween apps.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitbon%2Fhydra-hypy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitbon%2Fhydra-hypy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitbon%2Fhydra-hypy/lists"}