7

I followed the documentation for building a Relay and Block node. Part of that involved sending some ADA to the block producing node's address, to be used as a stake pool deposit.

However, the documentation showed the deposit as 2,000,000 lovelace. In fact it's 500,000,000 according to mainnet-shelley-genesis.json, and that's too rich for me to play with tutorials. So I'd like to return the ADA from the Block node to my wallet.

I found this document showing how to make a payment. I calculated the amount to be the total holding balance of the Block address, less the fee.

The transaction failed. Here's the error:

Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [LedgerFailure (UtxowFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Mainnet (KeyHashObj (KeyHash "f1a1639d8012278565242d449223c7d40e6e87c81021b99f3bac4749")) (StakeRefBase (KeyHashObj (KeyHash "a9f00a2910b88d5aacd9ef1c8ef4d06ebf7faf1618876a60ed088cc1"))),Value 1 (fromList []))])))])

I don't understand the error, and I'm wondering if the documentation is outdated (given the stake deposit was wrong).

Is there a more current document showing how to submit a payment, using cardano-cli and keys?

2 Answers 2

1

If you like using Python, try the Cardano-Tools library that I put together. Its basically a smart wrapper around the CLI that takes care of extra steps for you such as selecting the UTxO(s). You need the cardano-cli installed and a synced cardano-node running. Below is some example code.

from cardano_tools import ShelleyTools

# Test Inputs (example paths)
path_to_cli = "/home/user/.cabal/bin/cardano-cli"
path_to_socket = "/home/user/relay-node/db/node.socket"
working_dir = "/home/user/.cardano-tools/"

# Create a ShelleyTools object
shelley = ShelleyTools(
    path_to_cli, 
    path_to_socket, 
    working_dir, 
    network="--mainnet"  # Can also use testnet magic here
 )

 amt = 10 # Ada to send
 to_addr = "addr1..." # Address to send the ADA to
 from_addr = "addr1..." # Address to send the ADA from
 key_file = "/path/to/addr.skey" # path to the signing key file

 shelley.send_payment(amt, to_addr, from_addr, key_file)

Note that you need the signing key file that belongs to the specific address that you are sending the ADA from.

3
  • Thank you, I have not used Python for a while, but I will certainly give it a go.
    – Matt
    Commented May 6, 2021 at 2:28
  • 1
    Hello @nalyd88, that worked just fine after a bit playing about. Thank you.
    – Matt
    Commented May 9, 2021 at 2:52
  • 1
    Happy to help! Please feel free to leave feedback on our library or make pull requests.
    – nalyd88
    Commented May 11, 2021 at 2:05
3

If possible, always use the official documentation to protect yourself from scams. For sending a simple transaction using the cardano-cli, have a look at docs.cardano.org.

As for the error, when inspecting it, you will find it says OutputTooSmallUTxO. This is because of the minUTxOValue protocol parameters which is used to prevent dusting up the UTXO set. It is now set to 10000000 lovelaces, that means you cannot send an output smaller than this amount, which is probably something you are trying to do.

1
  • 1
    It's also worth practicing with cardano-cli on the testnet rather than using real ADA. Configuration files and instructions are found at docs.cardano.org
    – Ben NOBLE
    Commented May 4, 2021 at 0:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.