Giter Site home page Giter Site logo

gitmachtl / scripts Goto Github PK

View Code? Open in Web Editor NEW
269.0 33.0 94.0 72.36 MB

StakePool Operator Scripts. Learn how to create and manage your StakePool with these simple scripts. Hardware-Ledger/Trezor Support, Token/Asset Sending, Offline-Mode and more...

License: MIT License

Shell 100.00%
cardano-node cardano cardano-cli haskell cardano-hw-cli stakepool multiwitness stakepool-operator mainnet testnet

scripts's Introduction

StakePool Operator Scripts (SPOS)

Useful scripts from ATADA_StakePool_Austria for any StakePool Operator out there ...
ย 

About

Theses scripts here should help you to manage your StakePool via the CLI. You can work in online- and/or offline-mode, you can use and migrate to Hardware-Wallets, you can send transactions with messages, you can do the Catalyst registration, you can mint/burn Tokens, you can generate the files for the Token-Registry and much much more. ๐Ÿ˜ƒ

Scripts were made to make things easier while learning all the commands and steps to bring up the stakepool node.

Please use the latest files in the cardano/mainnet subdirectory, informations about how to do a simple install/copy of them and how to use them on your machine can be found in the README.md.

If you wanna test things out on the testnets, also with the latest alpha/beta scripts, please use the latest files in the cardano/testnet subdirectory, informations about how to do a simple install/copy of them and hot to use them on your machine can be found in the README.md.

Contacts

scripts's People

Contributors

danielsanchezq avatar dkijania avatar dmitrystas avatar gitmachtl avatar kukkok3 avatar leo42 avatar lunarpool avatar nemo83 avatar stakepool247 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scripts's Issues

Script compatibility with latest major upgrade Cardano node 8.7.2 and future 9.0 ?

Hello Martin,

I'm willing to upgrade my stake pool cardano node from current 8.1.1 to the latest major upgrade 8.7.2. I'm using your scripts to manage our stake pool (tahnk you for that by the way, what would we do without you ?). My question is if there is any impact of this cardano major upgrade to take into account with your scripts or not ?

Thank you
Hugues

Error Reported in 00_Common.sh

I used script 03a_genStakingPaymentAddr.sh

output gives error encountered in 00_common.sh

Here is error output:

date: invalid date โ€˜nullโ€™
/opt/cardano/cnode/scripts/00_common.sh: line 89: (1591368418-) / 21600 : syntax error: operand expected (error token is ") / 21600 ")
Mimimum Registration Transfer Fee: 171221 lovelaces
Key Deposit Fee: 400000 lovelaces

Checking ledger state doesn't work on 1.14.1

  1. I cannot check my staking address
  2. I cannot check if my pool is registered

e.g.

05d_checkPoolOnChain.sh
I went and looked a bit:

[mati@cardano ~]$ cardano-cli shelley query ledger-state --testnet-magic 42 | grep "poolPubKey"
[mati@cardano ~]$

this simply always produces empty results, which means there is no poolPubKey anymore

I would assume similar problem is with checking if staking address is registered:
03c_checkStakingAddrOnChain.sh

[mati@cardano ~]$ cardano-cli shelley query ledger-state --testnet-magic 42 | jq ._delegationState._dstate._stkCreds

parse error: Invalid numeric literal at line 1, column 7

Git clone installation instructions

When I run the git fetch origin && git reset --hard orgin/master command, I get an error, "fatal not a git respository (or any of the parent directories): .git

I followed the steps in order.

mktemp param order raise error on macosx

In macosx the parameter -ut are valid but must be entered before the argument, or won't be correctly interpreted and will create another folder

mktemp tmp.XXXX -ut
tmp.oNvB
mktemp: mkstemp failed on -ut: File exists

Trying to Mint Asset with Custom MetaData - Error Building Raw TX Data

I am trying to implement CIP 27 in one of my NFTs that I am trying to Mint using 11a. When passing it the metadata of "pct": 0.05 it looks like its converting it to a e value. rather than just 0.05

