text:
Cardano-Wallet on LAN
No connection could be made because the target machine actively refused it.
That's all I can manage to get when making an http call to cardano-wallet on another machine on my local LAN.
Cardano-wallet is synced and I used 'serve' when launching the wallet and the port I specified is open and listening...

What wallet software and software version are you using? On what OS (WIndows/Mac/Linux)? What are you trying to connect to?

Apologies, I realize this is not really a Cardano-specific question - I am just very frustrated lol

So...using curl in a command line on the SAME linux machine where I have the node & wallet running, I am able to use the web api without issue - I just ran a v2/wallets to list known wallets and it works fine.
It's just calling from any other machine on my LAN I am only getting "...target machine actively refused it..." even though I have confirmed the firewall on that machine is inactive and the cardano-wallet process is reporting 'LISTEN' on the port it was launched to serve on...

I think it must have something to do with the host being configured when the wallet launches as the loopback 127.0.0.1 but that not mapping for requests to the ip of the machine

--listen-address
!!! THAT was it :)
The default in the startup command for Cardano-wallet is the loopback address so of course I could not reach that from anywhere except the same machine the wallet was running on!
Got it - now connecting and interacting on LAN woot!


text:
Cardano-cli requires signing key to be a file, fails with a named pipe
Please see the discussion here.  https://forum.cardano.org/t/cardano-cli-signing-a-transaction-without-directly-accessing-the-skey-file-in-plain-text/103742/11
cardano-cli should be able to read signing keys from a named pipe to maintain a high level of security while handling keys, a bug report was submitted but no further interactions.
https://github.com/input-output-hk/cardano-node/issues/4101
Thoughts? Alternative approaches? Maybe we can flag someone from IOG who can help clarify if this has been discussed and is a design choice or is it really a "bug".

If you want to formalise this for deeper consideration and discussion then a Cardano Improvement Proposal (CIP) could be raised at https://cips.cardano.org/

I can also add this here: https://github.com/input-output-hk/cardano-node/issues/4235
the process substitution is working for some parameters, for some not.

Good catch too! These little details really help maintain a high level of security when dealing with keys.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Cardano-node and cli install "llvm error"
I'm facing error with the llvm install, i tried all the llvm@11;12;13 even the 14 and still a come across error when i move to step "cabal build all" my set up is a M1 pro. Help!  thank you

The M1 Mac is likely to be the issue. I don't use Mac so I can't help.

Could you try to run open ~/.zshrc in your terminal and in that file add export PATH="/usr/local/opt/llvm/bin:$PATH"?
Once you've done that open a new terminal and try to run cabal build all. If the llvm error disappears and show another error related to HsOpenSSL run brew install openssl. Then go to cabal.project in the cardano-node directory and add this:
package HsOpenSSL
  extra-include-dirs: /opt/homebrew/opt/openssl@3/include
  extra-lib-dirs: /opt/homebrew/opt/openssl@3/lib

NOTE: recent versions of homebrew have changed the path from /opt/homebrew/opt to  /usr/local/opt. Please do a manual check to see where your brew installs are getting placed.
Here's a comprehensive document that shows the installation process for Mac (M1 as well)!
https://github.com/mallapurbharat/cardano-tx-sample/blob/main/0_installation/preview_preprod_network/1_macos_m1_process.md

Looks like you might have installed llvm but it isn't in the path. Just to be on the safe side, try the steps in the guide below.
This is adapted from the standard installation documentation, but with some steps added as required based upon various suggestions etc.
This worked for me just a day or two ago on MacOS with M1 chip for 1.35.3, and today I reset based upon IOG's recommendation to 1.35.2 with the same steps, so it is vetted twice over!
UPDATE: Extensively updated the document with various checks that worked for quite a few of my learners with various issues that they faced.
Updated for Preview, Preprod networks (and legacy network as well to some extent)
https://github.com/mallapurbharat/cardano-tx-sample/tree/main/0_installation/preview_preprod_network

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
npm run start in plutus-playground-client creating npm errors
edit...I was able to get the plutus-playground-client working by using --force.  How do I fix the monaco-editor dependency errors so I don't need to force it? Or do I even need to worry about it?
I am getting errors when trying to start the plutus-playground-client.
The interpreter is ready when I enter the command GC_DONT_GC=1 plutus-playground-server in the plutus-playground-server directory
When I enter the command GC_DONT_GC=1 npm run start in the plutus-playground-client directory I get a bunch of npm ERR! saying something about problems with monaco-editor
I am using an M1 macbook with Monterey V12.4
Going through Plutus Pioneer program 3rd iteration.  Git checkout week01.
I notice now when I try to build the plutus-playground-client I get the same errors as when I try to npm run start in the plutus-playground client directory.
The errors I'm getting are...
[nix-shell:~/plutus-apps]$ cd plutus-playground-client
GC_DONT_GC=1 npm run start

> plutus-playground-client@1.0.0 start
> plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev

[Info] Running: (Nothing,PSGenerator {_outputDir = "generated"})
The following purescript packages are needed by the generated code:

  - plutus-playground-client
  - purescript-argonaut-codecs
  - purescript-either
  - purescript-enums
  - purescript-lists
  - purescript-maybe
  - purescript-newtype
  - purescript-ordered-collections
  - purescript-prelude
  - purescript-profunctor-lenses
  - purescript-tuples
  - web-common

Successfully created your PureScript modules!

Successfully created your servant API purescript functions!
Please make sure you have purescript-servant-support and purescript-bridge-json-helpers installed

Done: generated
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: monaco-emacs@0.2.2
npm ERR! Found: monaco-editor@0.21.3
npm ERR! node_modules/monaco-editor
npm ERR!   monaco-editor@"^0.21.0" from the root project
npm ERR!   peer monaco-editor@"0.21.x" from monaco-editor-webpack-plugin@2.1.0
npm ERR!   node_modules/monaco-editor-webpack-plugin
npm ERR!     monaco-editor-webpack-plugin@"^2.1.0" from the root project
npm ERR!   1 more (monaco-vim)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer monaco-editor@"^0.14.0 || ^0.15.0 || ^0.16.0 || ^0.17.0 || ^0.18.0 || ^0.19.3 || ^0.20.0" from monaco-emacs@0.2.2
npm ERR! node_modules/monaco-emacs
npm ERR!   monaco-emacs@"^0.2.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: monaco-editor@0.20.0
npm ERR! node_modules/monaco-editor
npm ERR!   peer monaco-editor@"^0.14.0 || ^0.15.0 || ^0.16.0 || ^0.17.0 || ^0.18.0 || ^0.19.3 || ^0.20.0" from monaco-emacs@0.2.2
npm ERR!   node_modules/monaco-emacs
npm ERR!     monaco-emacs@"^0.2.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/tamio/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tamio/.npm/_logs/2022-08-04T13_36_55_265Z-debug-0.log

[nix-shell:~/plutus-apps/plutus-playground-client]$


text:
Automatically connect to wallet if website is whitelisted
I am currently connecting to a cardano wallet like this.
  const [walletApiKey, setWalletApiKey] = useState(null);

  const connectCardanoWallets = async (selectedWallet) => {
    const walletFound = !!window?.cardano?.[selectedWallet];
    if (walletFound) {
      try {
        let walletApi;
        walletApi = await window.cardano[selectedWallet].enable();
        setWalletApiKey(walletApi);
      } catch (err) {
        console.log(err);
      }
    } else {
      toast('Wallet not found');
    }
  };

If they have previously connected to our website before , when I envoke the method .enable() we get the API key automatically without the user putting in their password to whitelist us again. Right now I am using a useEffect hook like this to connect to their wallet.
  useEffect(() => {
    connectCardanoWallets('nami');
  }, []);

How do I check if our website is whitelisted so i can automatically connect to their wallet and don't automatically envoke the .enable() method if my website is not whitelisted?

The simplest solution I had is to use a cookie which you set once you grants you permission. Then, as a user visits your page, you just read the cookie and get the selected wallet.

Above simple solution will work, but you could expand it more like:

check if the window.cardano API is available
loop through all wallets to check if they are installed
check if they are enabled, there is a isEnabled() function which can be used.

With this feedback you can give the end-user a dropdown where you list all wallets and enable/highlight the ones that are available.


text:
Yoroi and Typhon return FeeTooSmallUtxo error when submitting transaction
I've been playing around with cardano-serialization-lib and building different types of transactions with TransactionBuilder. However, when I calculate fee and change using add_change_if_needed(addr) for a transaction, that interacts with a plutus script (in my case - the alwayssucceeds script, deployed on Testnet), I get the FeeTooSmallUtxo error, when submitting the transaction via Yoroi or Typhon wallet. At the same time, Nami wallet submits the tx without a problem. I am very confused as to why it is so.
Can anybody help me figure this out?
Here is a code snippet from a function that builds a transaction to send ADA to the contract address:
txBuilder.add_change_if_needed(shelleyChangeAddress);

let txBody = txBuilder.build();
let txHash = CardanoWasm.hash_transaction(txBody);

let witnesses = CardanoWasm.TransactionWitnessSet.new();
let transaction = CardanoWasm.Transaction.new(txBody, witnesses, undefined);

let witnessCBOR = await walletconnected.signTx(buf2hex(transaction.to_bytes()), true);
witnesses = CardanoWasm.TransactionWitnessSet.from_bytes(hex2buf(witnessCBOR));

transaction = CardanoWasm.Transaction.new(txBody, witnesses, undefined);
let trHash = await walletconnected.submitTx(buf2hex(transaction.to_bytes()));

And here is the error I get from Yoroi:
transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage
(ApplyTxError [UtxowFailure (UtxoFailure (FromAlonzoUtxoFail
(FeeTooSmallUTxO (Coin 174125) (Coin 169901))))])

This could be related to the underlying version of cardano-node to which the transaction is being submitted. There was a recent bug on Testnet which looks to be related: https://github.com/input-output-hk/cardano-node/issues/4236
So this might not be related to your own code.


text:
TxOutRefNotFound when using Plutus.Contract.Wallet (getUnspentOutput)
I am trying to get a UTxO of the current wallet, use it to mint a token via the OneShotCurrency type, but I keep getting the following Error:
(TxOutRefNotFound (TxOutRef {txOutRefId = b2f06756e65c009ced73c87919e4f8dd0e640b002a247083354f7122f82d312f, txOutRefIdx = 10}))
Here are my lookups and tx construction. Thanks for any help!
[...]
do
    ppkh   <- ownPaymentPubKeyHash
    oref   <- getUnspentOutput
    utxos  <- utxosAt (pubKeyHashAddress ppkh Nothing)
    let
        pol  = curPolicy $ OneShotCurrency { curRefTransactionOutput=(txOutRefId oref, txOutRefIdx oref), curAmounts=(PlutusTx.AssocMap.singleton myTokenName 1) }
        mVal = Value.singleton (scriptCurrencySymbol pol) myTokenName 1
        d    = [...]
        lookups       = Constraints.unspentOutputs utxos                            <>
                        Constraints.mintingPolicy pol                               <>
                        Constraints.typedValidatorLookups validatorInstance
        tx            = Constraints.mustSpendPubKeyOutput txOutRef                  <>
                        Constraints.mustPayToTheScript d (mVal <> Ada.adaValueOf (getAda 3000000))  <>
                        Constraints.mustMintValue mVal                              <>
                        Constraints.mustBeSignedBy ppkh
    ledgerTx <- submitTxConstraints validatorInstance tx
    awaitTxConfirmed $ getCardanoTxId ledgerTx
    logInfo @P.String "Initialized"
