Skip to main content

Library to interact with cardano network

Project description

pydano

Python helper scripts to do minting and transactions via cardano_cli.

Sending ADA from one wallet to other wallets

python scripts/pydano_cli.py --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:

python scripts/pydano_cli.py --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.6.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydano-0.0.6.tar.gz
  • Upload date:
  • Size: 9.4 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.6.tar.gz
Algorithm Hash digest
SHA256 d99fc2a6c5785ffced8698621e83dd59ab0ed0fe0da0e4e6d1fcc4ebfc9c2f91
MD5 bb14c67bcfbcc47e675c577d811858ca
BLAKE2b-256 0120d14508f84a249800c3db84d79d93f08c236ed0df2a4bb975d731e11c242a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydano-0.0.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 565a17a22198f67139e4c5c08a7a6d1646d4c3b64449d6e6e4c4698b314ad37b
MD5 781d2629d1c0740b5deb1822554e0a80
BLAKE2b-256 12736e28278d2565aa5a0e52969c4aa5e38bdf59b1ed7be3eaaed8bfafa1487e

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