This is the error that I got. I was trying to follow CIP 27 for
Command failed: transaction build-raw Error: Error reading metadata at: "metadata.json"
JSON schema error within the metadata item 777: {"abc123abc":{"0008":{"pct":5.0e-2
JSON numbers must be integers. Unexpected value: 5.0e-2

cardano-foundation/CIPs#116

Passed Metadata

{
"721": {
"XXXX": {
"0008": {
"name": "XXX",
"Description": "XX",
"Collection": "X",
"Generation": 1,
"URL": "XXXX",
"image": "XXXXX",
"mediaType": "image/png",
"files": [
{
"mediaType": "image/png",
"src": "XXXXXX"
}
]
}
}
},
"777":{
"XXX":{
"0008":{
"pct": 0.05,
"addr": "XXXXXX"
}
}
}
}

Error - destiantion address can't be resolved. Script 01_queryAddress.sh

Hello,
I get the error : "destination address can't be resolved. Maybe filename wrong, or not a payment-address." running the command :

"01_queryAddress.sh smallwallet1" on the airgap machine, on which the offlineTransfer.json has been copied from the online machine.

This offlineTransfer.json file has been created on the online machine with the following command : " 01_workOffline.sh add smallwallet1"

smallwallet1 was created succesfully and provisionned succesfully on the online machine with 605 ADA. The 01_queryAddress smallwallet1 works correctly on the online machine.

When I look into the offlineTransfer.json, I find lines mentionning "name : smallwallet1" and also its address.

So it seems that the 01_queryAddress.sh script does not find smallwallet1 for reason.

What did we do wrong or is it a bug ?

01_workOffline.sh, 05c_regStakepoolCert.sh: Metadata hash check incorrect for metadata json files without final LF

If the last line in the metadata JSON file uploaded to the pool metadata server is not terminated with a LF there is an issue in the scripts 01_workOffline.sh and 05c_regStakepoolCert.sh.
In this edge case the hash calculation check succeeds when executing a re-registration of the stake pool certificate even though the uploaded file and the local metadata json file differ by the LF. The scripts inadvertently add a LF to the returned metadata json file from the pool meta URL causing an incorrect hash to be calculated.
(This is not an issue if the metadata json files were originally created by 05a_genStakepoolCert.sh and the json file was uploaded correctly. The problem is that the script does not pick up that the uploaded file is incorrect.)
Possible fix in 01_workOffline.sh (1.24.2)
replace line 595: tmpCheckJSON=$(echo -n "${tmpMetadataJSON}" | jq . 2> /dev/null)
replace line 598: onlineMetaHash=$(${cardanocli} ${subCommand} stake-pool metadata-hash --pool-metadata-file <(echo -n "${tmpMetadataJSON}") )
replace line 605: echo -n "${tmpMetadataJSON}"

Similarly for 05c_regStakepoolCert.sh

ERROR (Code 1) ! when sending tokens

Not possible to send tokens with the command 01_sendAssets.sh

Example command: sudo ./01_sendAssets.sh addr1 addr2 afc910d7a306d20c12903979d4935ae4307241d03245743548e76783.ASHIB ALL

I get as error message:
...
3 Asset-Type(s) / 3 different PolicyIDs found on the Address!

Assets to send (given input reference, * means selected via bulk sending): Amount: Bech-Format:
(standard_in) 2: syntax error
(standard_in) 5: syntax error
./01_sendAssets.sh: line 511: [[: 1
-4999999999
1: syntax error in expression (error token is "1")
afc910d7a306d20c12903979d4935ae4307241d03245743548e76783.ASHIB 5000000000
1
1

Assets remaining after transaction - PolicyID: Asset-Name: Amount: Bech-Format: Ticker: Meta-Name:
afc910d7a306d20c12903979d4935ae4307241d03245743548e76783.ASHIB 5000000000 ASHIB ADA Shiba Inu
ba3afde69bb939ae4439c36d220e6b2686c6d3091bbc763ac0a1679c6269745f626f7420307830303035 1
f0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a.mini1pool -4999999999

option --tx-out:
unexpected "\n"
expecting hexadecimal digit
expecting a 56 hex-encoded policy ID, but found only 1 hex digits

Usage: cardano-cli transaction build-raw
[ --byron-era
| --shelley-era
| --allegra-era
| --mary-era
| --alonzo-era
]
[--script-valid | --script-invalid]
(--tx-in TX-IN
[--tx-in-script-file FILE
[
( --tx-in-datum-cbor-file CBOR FILE
| --tx-in-datum-file JSON FILE
| --tx-in-datum-value JSON VALUE
)
( --tx-in-redeemer-cbor-file CBOR FILE
| --tx-in-redeemer-file JSON FILE
| --tx-in-redeemer-value JSON VALUE
)
--tx-in-execution-units (INT, INT)]])
[--tx-in-collateral TX-IN]
[--required-signer FILE | --required-signer-hash HASH]
[--tx-out ADDRESS VALUE
[ --tx-out-datum-hash HASH
| --tx-out-datum-hash-cbor-file CBOR FILE
| --tx-out-datum-hash-file JSON FILE
| --tx-out-datum-hash-value JSON VALUE
| --tx-out-datum-embed-cbor-file CBOR FILE
| --tx-out-datum-embed-file JSON FILE
| --tx-out-datum-embed-value JSON VALUE
]]
[--mint VALUE
(--mint-script-file FILE
[
( --mint-redeemer-cbor-file CBOR FILE
| --mint-redeemer-file JSON FILE
| --mint-redeemer-value JSON VALUE
)
--mint-execution-units (INT, INT)])]
[--invalid-before SLOT]
[--invalid-hereafter SLOT]
[--fee LOVELACE]
[--certificate-file CERTIFICATEFILE
[--certificate-script-file FILE
[
( --certificate-redeemer-cbor-file CBOR FILE
| --certificate-redeemer-file JSON FILE
| --certificate-redeemer-value JSON VALUE
)
--certificate-execution-units (INT, INT)]]]
[--withdrawal WITHDRAWAL
[--withdrawal-script-file FILE
[
( --withdrawal-redeemer-cbor-file CBOR FILE
| --withdrawal-redeemer-file JSON FILE
| --withdrawal-redeemer-value JSON VALUE
)
--withdrawal-execution-units (INT, INT)]]]
[--json-metadata-no-schema | --json-metadata-detailed-schema]
[--auxiliary-script-file FILE]
[--metadata-json-file FILE | --metadata-cbor-file FILE]
[--genesis FILE | --protocol-params-file FILE]
[--update-proposal-file FILE]
[--cddl-format | --cli-format]
--out-file FILE

Build a transaction (low-level, inconvenient)

Please note the order of some cmd options is crucial. If used incorrectly may produce undesired tx body. See nested [] notation above for details.

ERROR (Code 1) !

Error in extracting more than one file in 01_workOffline.sh

When extracting more than one attached file from offlineTransfer.json, the second and subsequent files are not extracted.
The script 01_workOffline.sh changes the offlineJson variable within the for loop.

Possible correction
at line 709 Insert:
offlineJSONExtract=${offlineJSON}

at lines 729-731 replace with:
offlineJSONExtract=$( jq ".history += [ { date: "$(date -R)", action: "extracted file '${filePath}'" } ]" <<< ${offlineJSONExtract})
offlineJSONExtract=$( jq "del (.files."${filePath}")" <<< ${offlineJSONExtract})
echo "${offlineJSONExtract}" > ${offlineFile}

at line 740 replace with:
filesCnt=$(jq -r ".files | length" <<< ${offlineJSONExtract});

Security documentation.

Security Documentation:

Maybe it is totally obvious to the owner but a more beginner user may find it hard to know which keys are to be protected and ideally not stored on the server and if they are stored on the server then protected with chmod 600 (root only):

The whole shebang of keys and files generated:

-r--------  1 mati wheel  1517 Jun 25 23:31 mypool.kes-000.skey
-r--------  1 mati wheel   142 Jun 25 23:31 mypool.kes-000.vkey
-r--------  1 mati wheel     4 Jun 25 23:31 mypool.kes.counter
-r--------  1 mati wheel   141 Jun 26 00:02 mypool.kes-expire.json
-r--------  1 mati wheel   150 Jun 26 00:02 mypool.metadata.json
-r--------  1 mati wheel   339 Jun 26 00:02 mypool.node-000.opcert
-r--------  1 mati wheel   103 Jun 26 00:02 mypool.node.counter
-r--------  1 mati wheel   151 Jun 25 23:31 mypool.node.skey
-r--------  1 mati wheel   161 Jun 25 23:31 mypool.node.vkey
-r--------  1 mati wheel   620 Jun 26 00:02 mypool.pool.cert
-r--------  1 mati wheel   907 Jun 26 00:03 mypool.pool.json
-r--------  1 mati wheel   195 Jun 25 23:31 mypool.vrf.skey
-r--------  1 mati wheel   133 Jun 25 23:31 mypool.vrf.vkey
-r--------  1 mati wheel    59 Jun 25 23:12 mywallet.addr
-r--------  1 mati wheel   130 Jun 25 23:12 mywallet.skey
-r--------  1 mati wheel   142 Jun 25 23:12 mywallet.vkey
-r--------  1 mati wheel   203 Jun 26 00:02 owner.deleg.cert
-r--------  1 mati wheel   115 Jun 25 23:30 owner.payment.addr
-r--------  1 mati wheel   130 Jun 25 23:30 owner.payment.skey
-r--------  1 mati wheel   142 Jun 25 23:30 owner.payment.vkey
-r--------  1 mati wheel    63 Jun 25 23:30 owner.staking.addr
-r--------  1 mati wheel   141 Jun 25 23:30 owner.staking.cert
-r--------  1 mati wheel   130 Jun 25 23:30 owner.staking.skey
-r--------  1 mati wheel   142 Jun 25 23:30 owner.staking.vkey
-rw-r--r--  1 mati wheel   486 Jun 26 00:03 protocol-parameters.json

In other words, which keys are absolutely necessary for stake pool operation until KES expires.

The idea here is that if an attacker gets access to the machine (including root), will she be able to steal rewards, will she be able to steal the pledge... how to prevent this.

Filename of resolved handle address displayed instead of handle in 01_sendlovelaces.sh

./scripts/01_sendLovelaces.sh wallet/smallwallet4 '$arcter' ALL

     Version-Info: cli 1.35.3 / node 1.35.3          Scripts-Mode: online            Mainnet
					
  Found $adahandle '$arcter' on Address: addr1qys8....... 7zl
  Sending lovelaces from Address wallet/smallwallet4.addr to Address /tmp/adahandle-resolve.addr:

also at

     Lovelaces to send to /tmp/adahandle-resolve.addr:  9.828779 ADA / 9828779 lovelaces

user error or code error?

[mati@cardano ~]$ 05c_regStakepoolCert.sh mypool owner.payment

(Re)Register StakePool Certificate mypool.pool.cert with funds from Address owner.payment.addr:

   Owner Stake Keys: 1 owner(s) with the key(s)
                     owner.staking.vkey & owner.deleg.cert
      Rewards Stake: owner.staking.vkey
             Pledge: 95000000000 lovelaces
               Cost: 0 lovelaces
             Margin: 0.04

      Current EPOCH: 12
Current Slot-Height: 263040 (setting TTL to 273040)

Pay fees from Address owner.payment.addr: 008e065cd87a470f5377a64a695ec381e28bf2b10296139b7c57407d26cbd7981718cbeb744fb43dd4a0338cb5df091306e013d5a6a227f62c

1 UTXOs found on the payment Addr!

HASH: 29c35e190f99aec2442a9e53d8e314b4483db5881051a511139df258cf31336a	 INDEX: 0	 LOVELACES: 99498509622
Total lovelaces in UTX0:  99498509622 lovelaces

Minimum transfer Fee for 1x TxIn & 1x TxOut & 2x Certificate:  188073 lovelaces
Pool Deposit Fee:  500000000 lovelaces

Minimum funds required for registration (Sum of fees):  500188073 lovelaces

Lovelaces that will be returned to payment Address (UTXO-Sum minus fees):  98998321549 lovelaces


Building the unsigned transaction body with  mypool.pool.cert and all PoolOwner Delegation certificates:  /tmp/mypool.txbody

type: TxUnsignedShelley
title: Free form text
cbor-hex:
 18b3a5008182582029c35e190f99aec2442a9e53d8e314b4483db5881051a511139df258cf31336a
 000181825839008e065cd87a470f5377a64a695ec381e28bf2b10296139b7c57407d26cbd7981718
 cbeb744fb43dd4a0338cb5df091306e013d5a6a227f62c1b000000170cc2818d021a0002dea9031a

Sign the unsigned transaction body with the owner.payment.skey, mypool.node.skey and all PoolOwner Staking Keys:  /tmp/mypool.tx

type: TxSignedShelley
title: Free form text
cbor-hex:
 18b183a5008182582029c35e190f99aec2442a9e53d8e314b4483db5881051a511139df258cf3133
 6a000181825839008e065cd87a470f5377a64a695ec381e28bf2b10296139b7c57407d26cbd79817
 18cbeb744fb43dd4a0338cb5df091306e013d5a6a227f62c1b000000170cc2818d021a0002dea903

Stakepool Info JSON: mypool.pool.json
{
  "poolName": "mypool",
  "poolOwner": [
    {
      "ownerName": "owner"
    }
  ],
  "poolRewards": "owner",
  "poolPledge": "95000000000",
  "poolCost": "0",
  "poolMargin": "0.04",
  "poolRelaySingleIPv4": "",
  "poolRelaySingleDNS": "kokosz.nerdpol.ovh",
  "poolRelayPort": "3001",
  "poolMetaName": "FreeDOM",
  "poolMetaDescription": "FreeDOM - financial freedom with Cardano",
  "poolMetaTicker": "FRD",
  "poolMetaHomepage": "https://kokosz.nerdpol.ovh",
  "poolMetaUrl": "https://pastebin.com/raw/7E7Xc12A",
  "poolMetaHash": "469497303285568fba523f1ba1d3aaf78ba74b5c67495d43560046293990f59a",
  "regCertCreated": "Fri 26 Jun 2020 10:02:33 PM CEST",
  "regCertFile": "mypool.pool.cert",
  "poolID": "7aaeaff44f679606fdae5de8af690637388702a3d0974686071c235e"
}

Pool-ID: 7aaeaff44f679606fdae5de8af690637388702a3d0974686071c235e

ATTENTION - You're registered Pledge will be set to 95000000000 lovelaces, please respected it with the sum of all registered owner addresses!

Does this look good for you? Do you have enough pledge in your owner.payment account, continue and register on chain ? [y/N] Y

Submitting the transaction via the node...Error while submitting tx: Failed to submit Shelley transaction: ApplyTxError [LedgerFailure (UtxowFailure (UtxoFailure (ValueNotConservedUTxO (Coin 99498509622) (Coin 98998509622))))]
DONE


Stakepool Info JSON: mypool.pool.json
{
  "poolName": "mypool",
  "poolOwner": [
    {
      "ownerName": "owner"
    }
  ],
  "poolRewards": "owner",
  "poolPledge": "95000000000",
  "poolCost": "0",
  "poolMargin": "0.04",
  "poolRelaySingleIPv4": "",
  "poolRelaySingleDNS": "kokosz.nerdpol.ovh",
  "poolRelayPort": "3001",
  "poolMetaName": "FreeDOM",
  "poolMetaDescription": "FreeDOM - financial freedom with Cardano",
  "poolMetaTicker": "FRD",
  "poolMetaHomepage": "https://kokosz.nerdpol.ovh",
  "poolMetaUrl": "https://pastebin.com/raw/7E7Xc12A",
  "poolMetaHash": "469497303285568fba523f1ba1d3aaf78ba74b5c67495d43560046293990f59a",
  "regCertCreated": "Fri 26 Jun 2020 10:02:33 PM CEST",
  "regCertFile": "mypool.pool.cert",
  "poolID": "7aaeaff44f679606fdae5de8af690637388702a3d0974686071c235e"
}

not finding file - new issue

I ran into a snag when running the scripts for the hardware wallet. As you can see below, the error is telling me to run the 05b script but I already did - that is the first command below... As you can see, 05b did not create owner.deleg.cert, it looks like it created ledgerowner.deleg.cert instead... What do you think?

ledgerowner.deleg.cert ledgerowner.staking.vkey owner.staking.vkey savvy.pool.id-bech
ledgerowner.payment.addr owner.payment.addr savvy.metadata.json savvy.pool.json
ledgerowner.payment.hwsfile owner.payment.skey savvy.node.counter savvy.vrf.skey
ledgerowner.payment.vkey owner.payment.vkey savvy.node.skey savvy.vrf.vkey
ledgerowner.staking.addr owner.staking.addr savvy.node.vkey smallwallet1.addr
ledgerowner.staking.cert owner.staking.cert savvy.pool.cert smallwallet1.skey
ledgerowner.staking.hwsfile owner.staking.skey savvy.pool.id smallwallet1.vkey
anthony@anthony-XPS-2720:~/cardanoSavvy/savvy$ 05b_genDelegationCert.sh savvy ledgerowner

Version-Info: cli 1.25.1 / node 1.25.1 Scripts-Mode: online

Create a delegation registration certificate for Delegator ledgerowner.staking.vkey to the PoolNode savvy.node.vkey:

Delegation registration certificate: ledgerowner.deleg.cert
{
"type": "CertificateShelley",
"description": "Stake Address Delegation Certificate",
"cborHex": "83028200581c0ab6b98c1bcd001f2a8ea298c899d217272f04e769c76d5562430ed1581ca7ce13b0e41364cfc59bfe81d499ee412b6d2cb13cbef01155743e87"
}

Created a delegation certificate which delegates funds from all stake addresses
associated with key ledgerowner.staking.vkey to the pool associated with savvy.node.vkey

anthony@anthony-XPS-2720:~/cardanoSavvy/savvy$ 05c_regStakepoolCert.sh savvy smallwallet1 REREG

Version-Info: cli 1.25.1 / node 1.25.1 Scripts-Mode: online

ERROR - "owner.deleg.cert" does not exist! Please create it first with script 05b.

Error: Failed to decode neither the cli's serialisation format nor the ledger's CDDL serialisation format.

Working with ARM64. Hopefully you can give me some insight into this error. Is this a bech32 error originating from offline machine? I obviously cannot run any of the included binary's. I know I am in uncharted territory. The bech32 binary I built on an aarch64 Ubuntu using a newer libc6 than what is available on this Debian arm server. This is what I think is happening but wanted to see if you had any ideas from the error message before I start rebuilding anything. I do not recall needing bech32 for pool registration on testnet.

Error is happening on mainnet execute

This is while reregistering onchain data. Error happens on mainnet online machine during execute with cli wallet/s.

What is encoding/decoding serialisation format?

Command failed: transaction txid Error: Failed to decode neither the cli's serialisation format nor the ledger's CDDL serialisation format. TextEnvelope error: /dev/fd/63: TextEnvelope type error: Expected one of: TxSignedByron, TxSignedShelley, Tx AllegraEra, Tx MaryEra, Tx AlonzoEra Actual: Witnessed Tx AlonzoEra
TextEnvelopeCddl error: /dev/fd/63: Could not JSON decode TextEnvelopeCddl file at: /dev/fd/63 Error: Error in $: not enough input
TxID will be:

Thank you Martin

Error using workoffline REREG

Hi,
I have an issue when executing an offline transaction with Era discovery. I ran

  • 05a to create the pool.json file
  • Edited the JSON file to include my changes
  • 05c REREG

Then when I brought offlinetransfer to my online server, I tried to execute and got this error:
ERROR - Online(alonzo) and Offline(auto) Era mismatch!

I tried to review the code in the workoffline script and in the JSON file, and considered just manually editing the JSON to use alonzo instead of auto, but figured I'd submit this first and see if you have a BKM just in case I screw something up.

claiming rewards issue

[mati@cardano ~]$ 01_claimRewards.sh owner.staking owner.payment

Claim Staking Rewards from Address owner.staking.addr with funds from Address owner.payment.addr


Current Slot-Height: 747699 (setting TTL to 757699)
option --address: cannot parse value `5821e050201799ac75c636f7339bb55b9732cfdde4cca78e84331edbe5cc34b3834f33'

Usage: cardano-cli shelley query stake-address-info --address ADDRESS
                                                    (--mainnet |
                                                      --testnet-magic NATURAL)
  Get the current delegations and reward accounts filtered by stake address.

Claim all rewards from Address owner.staking.addr:  lovelaces

Send the rewards to Address owner.payment.addr: 00cc5ce91df9c47d9f46344d6f7dc8daec7d2cad627af803a8f45da7ec2d38e32f50201799ac75c636f7339bb55b9732cfdde4cca78e84331edbe5cc34b3834f33
Pay fees from Address owner.payment.addr: 00cc5ce91df9c47d9f46344d6f7dc8daec7d2cad627af803a8f45da7ec2d38e32f50201799ac75c636f7339bb55b9732cfdde4cca78e84331edbe5cc34b3834f33

1 UTXOs found on the payment Addr!

HASH: c2ede8f5d0317ed2bc7d885a553ea4dc94571e6533004263521a6d43624f8090   INDEX: 0        LOVELACES: 99498908824
Total lovelaces in UTX0:  99498908824 lovelaces

Invalid option `--withdrawal'

Usage: cardano-cli (Byron specific commands | Shelley specific commands |
                     Miscellaneous commands)
Mimimum transfer Fee for 1x TxIn & 1x TxOut & Withdrawal:   lovelaces
/home/mati/scripts/cardano/ff-testnet/01_claimRewards.sh: line 111: 99498908824-+ : syntax error: operand expected (error token is "+ ")

Building the unsigned transaction body:  /tmp/owner.payment.txbody

option --tx-out: cannot parse value `00cc5ce91df9c47d9f46344d6f7dc8daec7d2cad627af803a8f45da7ec2d38e32f50201799ac75c636f7339bb55b9732cfdde4cca78e84331edbe5cc34b3834f33+'

Usage: cardano-cli shelley transaction build-raw --tx-in TX-IN --tx-out TX-OUT
                                                 --ttl SLOT --fee LOVELACE
                                                 [--certificate-file FILE]
                                                 [--update-proposal-file FILE]
                                                 --out-file FILE
  Build a transaction (low-level, inconvenient)
type: TxUnsignedShelley
title: Free form text
cbor-hex:
 18b3a5008182582078d0ff183cabf23455f5e1ab91837df6215521e8b3904c18ddefa89bf50696d0
 00018182584100cc5ce91df9c47d9f46344d6f7dc8daec7d2cad627af803a8f45da7ec2d38e32f50
 201799ac75c636f7339bb55b9732cfdde4cca78e84331edbe5cc34b3834f331a00872726021a0002
 9d2d031a000a7620048182008200582050201799ac75c636f7339bb55b9732cfdde4cca78e84331e
 dbe5cc34b3834f33

Sign the unsigned transaction body with the owner.payment.skey & owner.staking.skey:  /tmp/owner.payment.tx

type: TxSignedShelley
title: Free form text
cbor-hex:
 18b183a5008182582078d0ff183cabf23455f5e1ab91837df6215521e8b3904c18ddefa89bf50696
 d000018182584100cc5ce91df9c47d9f46344d6f7dc8daec7d2cad627af803a8f45da7ec2d38e32f
 50201799ac75c636f7339bb55b9732cfdde4cca78e84331edbe5cc34b3834f331a00872726021a00
 029d2d031a000a7620048182008200582050201799ac75c636f7339bb55b9732cfdde4cca78e8433
 1edbe5cc34b3834f33a1008282582004163278dc88df370e0913609a9e8659608916485cb857a902
 313728de8ec1a0584030f2bbe57ee1149f60b9edd48c2aca617f748fd56638b6a5a3fcc65e5b2417
 2f9420fb456c534762f4b52a293ddd57f634de52442635407b4a6e50ae37b51c02825820eb45a621
 a4b4472180854da0c4c707b31570cf4e90f722bb72c7442ced12b3ba5840c4371fc35b4e2fc3d222
 5cddd334ac6c39db9c3c7104287521e9d2701c1121a0ce4fc24aca128754c8e3a7e028a06b4269fc
 1f4cb3882e51cc72b321cdac630bf6

Does this look good for you, continue ? [y/N]

Error when running 01_queryAddress.sh

When I try to run this script, I get this error:

$ 01_queryAddress.sh myWallet

Version-Info: cli 1.27.0 / node 1.27.0		Scripts-Mode: online

Checking UTXOs of Address-File danicuki.addr: addr1v8nga2jqhrn6ghpp0drsgjdjtly5pe9gxmyr2kzvzttyrkchjrt3q

Address-Type / Era: payment / shelley

Command failed: query utxo  Error: This query cannot be used for the Byron era


ERROR (Code 1) !

How to fix this?

cardano 1.32.1 support

Version 1.32.1 ERROR - Please use a cardano-cli version between 1.27.0 and 1.31.0 !
Other versions are not supported for compatibility issues, please check if newer scripts are available - thx.

If you think all is right at your side, please check the GitHub repo if there
is a newer version/bugfix available, thx: https://github.com/gitmachtl/scripts

Catalyst vote registration - Ledger-Cardano-App 6.0.3 is unavailable

Your script requires Cardano-App v6.0.3 or above to be installed on the Ledger for Catalyst-Voting-Registration. But unfortunately, I can't find version 6 using Experimental Features -> My Ledger provider -> Enable it and set it to 4.

Please tell me how to install Cardano-App v6, thanks!
Ledger-Cardano-App 6 0 3

Error: Extended public key export cancelled by user

Hi,

Following the guide, I installed the bridge for Trezor T via deb file and cardano-hw-cli on my local node.

While trying to export its public keys with:

cardano-hw-cli address key-gen --path 1852H/1815H/0H/2/0 --verification-key-file hw-stake.vkey --hw-signing-file hw-stake.hwsfile

I get the following error even with the Trezor T unlocked:

Error: Extended public key export cancelled by user

I have tried on multiple ubuntu 20.04 installations without success. How can I export both hw-stake.vkey and hw-stake.hwsfile?

Thank you

Keys and certificates

Hi, this really great. Thanks for spending the time to create all of this.

I am trying to convert my pool from cli to hardwallet but I did not use your commands to build my pool originally so I am having to figure out how to make things work with my original configuration and I have gotten pretty far but I need to know what keys and certs the following commands use so that I can change their names so that your commands will recognize them. The commands I need the information from are: 05a_genStakepoolCert.sh, 05b_genDelegationCert.sh and, 05c_regStakepoolCert.sh
FYI, I originally followed the coin cashew guide (https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node)..

Thank you for your help,
Anthony

Error with workaround on get_currentTip function

Context:

I was just refreshing the metadata of my pool so going through

  1. 05a_genStakepoolCert.sh => All went fine
  2. 05c_regStakepoolCert.sh => Problem happened

I was getting an error on the second step on 00_common.sh line 334
This is where get_currentTip assignation lies, it wasn't being able to fetch the current tip.
Receiving the error "query tip return from cardano-cli failed", the value of currentTip was "".

Exact problem

I pass you all the debug but running the steps manually the same exact way it turns out that cardano-cli was working fine, but as soon as you would pipe jq to cardano-cli you would receive a MuxError (MuxIOException writev: resource vanished (Broken pipe))
as per code

local currentTip=$(${cardanocli} query tip ${magicparam} 2> /dev/null | jq -r .slot 2> /dev/null)

Workaround

As everything else was going fine and I had to go through it I simply bypassed jq and did a dirty (but working) bypass.

${cardanocli} query tip ${magicparam} 2> /dev/null > /tmp/current.tip
local currentTip=$(cat /tmp/current.tip | jq -r .slot 2> /dev/null)

Not a rockstar script but it did the trick and got me through it.
It also did prove the point that there is some sort of wrong interaction between cardano-cli and jq ???

Extra Info

$ cardano-cli --version
cardano-cli 1.30.1 - linux-aarch64 - ghc-8.10
git rev 0fb43f4e3da8b225f4f86557aed90a183981a64f
$ jq --version
jq-1.6
$ uname -a
Linux ip-10-0-0-31 5.11.0-1020-aws #21~20.04.2-Ubuntu SMP Fri Oct 1 13:01:34 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

I can't really explain it, this is systematically happening on my utility node that only exist for the time of typing command and is then destroyed.
This query tip / jq error is not happening on my production nodes with the same cardano-cli but a different ubuntu

$ uname -a
Linux ip-10-0-0-126 5.11.0-1019-aws #20~20.04.1-Ubuntu SMP Tue Sep 21 10:41:13 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

conclusion

Anyway, it's not your script being really in trouble here but for a better customer service perhaps using a middle buffer for this command might make sense.
You tool, your choice.
Thanks again for the good work and the service. Keep up the good work !

Update require to hyperlink in README.md

The README example "Update stakepool parameters on the blockchain"
contains an old hyperlink, Unlock , to ff-testnet script

  1. Unlock the existing mypool.pool.json file and edit it. .....

Byron addresses not recognised anymore

Hello,

First of all thank you for this amazing set of scripts.

It looks like support for byron addresses is now broken:

root@70bd4af67342:~/keys# 01_queryAddress.sh DdzFFzCqrhsjXcNi9RRfkk3Uk3LT1Jrzr6Gb9P5cDAcSZZBouxtK21mvpYvZkwbTRDs2y4DPpsandUign8cvZt6GApx33jsmZTpgZwfh

Version-Info: cli 1.34.1 / node 1.34.1		Scripts-Mode: online


ERROR - Destination Address can't be resolved. Maybe filename wrong, or not a payment-address.

root@70bd4af67342:~/keys# cardano-cli query utxo --address DdzFFzCqrhsjXcNi9RRfkk3Uk3LT1Jrzr6Gb9P5cDAcSZZBouxtK21mvpYvZkwbTRDs2y4DPpsandUign8cvZt6GApx33jsmZTpgZwfh --mainnet
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------

Can you please take a look?

Thanks!

How to rotate KES Key in offline mode ?

Hi,
To rotate the KES key and Opcert, there are the 04c and 04d scritps.
However I have an offline machine which contains my BP node keys.
Is it possible to rotate the KES key and Opcert on the offline machine ? If so I do not understand how the scripts can get the "online" required info to do that ?
I could run the 01 script on the online machine but with which arguments for a KEY rotation objective ? (there is no payument to do)

Can you help ?

Thanks

Address Handling in sendLovelaces.sh

I tried to use this script to transfer ff-testnet lovelaces from one enterprise style address to another in separate directories. I used the following syntax to launch the script:

./01_sendLovelaces.sh ../priv/payment1 pool-002_enterprise 4425831

payment1 is the send-from address
pool-002_enterprise is the receiver address
4425831 is the number of lovelace to send

Here is the output the script generated:

Sending lovelaces from Address ../priv/payment1.addr to Address pool-002_enterprise.addr:

Current Slot-Height: 817630 (setting TTL to 827630)

Source Address ../priv/payment1.addr: 619ea1cba1088c5d9(truncated)
Destination Address pool-002_enterprise.addr: 617d6c090574b284858(truncated

2 UTXOs found on the source Addr!

HASH: 1f620efdfa52e8(truncated) INDEX: 0 LOVELACES: 10000000
HASH: 69ebd62083d6(truncarted) INDEX: 1 LOVELACES: 4425831
Total lovelaces in UTX0: 14425831 lovelaces

Minimum Transaction Fee for 2x TxIn & 2x TxOut: 169725 lovelaces
Lovelaces to send to pool-002_enterprise.addr: 4425831 lovelaces
Lovelaces to return to ../priv/payment1.addr: 9830275 lovelaces

Building the unsigned transaction body: tx_../priv/payment1.txbody

Error while writing unsigned shelley tx: tx_../priv/payment1.txbody: tx_../priv/payment1.txbody: openBinaryFile: does not exist (No such file or directory)
cat: tx_../priv/payment1.txbody: No such file or directory

Sign the unsigned transaction body with the ../priv/payment1.skey: tx_../priv/payment1.tx

Error while reading unsigned shelley tx: tx_../priv/payment1.txbody: tx_../priv/payment1.txbody: openBinaryFile: does not exist (No such file or directory)
cat: tx_../priv/payment1.tx: No such file or directory

Does this look good for you, continue ? [y/N] N

Note the errors produced by the script. Perhaps it is not parsing the address name from the path correctly? The receiver address was in the same directory so I don't know if both send and receive addresses would experience the same issue if a path was prepended to them when launching the script.

Error Formatting

if [[ ${#poolMetaDescription} -gt 250 ]]; then echo -e "\e[35mERROR - The poolMetaDescription entry in your ${poolFile}.pool.json is too long. Max. 64chars allowed !\e[0m\n\nPlease re-edit the poolMetaDescription entry in your ${poolFile}.pool.json, thx!\e[0m"; exit 1; fi

Says 64 chars, but its checking for 250.

Path ERROR - Config IS pointed correctly

Hi all,

Could be just me but I've triple checked.

I have configured the scripts to point to my shelley genesis file but I am presented with this error when testing.
`
xnode@xnode:~/.local/bin$ 00_common.sh

Version-Info: cli 1.25.1 / node 1.25.1 Scripts-Mode: online

Path ERROR - Path to the shelley genesis file is wrong or the file is missing!

If you think all is right at your side, please check the GitHub repo if there
is a newer version/bugfix available, thx: https://github.com/gitmachtl/scripts
`

Here is my paths in the config please tell me if I'm doing this wrong.

`
socket="/home/cnode/sockets/node.socket"

genesisfile="/home/cnode/config/mainnet-shelley-genesis.json" #Shelley-Genesis path
genesisfile_byron="/home/cnode/config/mainnet-byron-genesis.json" #Byron-Genesis path

cardanocli="cardano-cli" #Path to your cardano-cli you wanna use
cardanonode="cardano-node" #Path to your cardano-node you wanna use
`

Now if I follow that directory structure it takes me DIRECTLY to my shelley file. So I'm quite confused as to what may be wrong. Any suggestions would be awesome.

Finally, my scripts are located in /home/.local/bin for convenience

0x_importHelper.sh - ERROR, not a valid Metadata-URL found in the online pool data

I've tried with many other pools, and got the same error while trying to import data.


Version-Info: cli 1.25.1 / node 1.25.1		Scripts-Mode: online

Using the following name for the import process: 'helas'

Creating Directory with name: 'helas' ... OK

Fetching Pooldata online for PoolID: 'pool17ajuw0arwq8klfe4xy8tcqj4yetp8kerl4amzn5dsnne20wlnsa' ... ERROR, not a valid Metadata-URL found in the online pool data!

Some Scripts Have Empty TTL

https://github.com/gitmachtl/scripts/blob/bd6358d15548191c6fe7a606d4c43757abdf74ec/cardano/mainnet/11a_mintAsset.sh#LL176C1-L176C1

if I bring in a script to be used here and the script uses the "all" syntax but only contains a signing key, this line in the scripts does not correctly get set to "unlimited" and is instead set to an empty string. So we should check for whether or not this is an empty string or not as well.

Example script that causes error:

{
  "scripts": [
    {
      "keyHash": "64...6c",
      "type": "sig"
    }
  ],
  "type": "all"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.