Skip to content

Commit d0e1805

Browse files
authored
Merge pull request #168 from input-output-hk/update_readme
Update README
2 parents 9adf6b6 + e7a5c3c commit d0e1805

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

README.md

+27-5
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,45 @@
44
[![PyPi Version](https://img.shields.io/pypi/v/cardano-clusterlib.svg)](https://pypi.org/project/cardano-clusterlib/)
55
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
66

7-
Python wrapper for cardano-cli for working with cardano cluster.
7+
Python wrapper for cardano-cli for working with cardano cluster. It supports all cardano-cli commands (except parts of `genesis` and `governance`).
8+
9+
The library is used for development of [cardano-node system tests](https://github.com/input-output-hk/cardano-node-tests).
810

911
## Installation
1012

1113
```sh
1214
# create and activate virtual env
1315
$ python3 -m venv .env
1416
$ . .env/bin/activate
15-
# install it from PyPI
17+
# install cardano-clusterlib from PyPI
1618
$ pip install cardano-clusterlib
17-
# - OR - install it in develop mode together with dev requirements
19+
# - OR - install cardano-clusterlib in development mode together with dev requirements
1820
$ make install
1921
```
2022

2123
## Usage
2224

23-
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".
25+
The library 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".
26+
27+
```python
28+
# instantiate `ClusterLib`
29+
cluster = clusterlib.ClusterLib(state_dir="path/to/cluster/state_dir")
30+
```
31+
32+
On custom testnets that were started in Byron era, you might need to specify a slots offset between Byron epochs and Shelley epochs.
33+
The "slots_offset" is a difference between number of slots in Byron epochs and in the same number of Shelley epochs.
34+
35+
E.g. for a testnet with parameters
36+
37+
* 100 slots per epoch in Byron era
38+
* 1000 slots per epoch in Shelley era
39+
* two epochs in Byron era before forking to Shelley
40+
41+
The offset will be `2 * (1000 - 100) = 1800`.
42+
43+
```python
44+
cluster = clusterlib.ClusterLib(state_dir="path/to/cluster/state_dir", slots_offset=1800)
45+
```
2446

2547
### Transfer funds
2648

@@ -151,7 +173,7 @@ cluster.g_transaction.submit_tx(tx_file=tx_signed_redeem, txins=tx_output_fund.t
151173

152174
### More examples
153175

154-
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/90aa4a2e9fe4019a89e6f4cdec7cb092732e6f2a/cardano_node_tests/utils/clusterlib_utils.py#L567-L602) or [minting new tokens with Plutus](https://github.com/input-output-hk/cardano-node-tests/blob/d688a9bcf00a30f9881c52aab9311dd1a0cb3077/cardano_node_tests/tests/test_plutus_mint_build.py#L173-L217)
176+
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/4b50e8069f5294aaba14140ef0509e2857bec35d/cardano_node_tests/utils/clusterlib_utils.py#L491) or [minting new tokens with Plutus](https://github.com/input-output-hk/cardano-node-tests/blob/4b50e8069f5294aaba14140ef0509e2857bec35d/cardano_node_tests/tests/tests_plutus/test_mint_build.py#L151-L195)
155177

156178

157179
## Source Documentation

0 commit comments

Comments
 (0)