Skip to main content

Library to interact with cardano network

Project description

pydano

Python library to interact with cardano network. This is essentially a wrapper around cardano_cli.

Installing

Install using pip

pip install pydano==0.0.6

Sending ADA from one wallet to other wallets

pydano-cli --input_address addr_test1vqe6pyeqq66nffkku7ra8xhss97nzltclgnhn20u7xyhzwcu5zzvt --pay execute_transaction.json --signing_key keys/payment2.skey

Transactions to be executed written in a JSON file with the following format:

[
    {
	"address": "addr_test1vqe6pyeqq66nffkku7ra8xhss97nzltclgnhn20u7xyhzwcu5zzvt",
	"quantity": 1379280,
	"token_name": "lovelace"
    },
    {
	"address": "addr_test1vqe6pyeqq66nffkku7ra8xhss97nzltclgnhn20u7xyhzwcu5zzvt",
	"quantity": 1,
	"token_name": "29270c0384408dcf4fae241d756ec7632f9bb9a2abb2627d371bc262.cheekyunttest10"
    }
]

We use the input address as the change_address for ADA and non-ADA assets.

Minting Tokens

Command:

pydano-cli --input_address addr_test1vqe6pyeqq66nffkku7ra8xhss97nzltclgnhn20u7xyhzwcu5zzvt --mint mint_transaction.json --signing_key keys/payment2.skey --minting_script data/policy.script --log_level DEBUG --min_utxo 1758582

Pass the assets to be minted using the --mint option. An example of a file is:

[
    {
	"address": "addr_test1vqe6pyeqq66nffkku7ra8xhss97nzltclgnhn20u7xyhzwcu5zzvt",
	"token_name": "cheekyunttest41"
    },
    {
	"address": "addr_test1vqe6pyeqq66nffkku7ra8xhss97nzltclgnhn20u7xyhzwcu5zzvt",
	"token_name": "cheekyunttest40"
    }

]

Connecting to remote cardano node instead of starting node on your laptop.

  1. Grab the latest cardano binary from Download Link
  2. Extract cardano-cli locally by extracting the downloaded package. tar xzfv cardano-node-1.29.0-linux.tar.gz
  3. Install cardano-* binaries on local path. cp cardano-* $HOME/.local/bin/
  4. [Optional] Start socat on your server, where actual node is running. nohup socat TCP-LISTEN:8080,fork,reuseaddr, UNIX-CONNECT:$CARDANO_NODE_SOCKET_PATH&
  5. Start socat on your local machine, to connect to socket on remote node. socat UNIX-LISTEN:node.socket,fork,reuseaddr,unlink-early, TCP:<IP_ADDR>:8080 [Replace <IP_ADDR> with ip of your remote machine]
  6. Export the path of pwd/node.socket as CARDANO_NODE_SOCKET_PATH

We are using 8080 port for communication between our remote node and local node here. Make sure:

  1. 8080 port is open on remote host.
  2. echo $CARDANO_NODE_SOCKET_PATH points to the correct location of socket

P.S: refer to the ./scripts/run_socat.sh to starting socat locally.

P.S: This is untested code, and loss incurred due to the use of this library is not our responsibility!!!

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

pydano-0.0.8.tar.gz (11.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pydano-0.0.8-py3.8.egg (2.6 kB view details)

Uploaded Egg

pydano-0.0.8-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file pydano-0.0.8.tar.gz.

File metadata

  • Download URL: pydano-0.0.8.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.8

File hashes

Hashes for pydano-0.0.8.tar.gz
Algorithm Hash digest
SHA256 f77625f2c2eb01bed28d5e18247542aaf9ffce69c4893c75780a0c354443942a
MD5 00ec4b0864fa2db3e0d33116322fdb61
BLAKE2b-256 963dc766e8a270a3ca9c7d81c5f41d8ac81eaf4a8e7c7b68051f7f70a5cc26c0

See more details on using hashes here.

File details

Details for the file pydano-0.0.8-py3.8.egg.

File metadata

  • Download URL: pydano-0.0.8-py3.8.egg
  • Upload date:
  • Size: 2.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.8

File hashes

Hashes for pydano-0.0.8-py3.8.egg
Algorithm Hash digest
SHA256 9f103dc9effc54740da4482f97ea384d5574faa95a7162273733df1ead738c52
MD5 d87523b88671aebbb5e904ed0b3b1306
BLAKE2b-256 4b4b9efe67405afd18640fcd4b6abdfc0c5f706142942c71b97469f0139a2642

See more details on using hashes here.

File details

Details for the file pydano-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: pydano-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.8

File hashes

Hashes for pydano-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8872f231ddc704929120adb2e3f7c230c9e8ee6bcac39f1a822b9f19a6bbe7c6
MD5 855a519127ddd5a12c45d50af424cbb1
BLAKE2b-256 48320977ff22d26cf808dd4becbeb272e5706e37614ce4fbfbba630d939f7f4d

See more details on using hashes here.

Supported by

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