cardano-clusterlib


Namecardano-clusterlib JSON
Version 0.1.10 PyPI version JSON
download
home_pagehttps://github.com/input-output-hk/cardano-clusterlib-py
SummaryPython wrapper for cardano-cli for working with cardano cluster
upload_time2021-04-12 17:01:35
maintainerMartin Kourim
docs_urlNone
author
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Documentation Status](https://readthedocs.org/projects/cardano-clusterlib-py/badge/?version=latest)](https://cardano-clusterlib-py.readthedocs.io/en/latest/?badge=latest)
[![PyPi Version](https://img.shields.io/pypi/v/cardano-clusterlib.svg)](https://pypi.org/project/cardano-clusterlib/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

README for cardano-clusterlib
=============================

Python wrapper for cardano-cli for working with cardano cluster.

Installation
------------

```sh
# create and activate virtual env
$ python3 -m venv .env
$ . .env/bin/activate
# install it from PyPI
$ pip install cardano-clusterlib
# - OR - install it in develop mode together with dev requirements
$ make install
```

Usage
-----

Needs working `cardano-cli` (the command is available on `PATH`, `cardano-node` is running, `CARDANO_NODE_SOCKET_PATH` is set). In `state_dir` it expects "shelley/genesis.json".

```python
from cardano_clusterlib import clusterlib

# instantiate `ClusterLib`
cluster = clusterlib.ClusterLib(state_dir="path/to/cluster/state_dir")

# specify where to send funds and amounts to send
destinations = [clusterlib.TxOut(address=dst_address, amount=amount_lovelace)]

# provide keys needed for signing the transaction
tx_files = clusterlib.TxFiles(signing_key_files=[src_skey_file])

# build, sign and submit the transaction
tx_raw_output = cluster.send_funds(
    src_address=src_address,
    destinations=destinations,
    tx_name="send_funds",
    tx_files=tx_files,
)

# wait for two new blocks to make sure the transaction is on the ledger
cluster.wait_for_new_block(new_blocks=2)

# check that the funds were received
cluster.get_utxo(dst_address)
```

See [cardano-node-tests](https://github.com/input-output-hk/cardano-node-tests) for more examples, e.g. [minting new tokens](https://github.com/input-output-hk/cardano-node-tests/blob/6da4cf210bc1da9f1304e67e226063772fff631d/cardano_node_tests/utils/clusterlib_utils.py#L495-L543).


Source Documentation
--------------------

<https://cardano-clusterlib-py.readthedocs.io/en/latest/cardano_clusterlib.html>


Contributing
------------

Install this package and its dependencies as described above.

Run `pre-commit install` to set up the git hook scripts that will check you changes before every commit. Alternatively run `make lint` manually before pushing your changes.

Follow the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html), with the exception that formatting is handled automatically by [Black](https://github.com/psf/black) (through `pre-commit` command).



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/input-output-hk/cardano-clusterlib-py",
    "name": "cardano-clusterlib",
    "maintainer": "Martin Kourim",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "martin.kourim@iohk.io",
    "keywords": "",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/bd/06/353dd1c51826be2810d9cac65ba10ffca03e788583a33047d8c85d75de2b/cardano-clusterlib-0.1.10.tar.gz",
    "platform": "",
    "description": "[![Documentation Status](https://readthedocs.org/projects/cardano-clusterlib-py/badge/?version=latest)](https://cardano-clusterlib-py.readthedocs.io/en/latest/?badge=latest)\n[![PyPi Version](https://img.shields.io/pypi/v/cardano-clusterlib.svg)](https://pypi.org/project/cardano-clusterlib/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nREADME for cardano-clusterlib\n=============================\n\nPython wrapper for cardano-cli for working with cardano cluster.\n\nInstallation\n------------\n\n```sh\n# create and activate virtual env\n$ python3 -m venv .env\n$ . .env/bin/activate\n# install it from PyPI\n$ pip install cardano-clusterlib\n# - OR - install it in develop mode together with dev requirements\n$ make install\n```\n\nUsage\n-----\n\nNeeds working `cardano-cli` (the command is available on `PATH`, `cardano-node` is running, `CARDANO_NODE_SOCKET_PATH` is set). In `state_dir` it expects \"shelley/genesis.json\".\n\n```python\nfrom cardano_clusterlib import clusterlib\n\n# instantiate `ClusterLib`\ncluster = clusterlib.ClusterLib(state_dir=\"path/to/cluster/state_dir\")\n\n# specify where to send funds and amounts to send\ndestinations = [clusterlib.TxOut(address=dst_address, amount=amount_lovelace)]\n\n# provide keys needed for signing the transaction\ntx_files = clusterlib.TxFiles(signing_key_files=[src_skey_file])\n\n# build, sign and submit the transaction\ntx_raw_output = cluster.send_funds(\n    src_address=src_address,\n    destinations=destinations,\n    tx_name=\"send_funds\",\n    tx_files=tx_files,\n)\n\n# wait for two new blocks to make sure the transaction is on the ledger\ncluster.wait_for_new_block(new_blocks=2)\n\n# check that the funds were received\ncluster.get_utxo(dst_address)\n```\n\nSee [cardano-node-tests](https://github.com/input-output-hk/cardano-node-tests) for more examples, e.g. [minting new tokens](https://github.com/input-output-hk/cardano-node-tests/blob/6da4cf210bc1da9f1304e67e226063772fff631d/cardano_node_tests/utils/clusterlib_utils.py#L495-L543).\n\n\nSource Documentation\n--------------------\n\n<https://cardano-clusterlib-py.readthedocs.io/en/latest/cardano_clusterlib.html>\n\n\nContributing\n------------\n\nInstall this package and its dependencies as described above.\n\nRun `pre-commit install` to set up the git hook scripts that will check you changes before every commit. Alternatively run `make lint` manually before pushing your changes.\n\nFollow the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html), with the exception that formatting is handled automatically by [Black](https://github.com/psf/black) (through `pre-commit` command).\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Python wrapper for cardano-cli for working with cardano cluster",
    "version": "0.1.10",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "33daf6211d74e3533f35e829863c9f33",
                "sha256": "9e85ac41f3119b569d1c0fa1d41d00348298608440fbb821c1fc815182b2c367"
            },
            "downloads": -1,
            "filename": "cardano_clusterlib-0.1.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33daf6211d74e3533f35e829863c9f33",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 19550,
            "upload_time": "2021-04-12T17:01:34",
            "upload_time_iso_8601": "2021-04-12T17:01:34.033577Z",
            "url": "https://files.pythonhosted.org/packages/e1/d7/ef97fa789f3c8ce746e7773c0b3b58f543526560af79c5c468bd545ae2c0/cardano_clusterlib-0.1.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "d0fa8b36b6c2033eb278d5c85d563c48",
                "sha256": "1a93a845b356915934fbb6ac2043047ea862dfed2b8c9aca1558c8e79173fbbd"
            },
            "downloads": -1,
            "filename": "cardano-clusterlib-0.1.10.tar.gz",
            "has_sig": false,
            "md5_digest": "d0fa8b36b6c2033eb278d5c85d563c48",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 26595,
            "upload_time": "2021-04-12T17:01:35",
            "upload_time_iso_8601": "2021-04-12T17:01:35.315841Z",
            "url": "https://files.pythonhosted.org/packages/bd/06/353dd1c51826be2810d9cac65ba10ffca03e788583a33047d8c85d75de2b/cardano-clusterlib-0.1.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-04-12 17:01:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "input-output-hk",
    "error": "Could not fetch GitHub repository",
    "lcname": "cardano-clusterlib"
}
        
Elapsed time: 0.34076s