[...]

More context is needed. Did you run this contract using PAB (plutus-pab) or using plutus-contract emulator? When you're saying "current wallet", what are you referring to?

I ran it using the plutus-contract emulator.

The txOutRef variable is undefined. Is it actually oref?


text:
Different versions of Ouroboros consensus protocol
What's the difference between different versions of Ouroboros consensus protocol? I know there are so many discussions on the web, but most of them just repeat the few same sentences and does not provide any insight.
Question: After Ouroboros Classic, Cardano implemented Ouroboros BFT, but they kept the BFT protocol on the Mainnet for only 5 months.
1- What was the problem with Ouroboros Classic that it was replaced by Ouroboros BFT?
2- Why was Ouroboros BFT on the Mainnet only 5 months?

Here is a recent blog post by IOHK explaining the different "flavors" of Ouroboros.
Regarding your question/comments - there wasn't anything "wrong" with the Ouroboros-BFT (OBFT) concept of federated servers. As per the original Cardano roadmap, the network was intended to be bootstrapped from a federated setting (where all block production is done by a central entity, in this case IOG), and then transition to a decentralized network (Shelley Era). This transition had to be executed well, because every transition/HFC after this point would be on a decentralized network, with no chance of reverting back to a central point of control.
Without going too deep into the differences between O-Classic and OBFT (because I don't really know them), OBFT was a sort of cleanup of all the lessons learned from Classic that would allow for smooth and stable transition(s) from Byron to Shelley to Goguen and beyond. In other words, it was extremely important that the initial conditions of the system were such that, upon releasing it into the wild, evolving/upgrading the protocol would be as straightforward as it is today. A lot of forethought went into this, and for this reason, the classic to OBFT transition was the only real "Hard Fork" in Cardano's history. It marked the end of Cardano's infancy, and imbued the system with the ability to evolve.

Thank you @zhekson for paying attention to this post. However, the link you provided in your answer contains a limited amount of information. For example, it says "It is worth noting that BFT required a larger fraction of honest parties than other Ouroboros versions". But, in Ouroboros BFT paper clearly has been mentioned that the Ouroboros BFT increased the fault tolerant from n/3 (for standard BFTs) to n/2 (like the Classic protocol).

Ouroboros BFT introduced the concept of "federated network of servers". What was wrong in this concept that caused Praos to replace it. Please note that I understand that Praos introduced the VRF concept to prevent adversaries and also, improved the design assumptions from synchronous network (in BFT) to partially synchronous network (in Praos). But, my question goes back to the "federated network of servers" part in BFT that is replaced by Praos?

edited original answer to better address your question/comments. My knowledge on the differences between classic/OBFT is limited, and I am expressing my understanding of the philosophical differences between the two.


text:
How to query for an executed smart contract in db-sync?
If any DApp allows the user to connect their wallet and make use of a given smart contract, how can I most efficiently find that through queries in db-sync? Select on an address associated with the smart contract address? Search for assets or wallets involved in the smart contract's execution?
So:
Smart Contract X is executed on behalf of connected wallet Y, involving assets A, B & C.
How to find this..as a tx_out?
Thank you!


text:
Can db-sync be used to "listen" for transactions involving particular smart contracts?
Take JPG store as an example.
When someone lists an NFT for sale there, or when someone buys an NFT there, a smart contract governs that transaction.
Can sql queries against the db-sync generated blockchain data "see" that?
I'd like to write sql queries against the db-sync data that show the most recent transaction involving a particular smart contract, but I'm not sure what to query for...
UPDATE:
Here is a call to opencnft's free api which allows me to know the most recent transactions involving a particular NFT policy, sorted by date.
If I want to simple replicate that by using sql queries against db-sync, that's also something I am interested in:
https://api.opencnft.io/1/#/Policy/PublicController_getPolicyTx
However...that makes the NFT policy the focus of the query, whereas I am also looking for a query that would find the same resulting transaction had occurred but with the Smart Contract being used as the criteria I am querying on.
So in plain language - there are two generalized queries I am hoping to create as a basis and launching pad for other queries?

select the latest transaction 'Smart Contract X' was involved in, and the  assets involved in that transaction.

select the latest transaction 'Policy Id X' was involved in and any Smart Contracts and/or other assets involved in the transaction.

...sort of like looking for the same thing but from two different perspectives in terms of the criteria and tables involved in building the query?

What data specifically are you hoping to get out of db-sync ?

That a smart contract was executed, and what assets / values were involved..? For example: If someone lists an NFT for sale on JPG store, then the policy of the JPG store smart contract is the signature I am looking for, and I am interested in what asset was listed for sale. The smart contract has an identity, the NFT being listed for sale has an identity, so I am assuming I should be able to build a query that returns the last time a smart contract was executed in a transaction, and what assets are involved in that transaction? Of course, I may have a misconception about what can be queried.

Updated with an Edit to give a comparison to opencnft.io

Would something like the Blockfrost API for watching transactions happening against an address work for you? Something like this maybe? You could also query for assets held by an address
Ultimately, you can query specific details using multiple queries and filters on the JSON data returned and probably achieve what you want.

Thanks Bharat - I have used Blockfrost, but am seeking to do everything I want to do using only my own node, db-sync, and wallet.
I do already use db-sync to watch addresses.
My question is more about how to query what tables to find records related to the use of a specific smart contract - my thought was to build a query that uses the ID of a smart contract as the key to query on, and hopefully to find it's most recent execution, and the tx_outs/assets associated with that, so I could say basically: show me the last time this SC ran and what assets were inputs/outputs in that transaction.

Maybe oura is something for you to be worth looking into. https://github.com/txpipe/oura
In a nutshell: Oura allows you to watch for patterns in the blockchain as it progresses and then if you have found a match trigger your own events. So in your case you could have different filters that would trigger the same web enpoint but offer different payloads.


text:
How to efficiently query for all transactions involving a particular policy
What is the best way (or perhaps only way) to query db-sync for transactions involving a specific policy?

Since you mention "policy" it means you are only interested in multi asset transactions which are all contained in the ma_tx_out table.
However, you need to be aware that multiple assets can have the same policy. If this is what you want, the query would be:
select ma_tx_out.* from ma_tx_out inner join multi_asset
  on ma_tx_out.ident = multi_asset.id
  where multi_asset.policy = '\x....' ;

If instead you want all transaction for the same multi-asset then the query would be:
select * from ma_tx_out.ident = ? ;

Thank you Erik!
So ma_tx_out are the tx_out records for any policy and  multi_asset.id is the id of an asset that belongs to that policy?

Yes, all multi asset transactions are recorder in the ma_tx_out table. A multi_asset.id is actually a tuple of (policy, name) so that (policy1, name1) is different from (policy1, name2). I suspect that you are actually interested in the multi_asset.id rather than the policy.

If you do select * from multi_asset ; you will see that each multi_asset row has a fingerprint which is probably what you should be using rather than policy.

If you do select * from multi_asset order by policy limit 10 ; you will see that there are rows with the same policy field, but since they have different name fields, their fingerprint fields also differ.

...how can I use:
where multi_asset.policy = '\x....' ;
...if the 'policy' column contains a byte array? Explicit conversion to a literal in the sql query itself?
Thanks very much for all your responses Erik! I am learning!

ohh haha
https://www.postgresql.org/docs/current/datatype-binary.html


text:
Token price API
Besides http://analytics.muesliswap.com/ticker - are there any other APIs that return token price?

There is this from minswap:
https://api-mainnet-prod.minswap.org/coinmarketcap/v2/pairs
or this minswap blockfrost adapter:
https://github.com/minswap/blockfrost-adapter

Definitely yes! For Cardano use the following CoinGecko API:
https://api.coingecko.com/api/v3/coins/cardano
Under market_data.current_price key you will find the current price of the fiat & cryptocurrency you want of $ADA.

For more info regarding the API. Read the docs https://www.coingecko.com/en/api/documentation


text:
Cardano Rosetta API returning 5000 error occurred - Cannot read property 'key_deposit' of undefined
Cardano Rosetta Construction endpoints /construction/preprocess and other endpoints are returning 5000 Error with Cannot read property 'key_deposit' of undefined". Also, /construction/metadata is returning  Cannot read property 'min_fee_a' of undefined". This is for rosetta 1.8.0 with db-sybc 13.0.0

This error is happening as the epoch_param table is empty and the APIs need Protocol parameters for the epoch. The table is left empty if we use the --disable-ledger parameter while running the db-sync. More here, https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/configuration.md#--disable-ledger
For a quick fix, enter value in the protocol parameters in the epoch_param table.
Warning: Running db-sync with this flag and then restarting it without the flag will cause crashes and should be avoided.


text:
Cardano-Node 1.35.0 Build Error on M1 Mac
I'm trying to install cardano-node version 1.35.0 on my M1 Mac.  It worked (somewhat) previously with version 1.34.2 using LLVM.  Currently I am running into this error when it tries to build threepenny-gui:
dlopen(/Users/stefan/.cabal/store/ghc-8.10.7/lib/libHSHsOpnSSL-0.11.7.2-e201b3b3-ghc8.10.7.dylib, 0x0005): symbol not found in flat namespace (_DSA_free)

It looks like the issue is with the openSSL library with cabal is missing a required symbol.  Does anyone have any suggestions on how to make this available?

This might be answered in https://cardano.stackexchange.com/questions/8803/cardano-node-and-cli-install-llvm-error .

@ErikdeCastroLopo, that didn't address my issues.

The issue had to do with the openSSL library I was using and was resolved in the instructions provided here: https://github.com/mallapurbharat/cardano-tx-sample/blob/main/0_installation/Old/macos_m1_process.md
This included including the homebrew openssl library.  Specifically here and here.


text:
Deploy a local testnet
To test plutus scripts and transactions, I want to have a lightweight environment which I can use when I have no internet. So, how can I deploy a local testnet in the Babbage era for testing?

A local testnet can easily be deployed in the babbage era via the following script in the node repository (1). This method requires you to quickly sequence some commands. This is due to this and failing to launch the stake pools within the 30 seconds will result in not correctly deploying the testnet. I think you can change the 30 start_time yourself to overcome this. The scripts also assumes that the cardano-node and cardano-cli binaries are in your path. Personally, I just enter a nix-shell in the node repository to have these available.
To use this script, you must run it from the cardano-node/ directory via the command
./scripts/babbage/mkfiles.sh

This will create the directory cardano-node/example. In this folder, there are three other scripts that each deploy a stake pool for the testnet (node-spo*.sh). These need to be deployed before the start_time (30 seconds from the mkfiles.sh script execution), so it is good practice to have 3 terminals ready. These node-spo*.sh scripts also need to be executed from the cardano-node/ directory, not the cardano-node/example/ directory. This is because there are some file structures hard-coded in the scripts. To launch the first stake pool, execute the command,
./example/node-spo1.sh

Do the same for node-spo2.sh and node-spo3.sh. The testnet is now running!
The example folder contains the following files. Most notably, you have geneses UTxO keys in the example/utxo-keys/ folder, where the address can be derived via the command,
cardano-cli genesis initial-addr --verification-key-file utxo-keys/utxo1.vkey --testnet-magic 42

.
├── byron-gen-command
│   ├── genesis-keys.000.key
│   ├── genesis-keys.001.key
│   └── genesis-keys.002.key
├── byron.genesis.spec.json
├── configuration.yaml
├── delegate-keys
│   ├── delegate1.counter
│   ├── delegate1.kes.skey
│   ├── delegate1.kes.vkey
│   ├── delegate1.skey
│   ├── delegate1.vkey
│   ├── delegate1.vrf.skey
│   ├── delegate1.vrf.vkey
│   ├── delegate2.counter
│   ├── delegate2.kes.skey
│   ├── delegate2.kes.vkey
│   ├── delegate2.skey
│   ├── delegate2.vkey
│   ├── delegate2.vrf.skey
│   ├── delegate2.vrf.vkey
│   ├── delegate3.counter
│   ├── delegate3.kes.skey
│   ├── delegate3.kes.vkey
│   ├── delegate3.skey
│   ├── delegate3.vkey
│   ├── delegate3.vrf.skey
│   ├── delegate3.vrf.vkey
│   ├── opcert1.cert
│   ├── opcert2.cert
│   └── opcert3.cert
├── genesis
│   ├── byron
│   │   └── genesis.json
│   └── shelley
│       ├── genesis.alonzo.json
│       └── genesis.json
├── genesis.alonzo.spec.json
├── genesis-keys
│   ├── genesis1.skey
│   ├── genesis1.vkey
│   ├── genesis2.skey
│   ├── genesis2.vkey
│   ├── genesis3.skey
│   └── genesis3.vkey
├── genesis.spec.json
├── main.sock -> node-spo1/node.sock
├── node-spo1
│   ├── byron-delegate.key
│   ├── byron-delegation.cert
│   ├── db
│   │   ├── immutable
│   │   │   ├── 00000.chunk
│   │   │   ├── 00000.primary
│   │   │   └── 00000.secondary
│   │   ├── ledger
│   │   ├── lock
│   │   ├── protocolMagicId
│   │   └── volatile
│   │       └── blocks-0.dat
│   ├── kes.skey
│   ├── node.log
│   ├── node.sock
│   ├── opcert.cert
│   ├── port
│   ├── topology.json
│   └── vrf.skey
├── node-spo1.sh
├── node-spo2
│   ├── byron-delegate.key
│   ├── byron-delegation.cert
│   ├── db
│   │   ├── immutable
│   │   │   ├── 00000.chunk
│   │   │   ├── 00000.primary
│   │   │   └── 00000.secondary
│   │   ├── ledger
│   │   ├── lock
│   │   ├── protocolMagicId
│   │   └── volatile
│   │       └── blocks-0.dat
│   ├── kes.skey
│   ├── node.log
│   ├── node.sock
│   ├── opcert.cert
│   ├── port
│   ├── topology.json
│   └── vrf.skey
├── node-spo2.sh
├── node-spo3
│   ├── byron-delegate.key
│   ├── byron-delegation.cert
│   ├── db
│   │   ├── immutable
│   │   │   ├── 00000.chunk
│   │   │   ├── 00000.primary
│   │   │   └── 00000.secondary
│   │   ├── ledger
│   │   ├── lock
│   │   ├── protocolMagicId
│   │   └── volatile
│   │       └── blocks-0.dat
│   ├── kes.skey
│   ├── node.log
│   ├── node.sock
│   ├── opcert.cert
│   ├── port
│   ├── topology.json
│   └── vrf.skey
├── node-spo3.sh
├── pools
│   ├── cold1.skey
│   ├── cold1.vkey
│   ├── cold2.skey
│   ├── cold2.vkey
│   ├── cold3.skey
│   ├── cold3.vkey
│   ├── kes1.vkey
│   ├── kes2.vkey
│   ├── kes3.vkey
│   ├── opcert1.counter
│   ├── opcert2.counter
│   ├── opcert3.counter
│   ├── staking-reward1.skey
│   ├── staking-reward1.vkey
│   ├── staking-reward2.skey
│   ├── staking-reward2.vkey
│   ├── staking-reward3.skey
│   ├── staking-reward3.vkey
│   ├── vrf1.vkey
│   ├── vrf2.vkey
│   └── vrf3.vkey
├── run
│   └── all.sh
├── stake-delegator-keys
│   ├── payment1.skey
│   ├── payment1.vkey
│   ├── payment2.skey
│   ├── payment2.vkey
│   ├── payment3.skey
│   ├── payment3.vkey
│   ├── staking1.skey
│   ├── staking1.vkey
│   ├── staking2.skey
│   ├── staking2.vkey
│   ├── staking3.skey
│   └── staking3.vkey
└── utxo-keys
    ├── utxo1.skey
    ├── utxo1.vkey
    ├── utxo2.skey
    ├── utxo2.vkey
    ├── utxo3.skey
    └── utxo3.vkey

EDIT: Recently the example/run/all.sh has been added to the repo, this lets you run all three example/node-spo*.sh all at once.


text:
How can client update transaction after taking snapshot of Mithril?
According to what I read in the Mithril docs. The snapshots will be saved in Mithril Aggreagtor for each epoch (This means 1 snapshot will be created every 5 days). Light wallets can then download this snapshot to see their transaction history without downloading the full node.
But snapshots only provide pre-snapshot transaction information. If after the snapshot is created, I make a transaction, will the transaction be updated on my wallet? Or do I have to wait 5 days for the next snapshot of my transaction to be updated?

A mithril snapshot currently contains the whole persisted DB of a cardano-node. As said by @roy-nakakawa, it's tied to a Cardano epoch because Mithril relies on the epoch's stake distribution for signing the snapshot, but there won't be a single snapshot per epoch. It's still a parameter to be tuned but the idea is to balance the resources needed to produce signatures, aggregate them and build snapshot with the amount of work needed to catch-up in between snapshots, to decide on the frequency of snapshot generation.
To address your questions:

If after the snapshot is created, I make a transaction, will the transaction be updated on my wallet?

It would depend on the specifics of your wallet, but the idea is that a (heavyweight at least) wallet would start with a snapshot taken at some point in the past, and then "follow the chain" from that point on, a process that should be pretty fast (eg. seconds or minutes) to reach the tip of the chain.
Once there, it will proceed as normal and your transaction will certainly be reflected in your wallet's state and on-chain as soon as possible, eg. pending confirmation.

Or do I have to wait 5 days for the next snapshot of my transaction to be updated?

It's not clear what you mean by "next snapshot of my transaction" but no, you won't have to wait for 5 days as your wallet will have caught up before.
What I have said is true for the current state of Mithril which is geared towards heavyweight wallet as we are still figuring out how to best fulfil lightwallet's needs. A light wallet does not have direct access to a cardano-node and relies on a third party to provide a trusted view of the chain, and the current idea we are exploring is to find a way to provide a fragment of the snapshotted state, and/or sign multiple things.

What is the mechanism of heavyweight wallet follow the chain after taking snapshot? You mean we have to rely on another sever?

Sorry for taking so long to respond @QuangDaniel. The snapshot is used to prime a Cardano-node, then after it's bootstrapped, it follows the chain normally, connecting to other nodes in the network and pulling new blocks as they are diffused across it.

Mithril snapshots will be generated more often than Cardano epochs.

How often? What if I make a transaction 1s after snapshot?


text:
Calculate tx fees via Blockfrost or any other provider?
Is there a way to calculate transaction fees without having to go through cardano-cli? Maybe something like Blockfrost? or any other API providers? I don't want to run a local node to do that.

If you don't want to run a local node, how are you expecting to submit the transaction? The normal way of doing this is to use cardano-cli to first calculate the free and then use it to submit the transaction.

@ErikdeCastroLopo, I intend to submit it via Blockfrost.

Transaction fees are computed based on two factors: size of the transactions, and required resources (memory and CPU steps).
As Melroy van den Berg mentioned, transaction size increases the fee linearly:
fee_for_size = a * size(tx) + b

Both a and b are specified in protocol paramaters. You can get the latest parameters with Blockfrost using this endpoint:
/epochs/latest/parameters

min_fee_a is the coefficient, while min_fee_b is the constant.
Blockfrost also provides another endpoint for finding the required resources for a given transaction (I don't remember the exact names used in its response, but let's call them memory and steps).
And if you take another look at the protocol parameters, you may notice two other fields: price_mem and price_step. These are, respectively, price increases per memory and cpu steps. Therefore, you can compute your final transaction fee:
fee = fee_for_size + fee_for_execution

where:
fee_for_size      = a * size(tx) + b
fee_for_execution = memory * price_mem + steps * price_step

This only applies if you know your execution units. To find them out, you might want to use Blockfrost endpoint https://docs.blockfrost.io/#tag/Cardano-Utilities/paths/~1utils~1txs~1evaluate/post

Fee calculation is actually pretty simple.
0.155381 + 0.000044 * size
Where size is the transaction size in bytes.
More info

This does not include the Smart Contract fee. The values you used are also subject to change,

answer could be improved by explaining where those numbers come from and be linking the documentation of that process.
This way users can set your comment as an answer

You can use TyphonJs NPM library,
https://docs.strica.io/lib/typhonjs/classes/Transaction.html#getFee


text:
Plutus BuiltinData vs. Data
I am confused about how they relate to each other. At first I thought Data is for offchain use and BuiltinData is for onchain use, but then I saw that that Data is also defined in PlutusCore which surely provides onchain utility. Can somebody give a comprehensive explanation please?

A type corresponding to the Plutus Core builtin equivalent of Data.
The point of this type is to be an opaque equivalent of Data, so as to ensure that it is only used in ways that the compiler can handle.
As such, you should use this type in your on-chain code, and in any data structures that you want to be representable on-chain.
For off-chain usage, there are conversion functions builtinDataToData and dataToBuiltinData, but note that these will not work on-chain.

Source (1)


text:
When will the last ADA be 'mined'
How long until all ada is in circulation? I.e. when will Cardanos circulating supply be 45 billion ada?

Around 2043 the reserve supply will drop below 100 million, meaning most will be in circulation around 2040. Around 2140 the whole reserve supply will be dried up.
You could calculate this yourself, by applying the current monetary policy:

Calculating the 'reserve half life' (that is, the time that it takes
for half of the reserve to be used up) visualizes the impact of
choosing a specific value of ρ over another. This was the subject of
much discussion, and eventually, the value assigned was 0.3%. The
reason why is that mathematical projections showed that a ρ (the fixed
percentage of ada going into the virtual pot every epoch) value of
0.3% would mean a reserve half-life of four to five years. In simple terms, just half of the remaining reserve would be used every four to
five years.
https://docs.cardano.org/explore-cardano/monetary-policy

Other reads:

https://www.linkedin.com/pulse/adanomics-cardano-ada-supply-reserves-rewards-komarovskiy-mba/


text:
Is there other way to submit transaction without running cardano-node on my machine?
I want to use CLI to submit transactions and want to use an alternative tool that isn't cardano-node.

Yes.
You can use the Blockfrost API.
It has a free level that might even meet all your needs.
Using curl you should be able to cook up what you need using the CLI but without the need for a Cardano node.
Here is the doc page for "Submit a Transaction":
https://docs.blockfrost.io/#tag/Cardano-Transactions/paths/~1tx~1submit/post


text:
cabal: Failed to build digest-0.0.1.3
This error came from cabal build all when Building and installing the node on wsl2 windows 10
logged error:
Failed to build digest-0.0.1.3. The failure occurred during the configure
step.
Build log (
/home/wims/.cabal/logs/ghc-8.10.7/digest-0.0.1.3-a20fd23134cb7f40320b9ca3d928b4eb5bd682be662c87ea00d19556ef64fdcb.log
):
Configuring library for digest-0.0.1.3..
cabal-3.6.2.0: Missing dependency on a foreign library:
* Missing (or bad) header file: zlib.h
* Missing (or bad) C library: z
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.

cabal: Failed to build digest-0.0.1.3 (which is required by
test:tx-generator-test from tx-generator-2.2, exe:tx-generator from
tx-generator-2.2 and others). See the build log above for details.

checking this
Tomjaguarpaw
If you're on an Debian-based system (e.g. Ubuntu) then
sudo apt install zlib1g-dev
https://githublab.com/repository/issues/Mikolaj/horde-ad/14

The cause of the problem is right there in the error message
cabal-3.6.2.0: Missing dependency on a foreign library:
 * Missing (or bad) header file: zlib.h
 * Missing (or bad) C library: z

I have not used WSL on Windows but I suspect the solution is similar to the solution on Debian, namely sudo apt install zlib1g zlib1g-dev.

Yes this is linux on windows and when I ran sudo apt install zlib1g zlib1g-dev, it did not work

So what happened when you ran that command?

Sorry for late reply, I have no answer to this. Now I am using Docker Desktop and i do not face that problem. I think there are some lines I was skipping by mistake as all these documentations are not numbered and some installations take time


text:
new node docker image doesn't work
We've started using the 1.35.x node docker images in preparation for Vasil. I always start with the testnet before deploying to production. In our testnet deployment, the new images will not work. While synching with the chain, they hang up. If we restart them, we get a communication error. You can see these below:
Step 1: run node docker image from scratch (all relevant volumes are first deleted)
b8e82085:cardano.node.ChainDB:Notice:35] [2022-08-14 11:41:24.19 UTC] Chain extended, new tip: c7380283205467161f2a587da610ea79b482347ecc9a459f9ecf3030c03e5a6a at slot 63417270
[b8e82085:cardano.node.ChainDB:Error:35] [2022-08-14 11:41:24.48 UTC] Invalid block 708745ea94515b679223a5514e6e6dba068208e5b79780134206f74e1e79e727 at slot 63419637: ExtValidationErrorLedger (HardForkLedgerErrorFromEra S (S (S (S (S (Z (WrapLedgerErr {unwrapLedgerErr = BBodyError (BlockTransitionError [ShelleyInAlonzoPredFail (LedgersFailure (LedgerFailure (UtxowFailure (MalformedScriptWitnesses (fromList [ScriptHash "eee7bfb25cfbbbcd31a1d5d648429ff919430ee5d06d8d056e48d605"])))))])})))))))
[b8e82085:cardano.node.ChainDB:Info:35] [2022-08-14 11:41:24.48 UTC] Valid candidate ce9c9431882310df559099e2bfa3e6eb31c95606d83ffc05568df7f863d4db60 at slot 63419598

We let the system run for 12 hours after that last line. No further activity occured. The node was hung up.
Step 2: restart the docker image
Since the node was hung up, we killed the container and started it up again. We left the volume mounts intact. The node then threw the following after boilerplate initalization:
[973dad53:cardano.node.DnsSubscription:Error:233] [2022-08-14 16:57:26.08 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Application Exception: 3.131.32.242:3001 InvalidBlock (At (Block {blockPointSlot = SlotNo 63419662, blockPointHash = 38dc2f5dbb184b504eda086a5f64c19931a985bf2246b74ed18e796712cff67a})) 708745ea94515b679223a5514e6e6dba068208e5b79780134206f74e1e79e727 (ValidationError (ExtValidationErrorLedger (HardForkLedgerErrorFromEra S (S (S (S (S (Z (WrapLedgerErr {unwrapLedgerErr = BBodyError (BlockTransitionError [ShelleyInAlonzoPredFail (LedgersFailure (LedgerFailure (UtxowFailure (MalformedScriptWitnesses (fromList [ScriptHash "eee7bfb25cfbbbcd31a1d5d648429ff919430ee5d06d8d056e48d605"])))))])})))))))))
[973dad53:cardano.node.ErrorPolicy:Warning:119] [2022-08-14 16:57:26.08 UTC] IP 3.131.32.242:3001 ErrorPolicySuspendPeer (Just (ApplicationExceptionTrace (InvalidBlock (At (Block {blockPointSlot = SlotNo 63419662, blockPointHash = 38dc2f5dbb184b504eda086a5f64c19931a985bf2246b74ed18e796712cff67a})) 708745ea94515b679223a5514e6e6dba068208e5b79780134206f74e1e79e727 (ValidationError (ExtValidationErrorLedger (HardForkLedgerErrorFromEra S (S (S (S (S (Z (WrapLedgerErr {unwrapLedgerErr = BBodyError (BlockTransitionError [ShelleyInAlonzoPredFail (LedgersFailure (LedgerFailure (UtxowFailure (MalformedScriptWitnesses (fromList [ScriptHash "eee7bfb25cfbbbcd31a1d5d648429ff919430ee5d06d8d056e48d605"])))))])})))))))))))) 200s 200s
[973dad53:cardano.node.ChainDB:Info:102] [2022-08-14 16:57:34.32 UTC] Took ledger snapshot DiskSnapshot {dsNumber = 63343083, dsSuffix = Nothing} at 1f46697e362676f795cfe4608217c805bde9830fea2c304381cb6c9853b1a074 at slot 63343083
[973dad53:cardano.node.DnsSubscription:Warning:121] [2022-08-14 16:57:35.78 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Unsupported remote target address [2a05:d014:e00:a202:0:1:0:2]:3001
[973dad53:cardano.node.DnsSubscription:Notice:265] [2022-08-14 16:57:35.78 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt Start, destination 3.131.32.242:3001
[973dad53:cardano.node.DnsSubscription:Warning:121] [2022-08-14 16:57:35.80 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Unsupported remote target address [2a05:d014:e00:a202:0:1:0:3]:3001
[973dad53:cardano.node.DnsSubscription:Notice:266] [2022-08-14 16:57:35.80 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt Start, destination 3.133.220.20:3001
[973dad53:cardano.node.DnsSubscription:Warning:121] [2022-08-14 16:57:35.83 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Unsupported remote target address [2a05:d014:e00:a201:0:1:0:2]:3001
[973dad53:cardano.node.DnsSubscription:Notice:267] [2022-08-14 16:57:35.83 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt Start, destination 54.199.108.71:3001
[973dad53:cardano.node.DnsSubscription:Notice:265] [2022-08-14 16:57:35.83 UTC] Domain: "relays-new.cardano-testnet.iohkdev.io" Connection Attempt End, destination 3.131.32.242:3001 outcome: ConnectSuccessLast
[973dad53:cardano.node.ErrorPolicy:Notice:119] [2022-08-14 16:57:35.83 UTC] IP 3.133.220.20:3001 ErrorPolicySuspendConsumer (Just (ConnectionExceptionTrace (SubscriberError {seType = SubscriberParallelConnectionCancelled, seMessage = "Parallel connection cancelled", seStack = []}))) 1s
[973dad53:cardano.node.ErrorPolicy:Notice:119] [2022-08-14 16:57:35.83 UTC] IP 54.199.108.71:3001 ErrorPolicySuspendConsumer (Just (ConnectionExceptionTrace (SubscriberError {seType = SubscriberParallelConnectionCancelled, seMessage = "Parallel connection cancelled", seStack = []}))) 1s

It seems to be complaining about connection with Cardano relays. This doesn't make sense to us since we if we repeat the above process it will start synchronizing again but eventually fail in the same way which suggests communication with the relays is possible. This machine has a stable internet connection. In fact it's running on the same machine as our production system which is working fine (still on an older version of the docker image).
We have tried 1.35.1 and 1.35.3. They both do the same thing.
These nodes are connected to the testnet.
Does anyone know why we can't get this node running? We're out of ideas for what could be wrong.

We have tried 1.35.1 and 1.35.3.

You should ONLY use node 1.35.2 on testnet. 1.35.1 produced unforeseen invalid block on testnet network, which was fixed on node 1.35.2 and rules updated to discard the invalid blocks (to prevent fork) at node 1.35.3. Thus, the testnet network is in a state where you cannot use 1.35.3 or above, and 1.35.1 would produce invalid blocks.
The only node version that will be usable on that network is 1.35.2. IO have announced they will be moving to new networks (that have already been spun) soon, you can follow those via environments page. As regards docker, I dont use it myself but if these configs are not readily available, you can mount them on.

Would have been nice for the developers who published this image to throw a simple error if you pass the testnet parameter in.

Wanted to reply, and state I have this same error building the 1.35.3 node and cli from source on github
I spent a few hours trying to sort this out as my issues started while I was on 1.35.2.
After hours of updating my system, and rebuilding the node, and re-syncing DB from scratch;
I found this article, appears 1.35.3 won't work for now on testnet???
https://forum.cardano.org/t/upgrading-to-1-35-3-all-3-nodes-down/105926/15
I have another testnet node running 1.35.3 and is up to date????
My actual block producer node is back to 1.35.2 and producing blocks again...

Please note that the docker-compose.yml file on 13.0.4 release of cardano-db-sync pulls the 1.35.3 version of node (https://github.com/input-output-hk/cardano-db-sync/blob/13.0.4/docker-compose.yml) This should be updated to use 1.35.2 if running testnet.


text:
How can I query the version of the node using the APIs?
I want to know the version of a node using API.
I know I can use the CLI to know the version, but can't I use the API?
Any advice would be greatly appreciated!
https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/createByronWalletMigrationPlan

You can't do it with cardano-cli but you can just run:
cardano-node --version

or
cardano-cli --version

without having to stop the node.

Thanks for getting back to me! I need to know the version using an API that can be called externally over the network, is there one? (rest, graphql, etc, excluding cli).

I think you should add a feature request on the cardano-node github repo.


text:
Is function "isPayToScriptOut" unsafe?
As far as i understood, function "isPayToScriptOut" assumes every output that has a datum hash is a script output. But what if we create new output with datum, assigned to some pub key (for example due to use of: "mustPayWithDatumToPubKey" in off-chain code). So our new output wont be related to script one, but "isPayToScriptOut" will return true in this case? Because datum hash can be attached to any transaction. And that makes "isPayToScriptOut" not safe enough for development.
My deductions are correct?
*Here is considered function's code from plutus library:
 -- | Whether the output is a pay-to-script output.
    isPayToScriptOut :: TxOut -> Bool
    isPayToScriptOut = isJust . txOutDatum

    txOutDatum :: TxOut -> Maybe DatumHash
    txOutDatum TxOut{txOutDatumHash} = txOutDatumHash

Your deductions are partially correct. isPayToScriptOut looks at the credentials of an address (1) and return true if it is a script address, false if it is a public key credential. It thus does not look at the datum, it can deterministically check whether an output is made at a script address.
Here comes the crux, currently there are two types of scripts, native scripts and plutus scripts (V1 or V2). This function and the credential data type do not encode or differentiate between these scripts!
So in conclusion, you do know that that address is locked by a script, but you do not know what kind of script it is. It could be a native script locked by just a single public key.
This might change due to this CIP (2). It aims to add a distinction between the types of scripts we have on the ledger.
EDIT
A previous version of plutus indeed did use the datum for this function (3). Note that this haddock host an outdated version of what is available in plutus. I would recommend using a local, up-to-date version. You can build this in the plutus-apps repo by entering a nix-shell and executing build-and-serve-docs.
Luckily, both the new plutus V1 (4) and V2 (5) implementations of these helper functions now implement it via the credentials. But note that the argument about it being unsafe due to not knowing what kind of script belong to a credential still holds.


text:
Plutus Playground Server error: opening lock file '/nix/...root.lock': Permission denied
So I've been going through the Plutus Pioneers 3rd cohort lectures and last night accidentally left my computer unplugged. When I booted up Ubuntu Linux on the computer this morning I noticed I have 3 copies of plutus-apps folders on my computer and I only use one for going in nix-shell and running plutus playground so I deleted the other 2.
I went to set up Plutus-Playground-Server for a new lecture and went through the steps here to get everything set back up again (which have worked fine before since I've set it all up already).
https://plutus-community.readthedocs.io/en/latest/#Plutus/Build/Ubuntu/
In terminal window 1
cd plutus-apps
nix-shell
cd plutus-playground-server
plutus-playground-server

However, I am getting these errors (tried sudo plutus-playground-server as well, didn't work).

I thought maybe there's something that needs updating so I updated all my apps. I noticed my Nix is running on 2.8.1 and now there is 2.10
https://nixos.org/download.html
Tried several ways of updating nix including the methods given in the link, I keep getting these similar permission denied messages. Sudo doesn't work in this instance.
[nix-shell:~/plutus-apps/plutus-playground-client]$ GC_DONT_GC=1 plutus-playground-server
plutus-playground-server: for development use only
error: opening lock file '/nix/store/69h1ik7v55mi947xfn28bwxkvn2fn4z9-plutus-apps-root-plutus-ledger-constraints-lib-plutus-ledger-constraints-root.lock': Permission denied
(use '--show-trace' to show detailed location information)
error: opening lock file '/nix/store/69h1ik7v55mi947xfn28bwxkvn2fn4z9-plutus-apps-root-plutus-ledger-constraints-lib-plutus-ledger-constraints-root.lock': Permission denied
(use '--show-trace' to show detailed location information)
/nix/store/fm77y43lzpgnay4pyc48jwpln0lnmrk3-plutus-playground-server/bin/plutus-playground-server: line 10: /bin/plutus-playground-server: No such file or directory

Just to try everything I tried changing git versions of plutus-apps like you need to do as you go through plutus cohort #3. I did git checkout for different weeks of the plutus pioneer program and i'm getting:
fatal: reference is not a tree

However, the git checkout in plutus-community docs works just fine (but plutus playground server still doesn't work).
https://plutus-community.readthedocs.io/en/latest/#Guides/BuildCabalBuild/
I have restarted my computer as per this link, still getting the same errors.
/bin/plutus-playground-server: No such file or directory
Is this having to do with the new cardano node 1.35.3 and the Vasil upgrade or just a bonehead move on my part? Any help is appreciated, thanks!

Had the same issue yesterday on Mac. GC_DONT_GC=1 did the trick for me.  Maybe restarting nix-daemon will work: sudo pkill nix-daemon & sudo nix-daemon &

I forgot to mention I'm on Ubuntu. I don't think that'll make much of a difference with Mac.
/ When I did sudo pkill nix-daemon & sudo nix-daemon &
/ went into nix-shell in plutus-apps
/ changed directory to plutus-playground-client
/ and ran plutus-playground-server
I have only one error error: opening lock file '/nix/store/69h1ik7v55mi947xfn28bwxkvn2fn4z9-plutus-apps-root-plutus-ledger-constraints-lib-plutus-ledger-constraints-root.lock': Permission denied (use '--show-trace' to show detailed location information)

whereas before I would get the error twice. GC_DONT_GC=1 plutus-playground-server gives same error 2 times just like before, it's not working for me.

Now the next thing I need to figure out is how to enter new lines in comments on stack exchange comments so my replies can look cleaner...

Went back and tried getting it to work today, first went to this link
https://www.punkbit.com/hacking/plutus-developer-environment-setup-on-macos-monterey/#6-run-the-plutus-playground-service-and-frontend
and added in my nix.conf file
build-users-group = nixbld
the playground server still wasn't working so I found someone having a similar github issue with Nix here
https://github.com/NixOS/nix/issues/4356
sudo chown -R "Your User Account Name":staff /nix
afterwards plutus-playground-server worked, no extra GC_DONT_GC=1 needed in my case.
This makes sense because I was getting logged permission errors from nix and this command gives me ownership of nix folder and subdirectories.
2nd terminal with
cd plutus-apps
nix-shell
cd plutus-playground-client
npm run start

is working fine, the plutus playground server is running for me.


text:
Cardano-graphql doesn't return sync percentage
when I first started It was returning the sync percentage, and the logs of cardano-graphql was like this:
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"Server","msg":"Sync Progress: cardano-db-sync: 74.94% | Asset: 196%","time":"2022-08-11T06:50:21.657Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"HasuraClient","assetId":"14a3455f71c435a04ea1fdb50a3ef4c1cab0e79fb1565627ac66a57552415645","msg":"Adding metadata to asset","time":"2022-08-11T06:50:24.142Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"HasuraClient","assetId":"ac485b0065d814e7a984a64e14afc924859033b3171b78a5939cb90559474e46545331","msg":"Adding metadata to asset","time":"2022-08-11T06:50:24.185Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"HasuraClient","assetId":"a32ea58b0d2d0afedddb31dd2e9596c5e3de3451eea207a929574aa4426f62636f696e","msg":"Adding metadata to asset","time":"2022-08-11T06:50:24.235Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"Server","msg":"Sync Progress: cardano-db-sync: 74.94% | Asset: 196%","time":"2022-08-11T06:50:34.399Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"Server","msg":"Sync Progress: cardano-db-sync: 74.94% | Asset: 196%","time":"2022-08-11T06:50:46.357Z","v":0}

However, I had to restart the docker components so I did run docker-compose stop command to stop all and started again right now it doesn't give response instead returns:
curl: (56) Recv failure: Connection reset by peer

and this is the logs of cardano-graphql:
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"Server","msg":"GraphQL HTTP server at http://0.0.0.0:3100/ shutting down","time":"2022-08-11T06:51:47.179Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"Server","msg":"GraphQL HTTP server at http://0.0.0.0:3100/ shutting down","time":"2022-08-11T06:51:47.179Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":50,"err":{"errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"postgres"},"msg":"getaddrinfo ENOTFOUND postgres","time":"2022-08-11T09:30:00.879Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 1","time":"2022-08-11T09:30:00.882Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 2","time":"2022-08-11T09:30:01.385Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 3","time":"2022-08-11T09:30:01.888Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 4","time":"2022-08-11T09:30:02.390Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 5","time":"2022-08-11T09:30:02.892Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 6","time":"2022-08-11T09:30:03.411Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":50,"module":"Db","err":{},"msg":"pgSubscriber","time":"2022-08-11T09:30:03.913Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":50,"err":{"errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"postgres"},"msg":"getaddrinfo ENOTFOUND postgres","time":"2022-08-11T09:30:05.035Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 1","time":"2022-08-11T09:30:05.037Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 2","time":"2022-08-11T09:30:05.540Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 3","time":"2022-08-11T09:30:06.042Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 4","time":"2022-08-11T09:30:06.544Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 5","time":"2022-08-11T09:30:07.051Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 6","time":"2022-08-11T09:30:07.553Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":50,"module":"Db","err":{},"msg":"pgSubscriber","time":"2022-08-11T09:30:08.056Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":50,"err":{"errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"postgres"},"msg":"getaddrinfo ENOTFOUND postgres","time":"2022-08-11T09:30:09.238Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 1","time":"2022-08-11T09:30:09.240Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 2","time":"2022-08-11T09:30:09.747Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 3","time":"2022-08-11T09:30:10.249Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 4","time":"2022-08-11T09:30:10.751Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 5","time":"2022-08-11T09:30:11.253Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 6","time":"2022-08-11T09:30:11.757Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":50,"module":"Db","err":{},"msg":"pgSubscriber","time":"2022-08-11T09:30:12.259Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":50,"err":{"errno":-3008,"code":"ENOTFOUND","syscall":"getaddrinfo","hostname":"postgres"},"msg":"getaddrinfo ENOTFOUND postgres","time":"2022-08-11T09:30:13.589Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 1","time":"2022-08-11T09:30:13.592Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 2","time":"2022-08-11T09:30:14.093Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":40,"module":"Db","msg":"pgSubscriber: Reconnecting attempt 3","time":"2022-08-11T09:30:14.596Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"Server","msg":"Initializing","time":"2022-08-11T09:30:14.625Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"HasuraClient","msg":"Initializing","time":"2022-08-11T09:30:14.875Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"HasuraClient","msg":"Initialized","time":"2022-08-11T09:42:50.345Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"CardanoNodeClient","msg":"Initializing. This can take a few minutes...","time":"2022-08-11T09:42:50.346Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"CardanoNodeClient","msg":"Initialized","time":"2022-08-11T10:31:58.840Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"MetadataFetchClient","msg":"Initializing","time":"2022-08-11T10:31:58.841Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"MetadataFetchClient","msg":"Initialized","time":"2022-08-11T10:31:59.037Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"ChainFollower","msg":"Initializing","time":"2022-08-11T10:31:59.037Z","v":0}
{"name":"cardano-graphql","hostname":"2f8ed0c5755a","pid":1,"level":30,"module":"ChainFollower","msg":"Initialized","time":"2022-08-11T10:31:59.041Z","v":0}

It doesn't display anything else after ChainFollower Initialized. Any help appreciated, thanks in advance.

After waiting till db-sync gets to the latest epoch, I re-started docker container and it works fine.


text:
What does ExtraRedeemers error mean when call function in contract with nami wallet and cardano-serialization
Sometimes I face this issue when make action buy nft in contract. Sometimes it works. So I don't know what does this mean and how to fix it.
transaction submit error ShelleyTxValidationError
ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure
(FromAlonzoUtxowFail (ExtraRedeemers [RdmrPtr Spend 0])),UtxowFailure
(FromAlonzoUtxowFail (MissingRedeemers [(Spending (TxIn (TxId {_unTxId
= SafeHash \"e641e3f78b3f3d32e9f16eec14093a853d1217cacdc6290627d6855d154eaaf0\"})
(TxIx 0)),ScriptHash
\"d85388ecce0a819bb6ee2179566d123b4339d381ca0b09114e7aafd7\")])),
UtxowFailure (UtxoFailure (FromAlonzoUtxoFail (UtxosFailure
(CollectErrors [NoRedeemer (Spending (TxIn (TxId {_unTxId = SafeHash
\"e641e3f78b3f3d32e9f16eec14093a853d1217cacdc6290627d6855d154eaaf0\"})
(TxIx 0)))]))))])

This is how I pass redeemer in txBuilder
 const plutusListRedeemer = CardanoWasm.PlutusList.new();
    plutusListRedeemer.add(CardanoWasm.PlutusData.new_bytes(hexToBytes(resellOrderData._id))); // sell order id
const redeemerData = CardanoWasm.PlutusData.new_constr_plutus_data(      CardanoWasm.ConstrPlutusData.new(CardanoWasm.BigNum.from_str(CONTRACT_CARDANO_EVENT.BUY), plutusListRedeemer),
    );
    const redeemer = CardanoWasm.Redeemer.new(
      CardanoWasm.RedeemerTag.new_spend(),
      CardanoWasm.BigNum.from_str('0'),
      redeemerData,
      CardanoWasm.ExUnits.new(
        CardanoWasm.BigNum.from_str(BUY_CARDANO_MEM.toString()),
        CardanoWasm.BigNum.from_str(BUY_CARDANO_CPU.toString()),
      ),
    );
    redeemers.add(redeemer);
transactionWitnessSet.set_redeemers(redeemers);

Could you share your onchain code that you use? And especially how the custom datum and redeemer are indexed via the following function makeIsDataIndexed? https://playground.plutus.iohkdev.io/doc/haddock/plutus-tx/html/PlutusTx.html#v:makeIsDataIndexed

I dont know what you mean. Is that an error from contract or it's failed from nami wallet

@Fermat Hi, i try with another redeemer index and see sometime 2 work, sometimes 0 workds. Could you plean explain why does that happen and what does redeemer index mean


text:
Preview and Pre-Production Testnet Configs
I'm trying to setup Oura with preview and pre-production testnets. Does anyone know what values to use in the config? Here's the data that I've guessed so far based on the cardano-node config files. Missing shelley_known_slot and shelley_known_time on both assuming the rest is correct. Oura config here for context: https://github.com/txpipe/oura/blob/a559934f772a2e012b514e0567cca0c34770451d/book/src/advanced/custom_network.md
cardano-cli doesn't have any way to query a block hash.
Preview
[chain]
byron_epoch_length = 86400
byron_slot_length = 20000
byron_known_slot = 0
byron_known_hash = "72593f260b66f26bef4fc50b38a8f24d3d3633ad2e854eaf73039eb9402706f1"
byron_known_time = 1660003200
shelley_epoch_length = 432000
shelley_slot_length = 1
shelley_known_slot =
shelley_known_hash = "137fcc090936d258c06dedb5ad5b063c33ed5c4a71a0517b6466415ec83c7e14"
shelley_known_time =
address_hrp = "addr_test2"

Pre-production
byron_epoch_length = 432000
byron_slot_length = 20000
byron_known_slot = 0
byron_known_hash = "d4b8de7a11d929a323373cbab6c1a9bdc931beffff11db111cf9d57356ee1937"
byron_known_time = 1654041600
shelley_epoch_length = 432000
shelley_slot_length = 1
shelley_known_slot =
shelley_known_hash = "90c8bae45d3cb34ef25d84171a74f6e8a4a8f4615fbe289d5a1b21eb6896ac0b"
shelley_known_time =
address_hrp = "addr_test1"

Pre-production:
[chain]
byron_epoch_length = 432000
byron_slot_length = 20
byron_known_slot = 0
byron_known_hash = "9ad7ff320c9cf74e0f5ee78d22a85ce42bb0a487d0506bf60cfb5a91ea4497d2"
byron_known_time = 1654041600
shelley_epoch_length = 432000
shelley_slot_length = 1
shelley_known_slot = 86400
shelley_known_hash = "c4a1595c5cc7a31eda9e544986fe9387af4e3491afe0ca9a80714f01951bbd5c"
shelley_known_time = 1654041600
address_hrp = "addr_test"
adahandle_policy = ""

Preview:
[chain]
byron_epoch_length = 432000
byron_slot_length = 20
byron_known_slot = 0
byron_known_hash = ""
byron_known_time = 1660003200
shelley_epoch_length = 432000
shelley_slot_length = 1
shelley_known_slot = 25260
shelley_known_hash = "cac921895ef5f2e85f7e6e6b51b663ab81b3605cd47d6b6d66e8e785e5c65011"
shelley_known_time = 1660003200
address_hrp = "addr_test"
adahandle_policy = ""

Src: https://github.com/txpipe/oura/issues/381

It would be good to highlight the differences or comment on them in your answer.

All the fields are different from the original post.


text:
How to get information of a certain native token from Cexplorer database?
Given a certain token,for example Sundae, which has
policyID:    9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77

fingerprint: asset1m4u92ke6820pkk07m8qmmguye02ewr8g6tezr0

(https://cardanoassets.com/asset1m4u92ke6820pkk07m8qmmguye02ewr8g6tezr0)
I want to get the information of this token, e.g how many Sundae tokens have been staked,how many Sundae remain in the address of the creator.
To do that,I need to know
(1) the total minted amount of Sundae (in this case 2 millions)
(2) the amount has been released to public (which does not belong to the owners)
(3) the amount remains belonging to the owners
I think I can get (1) by
select multi_asset.name, ma_tx_mint.quantity
from public.multi_asset, public.ma_tx_mint,
where multi_asset.id = ma_tx_mint.ident and
multi_asset.fingerprint = 'asset1m4u92ke6820pkk07m8qmmguye02ewr8g6tezr0'

For (3), at least I can get the address of the creator
select multi_asset.name, ma_tx_mint.quantity, tx.fee, tx.block_id,tx.block_index, tx_out.address, tx_out.value
from public.multi_asset, public.ma_tx_mint, public.tx,public.tx_out
where multi_asset.id = ma_tx_mint.ident and ma_tx_mint.tx_id = tx.id and tx.id = tx_out.tx_id and
multi_asset.fingerprint = 'asset1m4u92ke6820pkk07m8qmmguye02ewr8g6tezr0'

But how to get the remaining amount of Sundae in this address?
For (2),I do not have any idea how to do.
Thanks you very much!

These SQL queries are not quite correct.
For 1):
select multi_asset.name, ma_tx_mint.quantity from multi_asset
  inner join ma_tx_mint on multi_asset.id = ma_tx_mint.ident
  where multi_asset.fingerprint =
  'asset1m4u92ke6820pkk07m8qmmguye02ewr8g6tezr0';
      name      |     quantity
----------------+------------------
 \x53554e444145 | 2000000000000000
(1 row)

For 3) I had to modify this one to use tx.block_no instead of tx.block_id because my database is currently running a new experimental schema:
select multi_asset.name, ma_tx_mint.quantity, tx.fee,
    tx.block_no,tx.block_index, tx_out.address, tx_out.value
  from multi_asset inner join ma_tx_mint on multi_asset.id = ma_tx_mint.ident
    inner join tx on ma_tx_mint.tx_id = tx.id
    inner join tx_out on tx.id = tx_out.tx_id
  where multi_asset.fingerprint =
    'asset1m4u92ke6820pkk07m8qmmguye02ewr8g6tezr0';

      name      |     quantity     |  fee   | block_no | block_index |                          address                           |  value
----------------+------------------+--------+----------+-------------+------------------------------------------------------------+----------
 \x53554e444145 | 2000000000000000 | 684646 |  6766387 |          39 | addr1w9742z4fewans7ry6cjp95pc4ecv7y54cx298lp5qfw7s9gv8ukrj |  2000000
 \x53554e444145 | 2000000000000000 | 684646 |  6766387 |          39 | addr1w9pgj46r4wh80ujlrdf5h6sxuuvfac2wurfnsn4xgqw584sfa966l |  2000000
 \x53554e444145 | 2000000000000000 | 684646 |  6766387 |          39 | addr1w9pgj46r4wh80ujlrdf5h6sxuuvfac2wurfnsn4xgqw584sfa966l |  2000000
 \x53554e444145 | 2000000000000000 | 684646 |  6766387 |          39 | addr1w9pgj46r4wh80ujlrdf5h6sxuuvfac2wurfnsn4xgqw584sfa966l |  2000000
 \x53554e444145 | 2000000000000000 | 684646 |  6766387 |          39 | addr1w9pgj46r4wh80ujlrdf5h6sxuuvfac2wurfnsn4xgqw584sfa966l |  2000000
 \x53554e444145 | 2000000000000000 | 684646 |  6766387 |          39 | addr1w9pgj46r4wh80ujlrdf5h6sxuuvfac2wurfnsn4xgqw584sfa966l |  2000000
 \x53554e444145 | 2000000000000000 | 684646 |  6766387 |          39 | addr1w9pgj46r4wh80ujlrdf5h6sxuuvfac2wurfnsn4xgqw584sfa966l | 12315354
(7 rows)

For 2) I am a little unsure. Were all initial tokens held in a single address? If so, are all transactions containing the relevant mutli-asset from that address to other addresses releases to the public?

Can I use cardano-cli to check the above information, not to use postgres database. Because my database is not fully synced right now, so maybe the result is not right.

I am not aware of cardano-cli being able to provide that information. For db-sync you should wait until it is fully synced before querying it.


text:
strange cabal build behaviour - won't detect changes to code file
This might have something to do with me working in a docker container, that is an ubuntu version of linux, with nix installed and plutus-starter cloned.
I'm currently updating a plutus script I wrote based on an older version of plutus-starter, so I'm trying to update it.
When I go into nix-shell and enter 'cabal build', I get a build error, which is unsurprising because there have been a lot of changes in plutus.
However, if I change the file, either in VS Code on my MacOS host, or using vim inside the nix-shell in the container, and then try 'cabal build' again, I get the exact same error.
Cabal is not reloading the modified file.
If I enter 'cabal repl', at first it shows the same error as 'cabal build' and has not loaded the current version of the file, BUT THEN if I specifically load the file while in cabal repl, it does actually see the change.
Why is 'cabal build' not seeing file changes?
Exiting the nix-shell and going back in does not fix this or refresh the file.
I've noticed that when I edit the file in VS Code, it does not seem to update the last modified time on the file, but using vim inside the container does update the modified time, and cabal build still doesn't see reload it.
Am I missing a ghc or cabal option somewhere?
My next attempt is to try to run my container as a VS Code devcontainer, but I suspect there's something wrong with my cabal set up inside the ubuntu container.
the actual error isn't important, because no matter what nonsense I put in to replace 'Ledger.getDatum', the error is always the same.


text:
Plutus Playground parsing Wallet error: EndpointDecodeContractError
I ran the code from this plutus playground tutorial in the online playground
https://playground.plutus.iohkdev.io/doc/plutus/tutorials/basic-apps.html#
I'm getting this error when entering a number for the recipient wallet:
"...  Contract instance stopped with error: "EndpointDecodeContractError {eeEndpointDescription = EndpointDescription {getEndpointDescription = "unlock"}, eeEndpointValue = EndpointValue {unEndpointValue = Object (fromList [("recipient1Wallet",String "1"),("recipient2Wallet",String "2"),("totalAda",Object (fromList [("getLovelace",Number 5000000.0)]))])}, eeErrorMessage = "Error in $.recipient1Wallet: parsing Wallet.Emulator.Wallet.Wallet(Wallet) failed, expected Object, but encountered String"}" ]"
I also don't see the same fields in the simulation as the screenshot from the tutorial.
This is screenshot from the tutorial simulation

This is what is what my simulation looks like:

There's no "getWallet" text above the wallet fields.
I copied the code directly from the tutorial:
import Playground.Contract
import Control.Monad (void)
import Data.Aeson (FromJSON, ToJSON)
import Data.Text qualified as T
import GHC.Generics (Generic)
import Ledger (Ada, PaymentPubKeyHash (unPaymentPubKeyHash), ScriptContext (ScriptContext, scriptContextTxInfo),
               valuePaidTo)
import Ledger.Ada qualified as Ada
import Ledger.Constraints qualified as Constraints
import Ledger.Typed.Scripts qualified as Scripts
import Plutus.Contract (Contract, Endpoint, Promise, collectFromScript, endpoint, logInfo, selectList,
                        submitTxConstraints, submitTxConstraintsSpending, type (.\/), utxosAt)
import PlutusTx qualified
import PlutusTx.Prelude (Bool, Semigroup ((<>)), ($), (&&), (-), (.), (>=))
import Prelude qualified as Haskell
import Schema (ToSchema)
import Wallet.Emulator.Wallet (Wallet, mockWalletPaymentPubKeyHash)

--  Define data types
data SplitData =
    SplitData
        { recipient1 :: PaymentPubKeyHash -- ^ First recipient of the funds
        , recipient2 :: PaymentPubKeyHash -- ^ Second recipient of the funds
        , amount     :: Ada -- ^ How much Ada we want to lock
        }
    deriving stock (Haskell.Show, Generic)

-- For a 'real' application use 'makeIsDataIndexed' to ensure the output is stable over time
PlutusTx.unstableMakeIsData ''SplitData
PlutusTx.makeLift ''SplitData
----------------------------------------------------------------------------------------------------------------

-- Validator used off chain.  Takes context
validateSplit :: SplitData -> () -> ScriptContext -> Bool
validateSplit SplitData{recipient1, recipient2, amount} _ ScriptContext{scriptContextTxInfo} =
    let half = Ada.divide amount 2 in
    Ada.fromValue (valuePaidTo scriptContextTxInfo (unPaymentPubKeyHash recipient1)) >= half &&
    Ada.fromValue (valuePaidTo scriptContextTxInfo (unPaymentPubKeyHash recipient2)) >= (amount - half)

--boilerplate to compile the validator
data Split
instance Scripts.ValidatorTypes Split where
    type instance RedeemerType Split = ()
    type instance DatumType Split = SplitData

splitValidator :: Scripts.TypedValidator Split
splitValidator = Scripts.mkTypedValidator @Split
    $$(PlutusTx.compile [|| validateSplit ||])
    $$(PlutusTx.compile [|| wrap ||]) where
        wrap = Scripts.wrapValidator @SplitData @()
-----------------------------------------------------------

-- Arguments for endpoints
data LockArgs =
        LockArgs
            { recipient1Wallet :: Wallet
            , recipient2Wallet :: Wallet
            , totalAda         :: Ada
            }
    deriving stock (Haskell.Show, Generic)
    deriving anyclass (ToJSON, FromJSON, ToSchema)
--  defines the endpoints
type SplitSchema =
        Endpoint "lock" LockArgs
        .\/ Endpoint "unlock" LockArgs
------------------------------------------------------------------------

-- Endpoints
lock :: Promise () SplitSchema T.Text ()
lock = endpoint @"lock" (lockFunds . mkSplitData)

unlock :: Promise () SplitSchema T.Text ()
unlock = endpoint @"unlock" (unlockFunds . mkSplitData)
------------------------------------------------------------------------

---   turn the two Wallet values into their public key hashes so that you can get the SplitData value from the input that was supplied by the user.
mkSplitData :: LockArgs -> SplitData
mkSplitData LockArgs{recipient1Wallet, recipient2Wallet, totalAda} =
    SplitData
        { recipient1 = mockWalletPaymentPubKeyHash recipient1Wallet
        , recipient2 = mockWalletPaymentPubKeyHash recipient2Wallet
        , amount = totalAda
        }
---------------------------------------------------------------------------------

-------------  Endpoint Functions ----------------------------------------------------
--  Lock function
lockFunds :: SplitData -> Contract () SplitSchema T.Text ()
lockFunds s@SplitData{amount} = do
    logInfo $ "Locking " <> Haskell.show amount
    let tx = Constraints.mustPayToTheScript s (Ada.toValue amount)  -- tx is transaction
    void $ submitTxConstraints splitValidator tx

-- unlock function
unlockFunds :: SplitData -> Contract () SplitSchema T.Text ()
unlockFunds SplitData{recipient1, recipient2, amount} = do
    let contractAddress = Scripts.validatorAddress splitValidator
    utxos <- utxosAt contractAddress
    let half = Ada.divide amount 2
        tx =
            collectFromScript utxos ()  -- collectFromScript takes the script outputs in unspentOutputs and adds them as input to the transaction, using the unit () as the redeemer.
            <> Constraints.mustPayToPubKey recipient1 (Ada.toValue half)
            <> Constraints.mustPayToPubKey recipient2 (Ada.toValue $ amount - half)
    void $ submitTxConstraintsSpending splitValidator utxos tx
---------------------------------------------------------------------------------

endpoints :: Contract () SplitSchema T.Text ()
endpoints = selectList [lock, unlock]

mkSchemaDefinitions ''SplitSchema
$(mkKnownCurrencies [])

Using the WalletNumber import and a few other changes in the code below fixed it for me, if anybody runs into the same issue.
Surprising that the tutorial on the plutus playground website doesn't work with the plutus playground.
import Playground.Contract
import Control.Monad (void)
import Data.Aeson (FromJSON, ToJSON)
import Data.Text qualified as T
import GHC.Generics (Generic)
import Ledger (Ada, PaymentPubKeyHash (unPaymentPubKeyHash), ScriptContext (ScriptContext, scriptContextTxInfo),
               valuePaidTo)
import Ledger.Ada qualified as Ada
import Ledger.Constraints qualified as Constraints
import Ledger.Typed.Scripts qualified as Scripts
import Plutus.Contract (Contract, Endpoint, Promise, collectFromScript, endpoint, logInfo, selectList,
                        submitTxConstraints, submitTxConstraintsSpending, type (.\/), utxosAt)
import PlutusTx qualified
import PlutusTx.Prelude (Bool, Semigroup ((<>)), ($), (&&), (-), (.), (>=))
import Prelude qualified as Haskell
import Schema (ToSchema)
import Wallet.Emulator.Wallet (Wallet, mockWalletPaymentPubKeyHash)
import Wallet.Emulator.Wallet (fromWalletNumber)
import Ledger.CardanoWallet (WalletNumber (..))

--  Define data types
data SplitData =
    SplitData
        { recipient1 :: PaymentPubKeyHash -- ^ First recipient of the funds
        , recipient2 :: PaymentPubKeyHash -- ^ Second recipient of the funds
        , amount     :: Ada -- ^ How much Ada we want to lock
        }
    deriving stock (Haskell.Show, Generic)

-- For a 'real' application use 'makeIsDataIndexed' to ensure the output is stable over time
PlutusTx.unstableMakeIsData ''SplitData
PlutusTx.makeLift ''SplitData
----------------------------------------------------------------------------------------------------------------

-- Validator used off chain.  Takes context
validateSplit :: SplitData -> () -> ScriptContext -> Bool
validateSplit SplitData{recipient1, recipient2, amount} _ ScriptContext{scriptContextTxInfo} =
    let half = Ada.divide amount 2 in
    Ada.fromValue (valuePaidTo scriptContextTxInfo (unPaymentPubKeyHash recipient1)) >= half &&
    Ada.fromValue (valuePaidTo scriptContextTxInfo (unPaymentPubKeyHash recipient2)) >= (amount - half)

--boilerplate to compile the validator
data Split
instance Scripts.ValidatorTypes Split where
    type instance RedeemerType Split = ()
    type instance DatumType Split = SplitData

splitValidator :: Scripts.TypedValidator Split
splitValidator = Scripts.mkTypedValidator @Split
    $$(PlutusTx.compile [|| validateSplit ||])
    $$(PlutusTx.compile [|| wrap ||]) where
        wrap = Scripts.wrapValidator @SplitData @()
-----------------------------------------------------------

-- Arguments for endpoints
data LockArgs =
        LockArgs
            { recipient1Wallet :: WalletNumber
            , recipient2Wallet :: WalletNumber
            , totalAda         :: Ada
            }
    deriving stock (Haskell.Show, Generic)
    deriving anyclass (ToJSON, FromJSON, ToSchema)
--  defines the endpoints
type SplitSchema =
        Endpoint "lock" LockArgs
        .\/ Endpoint "unlock" LockArgs
------------------------------------------------------------------------

-- Endpoints
lock :: Promise () SplitSchema T.Text ()
lock = endpoint @"lock" (lockFunds . mkSplitData)

unlock :: Promise () SplitSchema T.Text ()
unlock = endpoint @"unlock" (unlockFunds . mkSplitData)
------------------------------------------------------------------------

---   turn the two Wallet values into their public key hashes so that you can get the SplitData value from the input that was supplied by the user.
mkSplitData :: LockArgs -> SplitData
mkSplitData LockArgs{recipient1Wallet, recipient2Wallet, totalAda} =
    SplitData
        { recipient1 = mockWalletPaymentPubKeyHash (fromWalletNumber recipient1Wallet)
        , recipient2 = mockWalletPaymentPubKeyHash (fromWalletNumber recipient2Wallet)
        , amount = totalAda
        }
---------------------------------------------------------------------------------

-------------  Endpoint Functions ----------------------------------------------------
--  Lock function
lockFunds :: SplitData -> Contract () SplitSchema T.Text ()
lockFunds s@SplitData{amount} = do
    logInfo $ "Locking " <> Haskell.show amount
    let tx = Constraints.mustPayToTheScript s (Ada.toValue amount)  -- tx is transaction
    void $ submitTxConstraints splitValidator tx

-- unlock function
unlockFunds :: SplitData -> Contract () SplitSchema T.Text ()
unlockFunds SplitData{recipient1, recipient2, amount} = do
    let contractAddress = Scripts.validatorAddress splitValidator
    utxos <- utxosAt contractAddress
    let half = Ada.divide amount 2
        tx =
            collectFromScript utxos ()  -- collectFromScript takes the script outputs in unspentOutputs and adds them as input to the transaction, using the unit () as the redeemer.
            <> Constraints.mustPayToPubKey recipient1 (Ada.toValue half)
            <> Constraints.mustPayToPubKey recipient2 (Ada.toValue $ amount - half)
    void $ submitTxConstraintsSpending splitValidator utxos tx
---------------------------------------------------------------------------------

endpoints :: Contract () SplitSchema T.Text ()
endpoints = selectList [lock, unlock]

mkSchemaDefinitions ''SplitSchema
$(mkKnownCurrencies [])


text:
Storage requirements for mainnet/testnet cardano nodes?
Does building a Cardano node on testnet takes less storage than mainnet?
If so, what are the approximate storage requirements?

Yes, the testnet takes less storage. This is what I got when I installed them a month ago:

Testnet: 11 GB

Mainnet: 46 GB

I haven't updated it again, but it's roughly around those number

Mainnet sits currently at 77 gb.

Yes, the disk storage for testnet is vastly smaller than for mainnet.
On my machine the mainnet disk storage is 76 Gig. I would be a little surprised if testnet even uses 10 Gig.

Just to surprise you :) , this is on the public testnet:
`$ du -sh cardano-node/db/
14G cardano-node/db/
`

Must be more on that testnet than I thought.


text:
How to download specific cardano-node binary from nixos hydra - https://hydra.iohk.io/
I usually go to https://github.com/input-output-hk/cardano-node/releases and follow the link to download "Hydra binaries" but I want to download version 1.35.2 because 1.35.3 is currently not working on testnet.

How to find version 1.35.2 on https://hydra.iohk.io/ tried with the search but without success?
Is there any connection between Github commits and builds on hydra?

1.35.2 is known to have a bug. Why would you want it for any reason other than testing?

I want to test the newest version but since 1.35.3 is not working on testnet I wanted to use the newest one after that.

In general, there is no good reason to use an older release of cardano-node. However, if you must, you can get it as follows:

First, select the prebuilt binaries for the desired release tag from GitHub. And look for the latest release commit or PR for that version.
Then scroll to the bottom of the page, look for a button that reads "View details", click it, and a list of actions will open.
Select the ci/hydra-eval action and click the "details" link.
You will be redirected to the Hydra evaluation page.
And look for the prebuilt binaries in there. For example, if you wish to download 1.35.2 for Linux, you look for cardano-node-1.35.2-linux, alternatively, if you want 1.35.2 for mac look for cardano-node-1.35.2-macos, and click the table row to go to the build job details.
You will see the direct download link to get a tar.gz file containing the binaries.


text:
Plutus playground not starting with Interpreter error after running :set in GHCI
plutus-playground-server: user error (Error evaluating simulation: InterpreterError (CompilationErrors [CompilationError {filename = "\n/private/tmp/web-ghc-work-1626f2e537d27294/Main.hs", row = 2, column = 1, text = [" error:","    Could not load module \8216Playground.Contract\8217","    It is a member of the hidden package \8216playground-common-0.1.0.0\8217.","    You can run \8216:set -package playground-common\8217 to expose it.","    (Note: this unloads all the modules in the current scope.)","    It is a member of the hidden package \8216playground-common-0.1.0.0\8217.","    You can run \8216:set -package playground-common\8217 to expose it.","    (Note: this unloads all the modules in the current scope.)","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","2 | import Playground.Contract","  | ^^^^^^^^^^^^^^^^^^^^^^^^^^"]},CompilationError {filename = "/private/tmp/web-ghc-work-1626f2e537d27294/Main.hs", row = 3, column = 1, text = [" error:","    Could not load module \8216Plutus.Contract\8217","    It is a member of the hidden package \8216plutus-contract-0.1.0.0\8217.","    You can run \8216:set -package plutus-contract\8217 to expose it.","    (Note: this unloads all the modules in the current scope.)","    It is a member of the hidden package \8216plutus-contract-0.1.0.0\8217.","    You can run \8216:set -package plutus-contract\8217 to expose it.","    (Note: this unloads all the modules in the current scope.)","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","3 | import Plutus.Contract","  | ^^^^^^^^^^^^^^^^^^^^^^"]},CompilationError {filename = "/private/tmp/web-ghc-work-1626f2e537d27294/Main.hs", row = 4, column = 1, text = [" error:","    Could not load module \8216PlutusTx.Prelude\8217","    It is a member of the hidden package \8216plutus-tx-0.1.0.0\8217.","    You can run \8216:set -package plutus-tx\8217 to expose it.","    (Note: this unloads all the modules in the current scope.)","    It is a member of the hidden package \8216plutus-tx-0.1.0.0\8217.","    You can run \8216:set -package plutus-tx\8217 to expose it.","    (Note: this unloads all the modules in the current scope.)","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","4 | import PlutusTx.Prelude","  | ^^^^^^^^^^^^^^^^^^^^^^^"]}]))

I am getting an Interpreter error when trying to start the playground. It happened after I ran :set -package plutus-ledger in ghci. How can I reverse this?

Fixed it by deleting path ~/.ghc/X86_.../environments/default. It was loading this profile by default in ghci


text:
What's the difference between a payment.vkey/payment.skey and a policy.vkey/policy.skey
I am following this tutorial on creating an NFT on the Cardano testnet. The tutorial references a payment.skey and a policy.skey that are needed to build and sign a transaction that creates the NFT on the blockchain.
What is the difference between a payment.skey and policy.skey, and what is the difference between a payment.vkey and policy.vkey? How can I create these from a mnemonic that I have stored on another device?

On blockchains, you generally have verification keys and signing keys, here the verification key is derived from the signing key. These keys allow users to sign transactions to permit actions on the blockchain, like spending funds.
From each verification key, an address can be derived by hashing the verification key and performing some actions on it. These actions include adding a marker to which network the address corresponds to, a testnet (has a magic number associated with each) or mainnet. A transaction that tries to spend from that address is only valid if the signature of the signing key associated with the verification key is present with the transaction. This signing key is thus something that you keep secret!
Your payment.*key pair represent the above construction. The address is derived from the .vkey via the command,
cardano-cli address build \
--payment-verification-key-file payment.vkey \
--out-file payment.addr \
--testnet-magic 1097911063       <--- this is a testnet marker!

Now Cardano has more utility besides simple payment addresses as described above, additionally the ledger supports native assets. These are values that behave just like Ada in that they can capture value, two fields mark them. The first is their policy ID, this is a unique marker that captures how tokens under that policy ID can be minted. More explicitly, similar to the address just discussed, it is derived from the hash of the policy script used. In the tutorial you linked, this script had the following form,
{
  "type": "all",
  "scripts":
  [
   {
     "type": "sig",
     "keyHash": "6d1321490cde0b447794edff9239cf0668ae01f0df33823d0a3bbcf7"
   }
  ]
}

This script allows minting/burning of assets under its policy ID only if the minting transaction has a signature of the signing key associated with the verification key that hashes to 6d132....bbcf7. Now, a step earlier in the tutorial, you generated this pair under the name policy.skey and policy.vkey. These keys are just normal spending keys, and you could derive an address from them. So at its core there is no difference between the pairs payment.*key and policy.*key. The only difference is that the script can only mint assets if the signature of the policy.skey is present in the minting transaction.
In the linked example we indeed see that when the minting transaction is constructed both skey's are present. The payment.skey to spend funds from its address, to pay the fee's of the mint. And the policy.skey to add its signature for a valid execution of the script.
cardano-cli transaction sign \
--signing-key-file payment.skey \
--signing-key-file policy/policy.skey \
--testnet-magic 1097911063 \
--tx-body-file matx.raw \
--out-file matx.signed

Lastly, regarding your last question, can you derive these from a mnemonic? Yes you can, there are multiple ways and languages possible to do this (JS, python, a client and more). For example, consider this packages by IOG (1). And for its documentation, view this link (2). There are some SE questions that go into this.


text:
Get list of holders of a token using Cardano-cli or Cardano-DB-Sync or Ogmios
I am trying to find a way using either Cardano-cli, Ogmios, or Cardano-DB-Sync to get a list of token holders (addresses) for a particularly token, ideally in JSON format.
What is the best way to do this without using an explorer or API like blockfrost?

"List of holders" is rather unclear. If you want names, addresses and other KYC/AML stuff you won't be able to get it. Tokens are held in Cardano addresses, and any person could have more than one address, and given two addresses, there is no general way to validate that the addresses do or do not belong to the same person.
However, you can get all the addresses that hold a particular token from cardano-db-sync with a relatively simple SQL query.

Sorry let me clarify, I am looking for a list of cardano addresses

You can use Koios endpoint documented here, and if you run a dbsync instance, you can find the dbsync query used here


text:
NODE_CONFIG: unbound variable error trying to run inputoutput/cardano-node:1.35.3-new docker container [SOLVED]
I have been trying to set up a docker container running the latest release of Cardano Node to be able to spin up a stake pool operation on Pre-Prod testnet.
I tried using the following command to set this up:
sudo docker run --user 0 -e NETWORK=preprod -v cardano-bpnode-ipc:/ipc -v cardano-bpnode-data:/data -e DATA_DIR=/data -e CARDANO_NODE_SOCKET_PATH=/ipc/node.socket inputoutput/cardano-node:1.35.3-new

NB: I had to force the use of user 0 as a previous issue was that docker was unable to get permissions to create the files within the container on the volumes created for it.
When I tried to run this command to start running my Node I got the following error:
/nix/store/srm7rn76x2db1a6xg0bihz6vngz5a7km-entrypoint/bin/entrypoint: line 228: NODE_CONFIG: unbound variable
I have been attempting to ask on the IOHK Discord for advice on how to handle this error, and have been explicitly referred to Cardano Stackexchange to seek assistance.
So, I am posting the request for assistance here, as I cannot find any mention of this error anywhere else online.
I am hoping someone will be able to point me in the right direction to be able to actually spin up my container.
In fact, I wish to spin up 3. To learn SPO configuration and registration procedures.
Thank you kindly in advance for any support with this issue.

SOLUTION - Requires replacing NETWORK with ENVIRONMENT on the list of options.


text:
What is this address format that the cardano wallet API is returning to me
I am using API.getUsedAddresses in the browser and I am being returned an address unlike the standard addr1..... that I am used to.
If I enter it into cardanoscan, it takes me to the wallet that I would expect, and the different string is displayed just below the main address.
Example of what is returned to me: 0107e8756919dc24322e2c149164b8d24255852fa9a4fcc0bb7155c3c112a080bd4a48b80af3e7f9d980350acd4cc31b70721b410506e867c0
Do I need to convert it to a different base?

It looks like that address is just hex encoded. The address starting with "addr1" is Bech32 encoded.
Where is that API.getUsedAddresses function coming from? Its does not seem to be part of the Haskell API in cardano-api.

That would make sense, thanks! The getUsedAddresses function comes from CIP-30 in the dApp wallet web bridge.


text:
Convert UTxO to hex encoded bytes string
Hello I want to convert a normal UTxO transaction hash to an encoded bytes string. How do I do this? Help would be appreciated!
something like
550665309dee7e2f64d13f999297f001763f65fe50bb05524afc0990c7dce0c3
to
828258205537396d59c1b0546bb9cec5cb6b930238af2d8998d24ca1d47e89a3dd400a8701825839016af9a0d2c9b5bce8999bc6430eb48f424399b73f0ecc143f40e8cac89b130cc3198a8594862fe25df331cb79447304dcd49712c86834fdf1821a00150bd0a1581cb0df0ee7dbb96b18b682a1091514f250eb0ec1122e6c4bf3b4d45123a14b436f6e766963743033363701

I don't understand. The first string you provides is hex encoded.

Would be helpful to also share why you trying to do this and what is your final goal.
This way someone can provide different types of solution related to your question

I think what you are asking is how to convert from base 16 to base 10 which is how a bytestring is stored on the blockchain.  You can take a look at my Deploy.hs code which does this conversion.
https://github.com/lley154/cardano-lottery/blob/main/src/Deploy.hs
Eg.
txIdBS :: B.ByteString
txIdBS = "aa604b873b89ea9e0f430e6c7b9af5d2bf426d88856eff97927e8469a196cdbd"

let some_val = $ decodeHex txIdBS

-- | Decode from hex base 16 to a base 10 bytestring is needed because
--   that is how it is stored in the ledger onchain
where

decodeHex :: B.ByteString -> PlutusPrelude.BuiltinByteString
decodeHex hexBS =
         case getTx of
            Right decHex -> do
                --putStrLn $ "Tx name: " ++ show t
                PlutusPrelude.toBuiltin(decHex)
            Left _ -> do
                --putStrLn $ "No Token name: " ++ show e
                PlutusPrelude.emptyByteString

        where
            getTx :: Either String B.ByteString = B16.decode hexBS