text:
error: suspicious ownership or permission with nix-shell command on plutus-apps repository
Using the nix-shell command in a docker container on GitHub codespaces results in the following error:
$ nix-shell --show-trace
trace: To materialize project.plan-nix for cabal-install entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.
building '/nix/store/q6yfjd9rgb49g5g89x9gqlsv9sv8rs2g-cabal.project.drv'...
error: suspicious ownership or permission on '/nix/store/lzcnjxp2ri40gfy0yysww2vpiac4sng0-cabal.project' for output 'out'; rejecting this build output
error: 1 dependencies of derivation '/nix/store/5hyxv4yfwk8a1jml1cs2yifkxncym1sd-cabal-install-plan-to-nix-pkgs.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gp4k8l89l05jh9a62i6ahdy8h3gfpkng-cabal-install-plan-to-nix-pkgs.drv' failed to build

       … while importing '/nix/store/2wiwkbq968s4l3mg9mal28sxfbsy2xm5-cabal-install-plan-to-nix-pkgs'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/import-and-filter-project.nix:21:13:

           20|   projectSubDir'' = if projectSubDir == "" then "" else projectSubDir + "/"; # With trailing /
           21|   project = import "${projectNix}${projectSubDir'}";
             |             ^
           22| in project // {

       … while evaluating anonymous lambda

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/import-and-filter-project.nix:5:1:

            4| { pkgs, haskellLib }:
            5| { projectNix, sourceRepos, src }:
             | ^
            6| let

       … from call site

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/overlays/haskell.nix:488:27:

          487|               callProjectResults = callCabalProjectToNix args;
          488|               plan-pkgs = importAndFilterProject {
             |                           ^
          489|                 inherit (callProjectResults) projectNix sourceRepos src;

       … while evaluating the attribute 'hsPkgs'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/overlays/haskell.nix:510:43:

          509|               project = addProjectAndPackageAttrs rec {
          510|                   inherit (pkg-set.config) hsPkgs;
             |                                           ^
          511|                   inherit pkg-set;

       … while evaluating the attribute 'hsPkgs'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/overlays/haskell.nix:533:15:

          532|               # Haskell packages
          533|               hsPkgs = final.lib.mapAttrs (packageName: package':
             |               ^
          534|                 if package' == null

       … while evaluating the attribute 'extraPackages.cabal-install.components.exes.cabal'

       at /workspaces/ppp-3/plutus-apps/nix/pkgs/haskell/extra.nix:73:39:

           72|   inherit (hlsProject.hsPkgs) haskell-language-server hie-bios implicit-hie stylish-haskell hlint;
           73|   inherit (cabalInstallProject.hsPkgs) cabal-install;
             |                                       ^
           74|   inherit (cardanoRepoToolProject.hsPkgs) cardano-repo-tool;

       … while evaluating anonymous lambda

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/pkgs/stdenv/generic/make-derivation.nix:145:17:

          144|           (map (drv: drv.__spliced.buildBuild or drv) depsBuildBuild)
          145|           (map (drv: drv.nativeDrv or drv) nativeBuildInputs
             |                 ^
          146|              ++ lib.optional separateDebugInfo' ../../build-support/setup-hooks/separate-debug-info.sh

       … from call site

       … while evaluating 'getOutput'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:486:23:

          485|   */
          486|   getOutput = output: pkg:
             |                       ^
          487|     if pkg.outputUnspecified or false

       … from call site

       … while evaluating the attribute 'nativeBuildInputs' of the derivation 'ghc-shell-for-packages'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/pkgs/stdenv/generic/make-derivation.nix:203:11:

          202|         // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          203|           name =
             |           ^
          204|             let

I was following this guide "Enter a nix-shell"
Nix version 2.5.1
Nix installation for single user

Is this better addressed in: https://github.com/input-output-hk/plutus-pioneer-program/issues

This looks like your /nix/store is somehow corrupted. Without having it hand it's hard to tell what exactly went wrong. You can try:
nix-collect-garbage
nix-shell

hopefully the bad path would be collected and refetched/built.

Thanks @angerman, I did what you told me, but it resulted in the same error


text:
How does a Cardano DApp client authorize a payment?
Am I correct in thinking that this requires a DApp connector on the same device as the User's wallet?
Or could you have an app on the user's device that doesn't connect to their wallet, but somehow authorizes a transaction and sends that digital signature to your Dapp server which is running the PAB, which then submits the Tx?
My guess is it's the former, and the process would work like this:

dapp server sends the dapp client a message containing the
information required to make the Tx

dapp client has off chain code to construct the Tx, either simple Tx or smart contract Tx.

dapp client calls the dapp connector with the Tx, and the dapp connector requests permission from the user

when the user gives permission/enters their spending password, the Tx is submitted to the network by the dapp connector.

Does this sound correct?

That sounds correct. However, you're very flexible in who composes the transaction and who actually submits it to the network.
In general at some point a transaction needs to be signed by the end user's wallet (which holds the private key to your funds) - and this is the step that requires some sort of interface that is the DApp connector (possibly also to identify the user by the public address in the first place).
Regarding the client and server side of DApps, there is no single architecture that fits all use cases.
You can have a setup in which 1) the client passes its public address to the server, which then 2) generates a transaction, 3) passes it to the client for signing; 4) the client passes it (or even only the "signature" for this tx) back to the server for 5) final verification & server-side signing, before the server then 6) submits it to the network.
On the other hand a DApp strictly doesn't need a server at all, and everything could happen on the client side (eg in the browser through a lib like this https://www.npmjs.com/package/@emurgo/cardano-serialization-lib-browser) - you can generate your transactions and submit them to the network through a wallet's dapp connector (eg using Nami wallet https://github.com/Berry-Pool/nami-wallet).
(A transaction is composed of a body, the witness set and optional metadata. The witness set holds the "signatures" of the different parties required to submit the transaction - thats how you can pass these parts around, compose them modularly, store them for later use / server side verifications etc. between clients and server)

source: Stack Exchange

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

sort: votes


text:
Get errors when trying to generate Haddock documentation using build-and-serve-docs
On Windows 10 with WSL2 (Ubuntu)
I go to plutus-apps,
then run nix-shell,
there after I run build-and-serve-docs from within nix-shell
See image for errors..
After build I can access a documentation link but there's no haddock documentation.
I did have a space issue yesterday that prevented some file from being written, is there maybe a way to "clear cache" and rebuild docs ..
Is there maybe another way I can build the haddock docs, or can I access the docs elsewhere?

ck.imgur.com/Rkonl.png

Are you on the right revision for week 1? You can check with git rev-parse HEAD. It should be 4114...5c8a

Yes thanks - checked that - am on commit 41149926c108c71831cfe8d244c83b0ee4bf5c8a

This sounds like corruption due to running out of disk space to me. Can you run nix-collect-garbage -d, re-enter the nix-shell and run that command again?

Bro, it happened to me just now.
It was because I was in the wrong directory
you have to call this from the plutus-apps root directory:
You said you are already at this directory but could you please double check?
This is correct:

[nix-shell:/mnt/c/me/Dev/plutus/plutus-apps]$ build-and-serve-docs

Incorrect:

[nix-shell:/mnt/c/me/Dev/plutus]$ build-and-serve-docs

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


text:
How is wallet balance over epoch computed to calculate staking rewards?
Let's say I have two wallets, each delegated to a different stake pool.
At some point within an epoch I transfer some Ada from one wallet to the other.  What will be the applicable balance which is considered staked by each wallet/pool for that epoch?

At the end of epoch N the balance in your wallet becomes the staked balance for epoch N + 2 and the staking rewards for epoch N + 2 are paid at the start of epoch N + 4.
This avoids the need to lock ADA up for staking and also gives the code enough time to do the required calculations before they are needed.

OK so if I understand correctly, a snapshot approach is used, not an average, and there is also a delay (same delay as per re-delegation).

Above answer is correct, please accept it. Yes, snapshot of stake is always taken on epoch boundary, and is used for block production epoch after snapshot.


text:
Payment eUTxO input come from wallets, but what contains/forges the script eUTx0 inputs?
The person initiating a transaction to start a transaction provides one or more UTxO from their wallet, but where does the script UTxO come from? Does the initiating participant provide a script address for the contract in their wallet and the PAB forges a new UTxO for the transaction? How exactly does that work?

When we think about someone interacting with a script they are either sending a UTXO to the script or spending a UTXO that currently resides at at the script.
I will try to clarify what I think you're not understanding using a DEX as an example: I (the buyer) can create an order on MuesliSwap saying I want to buy a certain token for X ADA by sending a UTXO (that is usually "from my wallet") containing specific data to the MuesliSwap script. Now, that UTXO is locked at the script address. Another user (the seller) can then spend this UTXO that is at the MuesliSwap script address if their transaction meets the requirements that the MuesliSwap contract code enforces, which in this case would be that the buyer receives the token (the seller includes a UTXO containing the token as another input in addition to the UTXO at the script) and sending the seller the X ADA that is locked in the UTXO the buyer sent to the script.
Multiple of these "buyer order UTXOs" can reside at the script address and would impose different requirements on the script validation depending on the data inside them (buyer wants token XYZ for 123 ADA). A seller can choose which UTXO at the script address they wish to spend to in order to complete a trade.
This example shows that sometimes you are spending a UTXO from your wallet to lock it at a script, and other times you are spending a UTXO that someone has sent to the script instead of one from your wallet, depending on the context and what you are trying to do. So when you ask "where does the script UTXO from?", in the example above it would be the UTXO the buyer sent to the script, if I am understanding your question correctly.

As far as I can make out, when the developer of the contract adds the script to the blockchain, it will be via a transaction on the blockchain that outputs the UTxO that has the script address. That UTxO output from the initial transaction is then available as an input in any other transaction that asks to consume it and validates. That validated transaction then, in turn, outputs a new UTxO as the continuation of the script since the initial UTxO is spent/consumed by the validated transaction. Is that the workflow?

I updated my answer a little. In essence, yes - but there it isn't really a notion of the developer "adding the script to the blockchain", more that because they would be the first to know the script address they could be the first to send a UTXO to it. In my example, the buyer's UTXO could be the first UTXO sent to the script address, they just need the script's Plutus code and the script address, so it is not true that the developer would always create the first UTXO at the script. There isn't really a notion of script deployment.

Think of the script address as a mailbox with a lock. Anyone can view and deposit assets into the mailbox (just like any other address on chain). Unlike any other address however, unlocking the funds requires more than just a private key signature.
Rather, it requires that any transaction using a UTXO residing at the script address as an input evaluates to the same script hash specified by the script address. In other words, the only way to spend from a script address is to supply proof (in the form of matching script hashes) that the transaction logic is identical to what was outlined by the creator of the script address.
When spending from a script address, you would reference the desired UTXO input via its Tx-id, just like any other UTXO input.

I understand that part of the transaction and appreciate your response. Unfortunately, my question is badly worded. What I'm trying to understand is the transaction that outputs the initial EUTxO. By definition, the UTxO must be the output of a transaction, and so the question is what is that transaction and who/what generates that transaction to produce the EUTxO with that script address?

If I send you ADA. I create a transaction that consumes one or more UTXOs under my control, and outputs one or more UTXO's to an address that you control. You can then spend your new UTXO's with your private keys. The first half is the same for scripts addresses: anyone can send assets to a script address.
However, in order to spend from the script address, they must construct their transaction such that their script hash evaluates to the same hash as the one defined by the script address. This ensures their transaction behaves in exactly the way intended by the script address's author.


text:
How to make certain script inputs available only to the script iself?
How can I approach a smart contract design that would allow me to encrypt inputs from multiple transactions and allow only the smart contract itself to be able to decrypt this data?
Use case example: the smart contract would run an auction where the bidders can't see each other's offers. Then, only once the auction is finished is the winning offer made public.

This is not possible. Smart contracts cannot know secrets.
But there is another solution for your use case. You need to split the auction into two rounds. In the first round the bidders commit to an offer through a hash of the price (concatenated with a random string). In the second round all bidders disclose their offer (I.e. the concatenated string) and the smart contract can check who is the winner.

Thanks @Jey. This is what I discovered yesterday but I was still waiting someone to answer here just to make sure that really isn't possible to encrypt data on the script for a certain amount of time. Thanks again.

Remember Cardano is a public ledger, so anyone can read the values that are submitted to contracts.
It is possible to blind the data on a redeemer until after a deadline. You could have each submitted redeemer be hashed against a secret only known to the bidder. Once the deadline is passed, each bidder can choose to reveal their secrets, and thus their bids.
This still has a glaring problems though. The bid needs to also lock the funds for the bid (or else someone could just bid a billion ADA and never claim it). Each bidder would need to include more than their bid amount to be locked up, thus blinding the amount as well as giving some wiggle room for the next bidder. This seems less-than-ideal, since it still leaks information about their bid.
You'd need the bidders to lock their funds when they reveal their bid. This prevents a DoS from insincere bidders. Even then, you need to take into account that people might be incentivized to wait as long as possible to reveal their bids. This could create strange game theory.


text:
Which commit in plutus repo should we use for Pioneer Program cohort 3?
As per title, I'm in cohort 3 and trying to follow instructions here:
https://docs.plutus-community.com/docs/setup/MacOS.html
When trying to build the playground, i get the following error:
error: attribute 'plutus-playground' in selection path 'plutus-playground.client' not found
It looks like the playground folders have been moved? There is nothing to compile at HEAD, should I be checking out a previous commit for this cohort?

Andreas Hauser has the right link for the doc shared after the announcement that the webportal is unusable.
https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#
Here are the lines from the doc I believe we are both referring you to...

Download the plutus-apps repository:

git clone https://github.com/input-output-hk/plutus-apps

Go to the latest commit of the repository:

git checkout 7f53f18dfc788bf6aa929f47d840efa1247e11fd
Be sure to do step 2 in your newly cloned repo dir. Then run the nix-shell. That will take a bit the first time.
A successful commit will result in something like this on your console...
~/plutus-apps$ git checkout 7f53f18dfc788bf6aa929f47d840efa1247e11fd
M       plutus-playground-client/package-lock.json
Note: switching to '7f53f18dfc788bf6aa929f47d840efa1247e11fd'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 7f53f18df Bump hls to 1.5.1 #209 (#232)

I hope that is helpful!
If someone sees an error in my answer, please correct me...and thanks!

The Google Doc link provided in the Pioneer Program announcement states 7f53f18dfc788bf6aa929f47d840efa1247e11fd.

Which docs specify this commit?

The Google Doc from the announcement.

As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Here you can find the document:
https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit

The document you mentioned: https://docs.plutus-community.com/docs/setup/MacOS.html is outdated as they have separated plutus-playground logic from plutus-core.
You can find plutus-playground related stuff in another repo:
https://github.com/input-output-hk/plutus-apps


text:
(Solved) Error building Plutus Application Framework
I am trying to build the Plutus Application Framework. I'm running on Archlinux and both Nix and cabal are installed properly as far as I can tell. I have also set the IOHK Binary Caches.
However when I run:
nix --extra-experimental-features nix-command build -f default.nix plutus-apps.haskell.packages.plutus-pab.components.library

I get these errors:
...
error: 1 dependencies of derivation '/nix/store/rybllmjs40pk0b3fnvfd4hn1r37pi81a-yaml-lib-yaml-0.11.7.0-ghc-8.10.4.20210212-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/q93ricp61fyv11nncqqsc1lqijafcj6l-zlib-bindings-lib-zlib-bindings-0.1.1.5-config.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ljdx0lff52b88gysr3zx737lk4vinh8a-zlib-bindings-lib-zlib-bindings-0.1.1.5-ghc-8.10.4.20210212-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/39qxl421bhkzks2zrra7vy3yl6qqhsib-zlib-lib-zlib-0.6.2.3-config.drv' failed to build
error: 1 dependencies of derivation '/nix/store/d121pfapibndwaxhfinb725ahdmkfvpy-zlib-lib-zlib-0.6.2.3-config.drv' failed to build
error: 1 dependencies of derivation '/nix/store/s7h4anc03c53vmn5lv58b1rnj23l39z6-zlib-lib-zlib-0.6.2.3-ghc-8.10.4.20210212-env.drv' failed to build
...
I am new to all this and would like to know what I'm missing. Any solution will be highly appreciated.

Never mind. I figured out you have to run the command as root. My issue now is I am flagged I don't have enough space in my root partition. Luckily I already have a new drive so I will come back to the question if I still get an error once I've migrated to the new drive.

Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

I transferred my system to a bigger drive. I can confirm running the command as root went without a problem. So I now have a local plutus framework installation. Marked as solved.


text:
cabal fails to build plutus-core
When installing plutus starter on a Mac M1 running macOS 12.1 Monterey, the command cabal build logs the following error, even after updating cabal:
Failed to build plutus-core-0.1.0.0.
Build log (
/Users/dlindberg/.cabal/logs/ghc-8.10.7/plts-cr-0.1.0.0-63317e8e.log ):
Configuring library for plutus-core-0.1.0.0..
Preprocessing library for plutus-core-0.1.0.0..
Building library for plutus-core-0.1.0.0..
[  1 of 197] Compiling Crypto           ( plutus-core/src/Crypto.hs, dist/build/Crypto.o, dist/build/Crypto.dyn_o )
[  2 of 197] Compiling Data.Aeson.Flatten ( plutus-core/src/Data/Aeson/Flatten.hs, dist/build/Data/Aeson/Flatten.o, dist/build/Data/Aeson/Flatten.dyn_o )
[  3 of 197] Compiling Data.Aeson.THReader ( plutus-core/src/Data/Aeson/THReader.hs, dist/build/Data/Aeson/THReader.o, dist/build/Data/Aeson/THReader.dyn_o )
[  4 of 197] Compiling Data.ByteString.Hash ( plutus-core/src/Data/ByteString/Hash.hs, dist/build/Data/ByteString/Hash.o, dist/build/Data/ByteString/Hash.dyn_o )
[  5 of 197] Compiling Data.SatInt      ( plutus-core/src/Data/SatInt.hs, dist/build/Data/SatInt.o, dist/build/Data/SatInt.dyn_o )
[  6 of 197] Compiling ErrorCode        ( common/ErrorCode.hs, dist/build/ErrorCode.o, dist/build/ErrorCode.dyn_o )
[  7 of 197] Compiling PlutusCore.Constant.Dynamic.Emit ( plutus-core/src/PlutusCore/Constant/Dynamic/Emit.hs, dist/build/PlutusCore/Constant/Dynamic/Emit.o, dist/build/PlutusCore/Constant/Dynamic/Emit.dyn_o )
[  8 of 197] Compiling PlutusCore.Data  ( plutus-core/src/PlutusCore/Data.hs, dist/build/PlutusCore/Data.o, dist/build/PlutusCore/Data.dyn_o )
[  9 of 197] Compiling PlutusCore.DataFilePaths ( plutus-core/src/PlutusCore/DataFilePaths.hs, dist/build/PlutusCore/DataFilePaths.o, dist/build/PlutusCore/DataFilePaths.dyn_o )
[ 10 of 197] Compiling PlutusCore.Pretty.ConfigName ( plutus-core/src/PlutusCore/Pretty/ConfigName.hs, dist/build/PlutusCore/Pretty/ConfigName.o, dist/build/PlutusCore/Pretty/ConfigName.dyn_o )
[ 11 of 197] Compiling PlutusPrelude    ( prelude/PlutusPrelude.hs, dist/build/PlutusPrelude.o, dist/build/PlutusPrelude.dyn_o )
[ 12 of 197] Compiling PlutusCore.Pretty.Utils ( plutus-core/src/PlutusCore/Pretty/Utils.hs, dist/build/PlutusCore/Pretty/Utils.o, dist/build/PlutusCore/Pretty/Utils.dyn_o )
[ 13 of 197] Compiling PlutusCore.Pretty.Readable ( plutus-core/src/PlutusCore/Pretty/Readable.hs, dist/build/PlutusCore/Pretty/Readable.o, dist/build/PlutusCore/Pretty/Readable.dyn_o )
<command line>: dlopen(/Users/dlindberg/.cabal/store/ghc-8.10.7/lib/libHScrdn-crypt-clss-2.0.0-65075d2b-ghc8.10.7.dylib, 0x0005): symbol not found in flat namespace '_crypto_generichash_blake2b'

Failed to build small-steps-test-0.1.0.0.
Build log (
/Users/dlindberg/.cabal/logs/ghc-8.10.7/smll-stps-tst-0.1.0.0-5d2f50de.log ):
Configuring library for small-steps-test-0.1.0.0..
Preprocessing library for small-steps-test-0.1.0.0..
Building library for small-steps-test-0.1.0.0..
[1 of 5] Compiling Control.State.Transition.Trace ( src/Control/State/Transition/Trace.hs, dist/build/Control/State/Transition/Trace.o, dist/build/Control/State/Transition/Trace.dyn_o )
<command line>: dlopen(/Users/dlindberg/.cabal/store/ghc-8.10.7/lib/libHScrdn-crypt-clss-2.0.0-65075d2b-ghc8.10.7.dylib, 0x0005): symbol not found in flat namespace '_crypto_generichash_blake2b'
cabal: Failed to build plutus-core-0.1.0.0 (which is required by
test:plutus-example-projects-test from plutus-starter-0.1.0.0 and
exe:plutus-starter-pab from plutus-starter-0.1.0.0). See the build log above
for details.
Failed to build small-steps-test-0.1.0.0 (which is required by
exe:plutus-starter-pab from plutus-starter-0.1.0.0 and
test:plutus-example-projects-test from plutus-starter-0.1.0.0). See the build
log above for details.

are you using nix?

Issue solved by following the detailed instructions for Mac M1 installation at  https://github.com/renzwo/cardano-plutus-apps-install-m1

Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.


text:
Normal buildtime for "nix-build -A plutus-playground.server"
How long should the following build normaly take, when the correct "IOHK binary cache" is set at "nix.conf"?
nix-build -A plutus-playground.server

For me it took roughly 2-4 hours on virtual box but it really depends on what environment your setting it up in. For example a virtual box will take much longer than a computer running on Linux or a wsl instance.
Overall expect to wait 30 min - 4h.

I had luck and on my WSL2 "Ubuntu 20.04" Machine the build finished after approximately 30 Minutes.
→ The first "nix-shell" calls also take some times, but therefore the recalls finishes quick.

For me it's as follows:
nix-build -A plutus-playground.server -> 262s
nix-build -A plutus-playground.client -> 25s
nix-shell                             -> 1715s
This is after properly setting all the IOHK caches correctly.

Welcome to Cardano SE! As a new user be sure to take the [Tour].


text:
nix-build -A plutus-pab? Where do you run this?
I'm following this environment setup guide
https://docs.plutus-community.com/docs/setup/WindowsWSL.html
nix-build -A plutus-pab
error: attribute 'plutus-pab' in selection path 'plutus-pab' not found
I tried in /plutus, /plutus-apps, /plutus-starter.  I get this error for each.
error: attribute 'plutus-pab' in selection path 'plutus-pab' not found

I think you don't need to build plutus-pab dependency, if you already have nix installed you can also follow the steps written here.

Try this:
cd into plutus-apps folder
$ nix-build default.nix -A plutus-apps.haskell.packages.plutus-pab
then reboot. seemed to work for me.

(macOS Catalina) I found that executing the

nix-build -A plutus-pab

in bash (rather than zsh) allowed for a successful build at that point. I don't know why or if this is reproducible.
Also, I suggest running

cd plutus
git pull
cd ../plutus-apps
git pull

before doing any builds.


text:
Building Plutus-apps on Mac M1
I am in the 3rd pioneers cohort, going through the env setup. I have Mac M1 with Monterey. I installed nix and added config for the caches etc as recommended here: https://github.com/input-output-hk/plutus-apps#nix-on-macos
When I run "nix-build -A plutus-playground.server", it ends with:

unpacking source archive
/private/tmp/nix-build-source.drv-0/f089a6f090cdb35fcf95f865fc6a31ba6b3ac4eb.tar.gz
error: attribute 'aarch64-darwin' missing
   at /nix/store/cyfj6bd0n0ckvkm67mhjyg1qcvrfgsg9-source/artifact.nix:11:10:

       10| let
       11|   host = hosts.${stdenv.targetPlatform.system};
         |          ^
       12| (use '--show-trace' to show detailed location information)

has anyone managed to build and run the Plutus playground on M1 Mac ?

This guide worked to get me past the server build: https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md

We do not currently have native support for aarch64-darwin (macOS on Apple Silicon chips). I expect this will come throughout the year. For now please use rosetta2. We also do not have caches for aarch64-darwin yet.
Try to pass the system string to nix like so:
$ nix-build -A plutus-playground.server --argstr system x86_64-darwin

Hi @angerman, thanks for the answer. I am getting segmentation fault when I run it  with the additional parameter:
unpacking source archive /private/tmp/nix-build-source.drv-0/c8c5e6a6fbb12a73598d1a434984a36e880ce3cf.tar.gz
zsh: segmentation fault  nix-build -A plutus-playground.server --argstr system x86_64-darwin

Did you by any chance have sandbox = true in your nix config?

Apple M1 seems to be supported meanwhile. This finally worked for me:
$ git clone https://github.com/input-output-hk/plutus-apps
$ cabal update
$ nix-build -A plutus-playground.server
$ nix-build -A plutus-playground.client
$ nix-shell

Any additional nix configs especially for mac/m1 needed before you ran these commands @Dirk?


text:
cabal: Could not resolve dependencies:plutus-core:happy:exe.happy
In the VS Code Docker Env setup on a Mac. I opened the starter project in the container. Ran cabal build in VS Terminal with devcontainer prompt.
Warning: Requested index-state 2021-08-14T00:00:00Z is newer than
'hackage.haskell.org'! Falling back to older state ().
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: plutus-core-0.1.0.0 (user goal)
[__1] unknown package: plutus-core:happy:exe.happy (dependency of plutus-core)
[__1] fail (backjumping, conflict set: plutus-core, plutus-core:happy:exe.happy)

After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: plutus-core,
plutus-core:happy:exe.happy
I get the same error with all the starter-pap commands

The line Falling back to older state () means you probably need to run cabal update first (which downloads a copy of the current hackage index state).

After running cabal update, cabal build was killed because a process used too much memory. I increased Docker memory to 3GB
Failed to build iohk-monitoring-0.2.0.0 (which is required by
exe:plutus-starter-pab from plutus-starter-0.1.0.0 and
test:plutus-example-projects-test from plutus-starter-0.1.0.0). The build
process was killed (i.e. SIGKILL). The typical reason for this is that there
is not enough memory available (e.g. the OS killed a process using lots of
memory).

You will need at least 8G of RAM (including swap).


text:
cabal build Out of Memory Mac VS Code Docker
This is a follow up to my previous cabal build problem. I ran cabal update. Then cabal build was killed. I tried increasing Docker memory from 2GB to 3GB. My old Mac has 8GB, Activity Monitor peaked at 6.7GB
Completed ouroboros-network-framework-0.1.0.0 (lib)
cabal: Failed to build cardano-crypto-class-2.0.0 (which is required by
exe:plutus-starter-pab from plutus-starter-0.1.0.0 and
test:plutus-example-projects-test from plutus-starter-0.1.0.0). The build
process was killed (i.e. SIGKILL). The typical reason for this is that there
is not enough memory available (e.g. the OS killed a process using lots of
memory).
Failed to build iohk-monitoring-0.2.0.0 (which is required by
exe:plutus-starter-pab from plutus-starter-0.1.0.0 and
test:plutus-example-projects-test from plutus-starter-0.1.0.0). The build
process was killed (i.e. SIGKILL). The typical reason for this is that there
is not enough memory available (e.g. the OS killed a process using lots of
memory).

You will not be able to build this in less than 8G of RAM. Adding swap to make the total memory at least 8G may help.


text:
Nix is building ghc during on nix build command (How to fix the cache?)
I'm preparing the Plutus Pioneer program and installing the environment.
After installing nix and updating the "IOHK binary cache", I tried to do nix build but it seems that it is building and compiling ghc as shown below and it takes a very long time.
MyMac$ nix build -f default.nix plutus.haskell.packages.plutus-core
trace: To materialize project.plan-nix for Agda entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.
[1/1/619 built] building ghc-8.6.5 (buildPhase): clang-7: warning: argument unu

Current nix.conf
substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

sandbox = true
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
extra-experimental-features = nix-command
build-users-group = nixbld

I found the following warning message:

If you want to use Nix with this project, make sure to set up the IOHK
binary cache. If you do not do this, you will end up building GHC,
which takes several hours. If you find yourself building GHC, STOP and
fix the cache.

Could you guide me how I can fix the cache?
Thanks in advance.

Is this on an m1 Mac? Binary cache doesn't have Mac arm binaries.

Thanks for your comment, please see below spec of mine. (1.1 GHz Intel Core M, MacBook (Retina, 12-inch, Early 2015) it is a little older one. I've remove all nix installation and install again, found something different log as below but still it is trying to building ghc-8.6.5

MyMac$ nix build -f default.nix docs.site
[1/3/4 built, 134 copied (207.2 MiB), 185.9 MiB DL] building old-ghc-nix: : [1/3/4 built, 134 copied (207.2 MiB), 185.9 MiB DL] building old-ghc-nix: [1/3/4 built, 134 copied (207.2 MiB), 185.9 MiB DL] building old-ghc-nix: trace: To materialize project.plan-nix for Agda entirely, pass a writable path as the materialized argument and run the 'updateMaterialized' script in 'passthru'.
[1/109/730 built, 434 copied (1193.3 MiB), 438.4 MiB DL] building ghc-8.6.5
(buildPhase): "inplace/bin/ghc-stage1" -hisuf p_hi -osuf  p_

I also saw warning: ignoring untrusted substituter 'https://hydra.iohk.io' with Nix in multi-user mode. It was fixed by specifying these substituters in /etc/nix/nix.conf rather than ~/.config/nix/nix.conf. It appears Nix reads both of these configuration files, but does not trust the substituters in the latter.

It may be the case that you edited your nix.conf file after you launched nix-daemon.
You would need to kill and start the daemon again to pick up the updated nix.conf:

$ sudo pkill nix-daemon

and then

$ sudo nix-daemon &

After that. Your non-root user will use substitutes.
source: https://docs.cachix.org/faq#why-is-nix-not-picking-up-on-any-of-the-pre-built-artifacts

Welcome to Cardano SE! As a new user be sure to take the [Tour].

Thanks for your comments. I tried to solve this issue with various way so anyway I could solve this issue. But I'm not sure what make it run. anyway thanks for your help.

If your systems uses systemd to run services you can restart the daemon using
sudo systemctrl restart nix-daemon.service


text:
Lessons Learned setting up plutus-playground - feedback welcome
I have finally got the plutus-playground running on 2 separate machines. Each machine is a Mac running Catalina 10.15.7.
After extensive trial and error (some self inflicted) I have identified several points of confusion in the instructions provided, and other tips and suggestions. I hope this is helpful.
There are 3 installation instructions I drew from. None appear to be completely correct.

https://docs.plutus-community.com/docs/setup/MacOS.html
https://tutorials.cardanoacademy.io/plutus-pioneer-program/setting-up-plutus-playground/installing-nix
https://www.reddit.com/r/cardano/comments/mmzut6/macos_plutus_playground_build_instructions/

So here is what I learned.

Anywhere you are advised to restart your machine, DO restart your machine. Anywhere you are advised to exit your shell, restart your machine. Ten extra reboots is easier than an unwanted GHC build or a nix-shell fail.
After installing Nix, and after restarting your machine, I suggest running these 3 commands to confirm with a modicum of comfort that all is well.

nix doctor --verbose
nix --version
nix --help > nix_help.txt

That last one is to retain the help for later review.
The client and server files are NOT in

https://github.com/input-output-hk/plutus

but are instead in

https://github.com/input-output-hk/plutus-apps

Thank you to nyk and ironhand89 for pointing this out.
BOTH repositories should be cloned to your local directory, as follows:

git clone https://github.com/input-output-hk/plutus.git
git clone https://github.com/input-output-hk/plutus-apps.git

In addition, I found that then running git pull from within each directory helped. There was a 4-6 hour gap from when I cloned to when I ... did more, so maybe some files were updated during that time.

cd plutus
git pull
cd ../plutus-apps
git pull

It seems that certain things that failed when invoked from zsh worked correctly when invoked from bash. This especially seems to have gotten me past the

[$] nix-build -A plutus-pab

roadblock. I suggest doing all of this work in bash.
I needed to invoke this before I found joy:

cd plutus-apps
git checkout 3746610e53654a1167aeb4c6294c6096d16b0502

I found this command at

https://tutorials.cardanoacademy.io/plutus-pioneer-program/setting-up-plutus-playground/cloning-plutus-repository

I suspect this gave me an outdated version, but it seemed to be necessary. Any insight is welcome here.
I ended up editing /etc/nix/nix.conf to have this content (note: this includes the "IOHK binary caches" and double check where the line breaks should or shouldn't be):

build-users-group = nixbld
substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
sandbox = true
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
experimental-features = nix-command
extra-experimental-features = flakes

Some of these were based on error messages I got along the way. Any insight from more knowledgeable people is welcome. And RESTART after configuring nix.conf.
When you are ready to invoke nix-shell, WAIT! Pause. Ask yourself if everything else has been set up. Restart your machine. Be certain you are in the correct (cloned repository) directory plutus-apps/. Every time you invoke nix-shell in a different directory you can kiss an hour of your life goodbye and chew up 10GB of hard drive space (which would have cost $3 million in 1983). Pause, take a breath, treat nix-shell like a career decision.
Do not build Haskell from scratch! You will know this is happening if you see a bunch of filenames flashing by with hask, cabal, or .hs in them. Hit ctrl-C ( or command-. which is command and period together ), restart your machine, pause as above, and try again.
I added this to .zshrc but since I switched to bash I don't know if it was necessary.

source /nix/var/nix/profiles/default/etc/profile.d/nix.sh

I appreciate that a lot of effort has gone into this but this is not a site for user guides.  Please take a look at this article -> [help/dont-ask]

I saw the following settings for the nix.conf file instead (in addition to the IOHK binary caches)

sandbox = false
use-sqlite-wal = false
system-features = kvm

Source:
https://docs.plutus-community.com/docs/setup/WindowsCohort2.html

Ill check what's that sandbox param

also, I guess that build-users-group = nixbld is not needed in wsl environment

Welcome to Cardano SE! As a new user be sure to take the [Tour].


text:
Errors when starting plutus-playground.server
I have built, run, compiled, simulated, and evaluated on my local nix server/client env. I am running Ubuntu 21.04, Kernal 5.11.0-46lowlatency.
Here is the terminal output:
[Info] Running: (Nothing,Webserver {_port = 8080, _maxInterpretationTime = 80s})
Initializing Context
Initializing Context
Warning: GITHUB_CLIENT_ID not set
Warning: GITHUB_CLIENT_SECRET not set
Warning: JWT_SIGNATURE not set

Interpreter ready

I actually already asked about the GitHub ID in another question, but am looking for guidance on the JWT_SIGNATURE setting indicated in t he last warning line before Interpreter ready statement.
Or, am I missing something more obvious than that, like the (Nothing,Webserver{...}) statement in line 1?
Thank you for any help in advance!!

I have got the same warning when running the plutus-playground-server locally. You should be able to use the Playground despite there is a warning. I think this is only needed if the playground will be deployed somewhere and you want to offer a Login via Github Open Auth flow.

Thank you for the quick response, Marco.

As Marco writes, this is fine. The (Nothing,Webserver { ... }) line is just informative. The warnings are also of informative value only and do not constitute an actual error.


text:
Error running plutus-playground-client in Linux
I have successfully installed nix, cabal and have setup the IOHK binary cache. I cloned the plutus-app repository and successfully built the Haskell packages and other artifacts with nix. Then running nix-shell successfully I get into the nix-shell prompt:
[nix-shell:/home/datapool/plutus-apps]$

I then issue the following commands:
[nix-shell:/home/datapool/plutus-apps]$ cd plutus-playground-client
[nix-shell:/home/datapool/plutus-apps/plutus-playground-client]$ npm run start

I then get this output:
> plutus-playground-client@1.0.0 start /home/datapool/plutus-apps/plutus-playground-client
> plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev

 /nix/store/ry2hywgh6cmmm9d5b9566nxdskd752yc-plutus-playground-generate-purs/bin/plutus-playground-generate-purs: line 6: /bin/plutus-playground-server: No such file or directory
 npm ERR! code ELIFECYCLE
 npm ERR! syscall spawn
 npm ERR! file sh
 npm ERR! errno ENOENT
 npm ERR! plutus-playground-client@1.0.0 start: `plutus-playground-generate-purs &&
 npm install && npm run install:spago && npm run build:webpack:dev`
 npm ERR! spawn ENOENT
 npm ERR!
 npm ERR! Failed at the plutus-playground-client@1.0.0 start script.
 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 npm ERR! A complete log of this run can be found in:
 npm ERR!     /home/brightchip/.npm/_logs/2022-01-12T13_05_31_245Z-debug.log

As the output says, it seems to be looking for a non-existent /bin/plutus-playground-server.
Same problem when I run the server:
[nix-shell:/home/datapool/plutus-apps/plutus-playground-client]$ plutus-playground-server
plutus-playground-server: for development use only
/nix/store/fm77y43lzpgnay4pyc48jwpln0lnmrk3-plutus-playground-server/bin/plutus-playground-server: line 10: /bin/plutus-playground-server: No such file or directory

Any idea what I might be missing or how to debug?

Looks related to an issue I ran into where the directories were missing.
I needed to git checkout a patch.
Possible solution - https://cardano.stackexchange.com/a/6251/6004
The instructions are at :
https://tutorials.cardanoacademy.io/plutus-pioneer-program/setting-up-plutus-playground/cloning-plutus-repository

Thanks. The patch works:
git checkout 3746610e53654a1167aeb4c6294c6096d16b0502

I don't know exactly why, but doing this fixed it for me:
# In the plutus-apps folder
GC_DONT_GC=1 nix-build ./default.nix -A plutus-apps.haskell.packages.plutus-playground-server.components.exes.plutus-playground-server
# That will build a bash script somewhere (in store)
# edit that file located in this path:
whereis plutus-playground-server
# replace subshell (in Line 10) with the path from last nix-build command
# edit the file from this path: /nix/store/*-plutus-playground-generate-purs/bin/plutus-playground-generate-purs
# replace subshell (in Line 6) with the path from last nix-build command
cd plutus-playground-client
nix-shell
plutus-playground-server

Source: https://github.com/NixOS/nix/issues/4246#issuecomment-738888246


text:
Error attribute 'alex' missing when building in parallels on Mac
I am getting this error when building Plutus-apps on Ubuntu 20.04 in Parallels on Mac M1:
    trace: WARNING: 8.8.2 is out of date, consider using 8.8.4.
    error: attribute 'alex' missing

    at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/overlays/haskell.nix:554:34:

      553|                             then components.library
      554|                             else components.${haskellLib.prefixComponent.${builtins.elemAt m 0}}.${builtins.elemAt m 1};
         |                                  ^
      555|

I found this post which seems to have the same problem but it didn't help much in resolving it: https://issueexplorer.com/issue/input-output-hk/haskell.nix/1189

I solved this by cleaning nix install and starting from scratch following: https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md
I am still getting one issue at the last step (starting Plutus client) but that is a different issue.

This issue has already been filed with the plutus-apps project. According to the feedback nix-build should be called with --argstr system x86_64-darwin to use rosetta - as ARM isn't supported yet.


text:
Building PAB error: attribute 'plutus-pab' in selection path 'plutus-pab' not found
I am following https://docs.plutus-community.com/docs/setup/MacOS.html
I know the plutus-apps repo is newer than those docs and have downloaded it but it seems I can't build plutus-pab.
When I run
$ nix-build -A plutus-pab
I get:
error: attribute 'plutus-pab' in selection path 'plutus-pab' not found
I thought I had built everything but when I tried to run $ npm run start in plutus-playground-client I got this:
sh: line 1: plutus-playground-generate-purs: command not found

I may need to build https://github.com/input-output-hk/plutus-apps/tree/main/plutus-pab-executables but when i try $ nix-build ../default.nix -A plutus-apps.haskell.packages.plutus-pab I get Segmentation fault: 11

Was able to run $nix-build default.nix -A plutus-apps.haskell.packages.plutus-pab from within nix-shell. Seems like it worked, but main problem still not resolved.

After a reboot, this issue seems to have resolved itself. Unfortunately I'm not sure what I did. Playground client now runs, though I cannot compile the hello world sample. On to tackling next error...

To build needed:
$ nix-build ../default.nix -A plutus-apps.haskell.packages.plutus-pab
in top level of plutus-apps folder.
in plutus-apps/plutus-pab-executables


text:
How to generate a verifiable Proof-of-Burn address
I need to generate a Proof-of-Burn address for a project I'm working on.
I'm almost sure I can generate a valid "unspendable" address myself but I don't know how to make it verifiable and if there is a verified utility that can generate such an address.
I tried to read and understand this:
https://iohk.io/en/research/library/papers/proof-of-burn
This is a nice read, but I'm not sure I can fully understand any aspect of it.
For example this simple script I made create what I think is an "unspendable" address:
$ bech32 addr_xvk <<< $(for i in {1..64}; do printf "20"; done) | \
> cardano-address address payment --network-tag 1
addr1vxh2sv3tkgzkyhenvzrleamqj2dvtgxqah56gnhfc32depske34z3

And it's valid, it works, and I can also add some my own text at the beginning to make it unique, instead of 64 spaces...
But is it acceptable as a verifiable Proof-of-Burn address?
Is there any generally approved way to generate a Proof-of-Burn address on Cardano?

Maybe off-topic, but out of curiosity, what do you want to burn? Ada or some native assets ? Third party policy or own policy ?

My token https://pool.pm/bebb83cd0f8bc52c2d2e22bfec9e5f06005be7d545a5d4637d434336.goad, sadly with minUTxOValue of ADA each time but this is another problem... The policy will be locked at the time of project start. https://pool.pm/policy/bebb83cd0f8bc52c2d2e22bfec9e5f06005be7d545a5d4637d434336

I think that the address you generate is plausibly unspendable but not provably. I can imagine that by tweaking a Plutus validator script with a lot of time and computing power you could generate a spendable script that compiles to some regular byte pattern hash that you can than pretend to have derived from an expression such as the one in your example. (Though, a repeating pattern of a two digit number for 128 bytes would probably be impossible to tweak.)
I haven't read the article but the easiest way to get an unspendable script address would be to take an unspendable Plutus validator script (like the one that always evaluates to 'false') and use its script address. This would be verifiable. Even better would be a script that allows cumulating funds so that you can re-use the UTxO and only have to pay the min-Ada once.
This being said, I don't think that these dead-end burn-UTxOs are a sustainable solution. They pollute the ledger and bind Ada. In the long term they inevitably get too expensive. The better solution is to design the currency policy of your token in such a way that tokens can always be burned. This requires the policy to be written in Plutus.

as I know all the computing power of the world for hundreds of times the age of the universe is not enough to crack it, but yes, this is what I'm looking for: a verifiable and credible way to do it... I will take a look at the policy written in Plutus, it may be the best solution afterall. Thank you.

You are right, the tweaking is impossible. So it rather comes down to how believable it is that you took the hash at random and did not use the hash of a spendable script (which is very believable here). I will edit the response.

Really a burn address is quite simple to make on a practical level. If you accept the script address then all you have to do is write a smart contract with a validator that can never be validated but is still acceptable to the standers of the chain.
So put some condition like the current block is the geniuses block and your good to go. This is beacuse of sequential nature of the block chain.
Now when vasil comes out people can easily lool up the specific address and when a decomplier comes out they can verify the contract on chain.
But until then there is still some degree of trust required that you sent the wright contract to the chain.


text:
Wil I habe Problems with VirtualMachine?
I have a question: will I have problems installing Nix or Haskell on an Ubuntu VirtualMachine over Win11? Will I have problems with Plutus in the future? Would it be better to install Ubuntu only on one PC? Thank you.

This question might not have a correct answer and is really not related to the topic we discuss here. In general I can tell you that yes is possible to set up virtual box on a windows 11 machine and so you can visualizer an Ubuntu instance to use fot your learning.

Ok, Thank you...

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

Installing the required toolset in an Ubuntu VM is perfectly fine and quite documented. In fact, it is the method used by many, as it isolates the environment from the host avoiding problems in certain cases. You can check this recent thread for more details:
Plutus environment set up: pro and cons
Be aware that in any case, your Win11 host, a vm on it, a cloud vm, or even another computer, will need a minimum of 8GB of free RAM and around 35GB of free disk space dedicated to the environment.
Cheers!


text:
BlockFrost API Historical Supply By Epoch Data?
Currently https://cardano-mainnet.blockfrost.io/api/v0/network gets the current network supply data. Does anyone know an endpoint from any API that has historical supply usage data by epoch?

Bumping question - I'm also interested to know if this is possible via API calls.


text:
starting nix-shell on mac "Operation not permitted"
I am building natively on intel Mac. After nix-build finished I run nix-shell and it ends with following error:
installing
Installing executable cardano-cli in /nix/store/qxzkl3pvmj1agri8a4k6awd4gsd61in2-cardano-cli-exe-cardano-cli-1.32.1/bin
Warning: The directory
/nix/store/qxzkl3pvmj1agri8a4k6awd4gsd61in2-cardano-cli-exe-cardano-cli-1.32.1/bin
is not in the system search path.
Setting gitrev of /nix/store/qxzkl3pvmj1agri8a4k6awd4gsd61in2-cardano-cli-exe-cardano-cli-1.32.1/bin/cardano-cli ... OK
"Bundling /nix/store/vv3k4s0gzkvdbirq5iiah15w920z6aql-zlib-1.2.11/lib/libz.dylib in /nix/store/qxzkl3pvmj1agri8a4k6awd4gsd61in2-cardano-cli-exe-cardano-cli-1.32.1/bin/cardano-cli"
error: getting status of '/nix/store/.links': Operation not permitted
rewrite-libs: ProcFailed {procCommand = "nix-store", procArguments = ["-r","/nix/store/vv3k4s0gzkvdbirq5iiah15w920z6aql-zlib-1.2.11/lib/libz.dylib"], procExitCode = ExitFailure 1}
builder for '/nix/store/z0i1gyl2blzxp2naan6wq3dib60r818r-cardano-cli-exe-cardano-cli-1.32.1.drv' failed with exit code 1
error: build of '/nix/store/87iqpvg6d4bizsgrzg35k8rc5m1x64ch-cardano-node-exe-cardano-node-1.32.1.drv', '/nix/store/b0q86i19kw66v5v8r21p1z8rs2mgm6dc-pre-commit-config.json.drv', '/nix/store/z0i1gyl2blzxp2naan6wq3dib60r818r-cardano-cli-exe-cardano-cli-1.32.1.drv' failed

I think it is related to "System Integrity Protection (SIP)" on mac - adding full disk access to terminal or nix-shell did not work - I am guessing that I need to give fll disk access permission to the actual build command but not sure what it is.

How did you install nix on macOS? What are the permissions on /nix/store? Did you switch from single user to multi user at any point in time?

I did a clean install following https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md and that fixed it - till not sure what the difference is.

I was able to resolve this with the following nix.conf and a full restart of my M1 Mac. The key was setting sandbox to false and adding the last two lines.
build-users-group = nixbld
substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
sandbox = false
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
system = x86_64-darwin
extra-platforms = x86_64-darwin aarch64-darwin
experimental-features = nix-command
extra-experimental-features = flakes

A more detailed guide can be found here. cardano-plutus-apps-install-m1

I got the same error but using masOS Monterey on an i7.  Should I still use the above nix.conf as above?  So far I've been using build-users-group = nixbld substituters        = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/ trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=volume


text:
Playground returning: ERR_CONNECTION_REFUSED after power-cycle of host
I was able to run the playground on localhost yesterday. Then I turned off the computer.
Today, I restarted nix-shell and started the client/server, but now the browser is not loading and giving error: ERR_CONNECTION_REFUSED
Tried changing the webpack:server value in package.json and rebuilt the code, but still did not help.
Any idea why it was working one day and not the next day?

What OS is this? Did you restart the playground server? Is the process still alive?

Please ignore this question. I just reinstalled the repositories and rebuild the code following the 1st lecture. Not seeing the problem now. Thanks.


text:
Unable to start /plutus-apps client application
Error is occurring for MacOS 12.1 Monterey. Please, let me know, if I should include additional details.
I am going through the step noted in this document in order to setup local Plutus app:  https://docs.google.com/document/d/15QR25eWgg587FTPnuf6Si_lpux-uFQsY_2Gj_4vf4lM/edit
Everything is going fine until the 6th step. The following is the error log I am getting:

> plutus-playground-client@1.0.0 start /Users/rnaydenov/Desktop/Plutus Pioneer/plutus-apps/plutus-playground-client
> 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

plutus-playground-server: user error (Error evaluating simulation: InterpreterError (CompilationErrors [CompilationError {filename = "\n/private/tmp/web-ghc-work-95c26a6de2f74eb6/Main.hs", row = 2, column = 1, text = [" error:","    Could not find module \8216Playground.Contract\8217","    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-95c26a6de2f74eb6/Main.hs", row = 3, column = 1, text = [" error:","    Could not find module \8216Plutus.Contract\8217","    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-95c26a6de2f74eb6/Main.hs", row = 4, column = 1, text = [" error:","    Could not find module \8216PlutusTx.Prelude\8217","    Use -v (or `:set -v` in ghci) to see a list of the files searched for.","  |","4 | import PlutusTx.Prelude","  | ^^^^^^^^^^^^^^^^^^^^^^^"]}]))
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! plutus-playground-client@1.0.0 start: `plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the plutus-playground-client@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/rnaydenov/.npm/_logs/2022-01-12T22_40_06_274Z-debug.log

Fortunately, someone in the discord had this exact same problem.  I had suggested running nix-build, but that errored out.  Apparently the solution was to set this first, before running the command:
GC_DONT_GC=1

Here is the original message from the pioneers-lounge in the discord: https://discord.com/channels/826816523368005654/862912746847993887/930825351968473118

Thank you so much for the answer! GC_DONT_GC=1 npm start seemed to work .. now off to the next error (:
Also, for anyone trying to get this setup on Mac M1 I highly recommend this guide https://github.com/renzwo/cardano-plutus-apps-install-m1

Actually, for anyone that comes across this: if you manage to get the app running but stumble upon a compilation error of the sort 'Ledger not found', try stopping the client and server, exiting the nix-shell and running nix build -f default.nix plutus-apps.haskell.packages.plutus-pab.components.library in /plutus-apps.
According to the ReadMe in plutus-apps https://github.com/input-output-hk/plutus-apps this builds the Plutus PAB library required for the compilation.

This worked for me after "ERR check permissions missing write access", on masOS i7 Monterey.  sudo GC_DONT_GC=1 npm install -g npm .


text:
Plutus Auction use-case
Regarding plutus-apps Auction use-case plutus-use-cases/src/Plutus/Contracts/Auction.hs , both auctionSeller and auctionBuyer need to specify the same exact params, or else each buyer could change the auction deadline!  What exactly stops the buyer contract from doing so?

In a way, you are (but aren't) correct since auctionSeller and auctionBuyer could be used to arbitrarily declare params. However, these functions don't run on-chain, they are client-side code for preparing the structure to be submitted for placing a bid.
The on-chain validation is in the "auctionTransition" function which accepts the bid, or payout. Both these inputs don't even accept a deadline or token type value so it isn't possible for them to change the state in that way. Otherwise, the token and deadline are immutable, so they cannot be changed.

Well as you said it is off-chain. If you feed it incorrect information, all you do is allow yourself to build an order which will be denied by the on-chain component, or disallow yourself from building otherwise correct information.

Welcome to Cardano SE! As a new user be sure to take the [Tour].


text:
Playground client can't connect to playground server (all localhost)
I am on an Intel based iMac Pro running Big Sur (11.6.1)
I have followed every variant of the local playground setup I can find (all are some version of page 2 in this document https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit#heading=h.orxckbtlhnnq) and while I can get both the playground client and server to start, and I can load up the playground client web page in my browser, I can't "compile" the code in the playground because of the web page receives 504 connection errors.  So, here is what the playground web page looks like:

And I see these errors in the Plutus-playground-client console when I do anything in the UI:
[HPM] Error occurred while trying to proxy request /api/oauth/status from localhost:8009 to http://localhost:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

[HPM] Error occurred while trying to proxy request /api/contract from localhost:8009 to http://localhost:8080 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
Interestingly enough, if I copy the "compile" request from the chrome inspector as a curl command and adjust the URL to be the playground-server port, The connection to the playground-server is successful and the code compiles, so something seems broken with the client.
Also, using lsof, I have verified that both the server and client are listening on the correct ports.

Not sure if answering my own question is some sort of faux pas, but, figure I will put it in here because I have been banging my head on this one for hours and the fix appears to be very simple.
edit Plutus-apps/plutus-playground-client/webpack.config.js,adding a 'host' param as well as turning off HTTPS (its local dev, https isn't critical here):
devServer: {
    contentBase: path.join(__dirname, "dist"),
    compress: true,
    port: 8009,
    host: '0.0.0.0',<-- Add this
    https: false, <-- Change this from 'true' to 'false'
    stats: "errors-warnings",
    proxy: {
        "/api": {
            target: "http://127.0.0.1:8080",
        },
    },
},

Additionally, I need to specifically build the Plutus-playground-client:
cd plutus-apps
nix-build -A plutus-playground.client
nix-shell
cd plutus-apps/plutus-playground-client
npm run start


text:
Can't find .config on the root

So this step on the "Ubuntu setup for Plutus Playround" Cant work.

mkdir ~/.config/nix
echo 'substituters = https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/' >> ~/.config/nix/nix.conf
echo 'trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=' >> ~/.config/nix/nix.conf

what should i do? trying to create a .config folder don't work either.
(my coding and linux level is low)

If the file does not exist you have to create it. It should work.

Don't work..
mkdir ~/.config/nix
mkdir: cannot create directory ‘/home/cnode/.config/nix’: No such file or directory

Not sure what directory you are in (folder).  Maybe post back (use pwd).  None the less, you probably don't have the nix.conf file made in /etc/nix directory?  Try this on how to make one: https://www.punkbit.com/hacking/plutus-developer-environment-setup-on-macos-monterey/

It’s because the folder .config does not exist yet, so you cannot create the nested folder nix
So you run this instead
mkdir -p ~/.config/nix


text:
nix-shell command causes error "invalid character in Base64 string"
I'm following the Plutus Env: Setup Starter Pack guideline to run a Plutus Playground Local Instance. At step 4, when running the command nix-shell, I got the error message error: invalid character in Base64 string: ''. Does anyone know how to fix it? I'm using WSL2 with Ubuntu 20.04 distro.
All the steps I did are:

Download the plutus-apps repository: git clone https://github.com/input-output-hk/plutus-apps
Go to the latest commit of the repository: git checkout 7f53f18dfc788bf6aa929f47d840efa1247e11fd
Setup  IOHK binary cache (https://github.com/input-output-hk/plutus-apps#iohk-binary-cache) and then at top of this repo, nix-build -A plutus-playground.server
Enter nix-shell => error: invalid character in Base64 string: ''

Here are the outputs of nix-build, nix-shell, nix-shell --show-trace
nhaancs@NhanNguyen:~/Workspace/plutus-apps$ nix-build -A plutus-playground.server
/nix/store/3igf75n00amzcyfrk7wmh3kjp73bx6bp-plutus-playground-server-exe-plutus-playground-server-0.1.0.0
nhaancs@NhanNguyen:~/Workspace/plutus-apps$ nix-shell
error: invalid character in Base64 string: ''
(use '--show-trace' to show detailed location information)
nhaancs@NhanNguyen:~/Workspace/plutus-apps$ nix-shell --show-trace
error: invalid character in Base64 string: ''

       … while importing '/nix/store/9vsdalr213rjwh2810jdv1p2r7lifpsl-ghc810420210212-boot-packages-nix.nix/ghci.nix'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/overlays/ghc-packages.nix:51:14:

           50|   importSrcAndNix = srcAndNix:
           51|       args: (import srcAndNix.nix args) // { inherit (srcAndNix) src; };
             |              ^
           52|

       … while evaluating 'importSrcAndNix'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/overlays/ghc-packages.nix:51:7:

           50|   importSrcAndNix = srcAndNix:
           51|       args: (import srcAndNix.nix args) // { inherit (srcAndNix) src; };
             |       ^
           52|

       … from call site

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/modules/plan.nix:302:20:

          301|               then (abort "${name} has no revision!")
          302|               else revision (modArgs // { hsPkgs = hsPkgs // (mapAttrs (l: _: hsPkgs.${name}.components.sublibs.${l}) (m.components.sublibs or {})); });
             |                    ^
          303|       in

       … while evaluating anonymous lambda

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/modules/plan.nix:298:63:

          297|     inherit (module) compiler;
          298|     packages = lib.mapAttrs (name: { revision, ... }@revArgs: { system, compiler, flags, pkgs, hsPkgs, errorHandler, pkgconfPkgs, ... }@modArgs:
             |                                                               ^
          299|

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/types.nix:499:46:

          498|         coerce = unify: value: if isFunction value
          499|           then setFunctionArgs (args: unify (value args)) (functionArgs value)
             |                                              ^
          500|           else unify (if shorthandOnlyDefinesConfig then { config = value; } else value);

       … while evaluating 'unifyModuleSyntax'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:258:34:

          257|      of ‘options’, ‘config’ and ‘imports’ attributes. */
          258|   unifyModuleSyntax = file: key: m:
             |                                  ^
          259|     let

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/types.nix:499:39:

          498|         coerce = unify: value: if isFunction value
          499|           then setFunctionArgs (args: unify (value args)) (functionArgs value)
             |                                       ^
          500|           else unify (if shorthandOnlyDefinesConfig then { config = value; } else value);

       … while evaluating anonymous lambda

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/types.nix:499:33:

          498|         coerce = unify: value: if isFunction value
          499|           then setFunctionArgs (args: unify (value args)) (functionArgs value)
             |                                 ^
          500|           else unify (if shorthandOnlyDefinesConfig then { config = value; } else value);

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:312:8:

          311|       # works.
          312|     in f (args // extraArgs)
             |        ^
          313|   else

       … while evaluating 'applyIfFunction'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:288:29:

          287|
          288|   applyIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
             |                             ^
          289|     let

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:191:55:

          190|         if isFunction m || isAttrs m then
          191|           unifyModuleSyntax fallbackFile fallbackKey (applyIfFunction fallbackKey m args)
             |                                                       ^
          192|         else if isList m then

       … while evaluating 'unifyModuleSyntax'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:258:34:

          257|      of ‘options’, ‘config’ and ‘imports’ attributes. */
          258|   unifyModuleSyntax = file: key: m:
             |                                  ^
          259|     let

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:191:11:

          190|         if isFunction m || isAttrs m then
          191|           unifyModuleSyntax fallbackFile fallbackKey (applyIfFunction fallbackKey m args)
             |           ^
          192|         else if isList m then

       … while evaluating 'loadModule'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:189:53:

          188|       # Like unifyModuleSyntax, but also imports paths and calls functions if necessary
          189|       loadModule = args: fallbackFile: fallbackKey: m:
             |                                                     ^
          190|         if isFunction m || isAttrs m then

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:230:22:

          229|           let
          230|             module = loadModule args parentFile "${parentKey}:anon-${toString n}" x;
             |                      ^
          231|             collectedImports = collectStructuredModules module._file module.key module.imports args;

       … while evaluating anonymous lambda

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:247:31:

          246|           disabledKeys = map moduleKey disabled;
          247|           keyFilter = filter (attrs: ! elem attrs.key disabledKeys);
             |                               ^
          248|         in map (attrs: attrs.module) (builtins.genericClosure {

       … from call site

       … while evaluating 'filterModules'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:243:36:

          242|       # modules recursively. It returns the final list of unique-by-key modules
          243|       filterModules = modulesPath: { disabled, modules }:
             |                                    ^
          244|         let

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:254:7:

          253|     in modulesPath: initialModules: args:
          254|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |       ^
          255|

       … while evaluating anonymous lambda

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:253:37:

          252|
          253|     in modulesPath: initialModules: args:
             |                                     ^
          254|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:128:25:

          127|       merged =
          128|         let collected = collectModules
             |                         ^
          129|           (specialArgs.modulesPath or "")

       … while evaluating 'reverseList'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/lists.nix:393:17:

          392|   */
          393|   reverseList = xs:
             |                 ^
          394|     let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:132:33:

          131|           ({ inherit lib options config specialArgs; } // specialArgs);
          132|         in mergeModules prefix (reverseList collected);
             |                                 ^
          133|

       … while evaluating 'byName'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:364:25:

          363|       */
          364|       byName = attr: f: modules:
             |                         ^
          365|         foldl' (acc: module:

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:383:21:

          382|       # an attrset 'name' => list of submodules that declare ‘name’.
          383|       declsByName = byName "options" (module: option:
             |                     ^
          384|           [{ inherit (module) _file; options = option; }]

       … while evaluating 'flip'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/trivial.nix:138:16:

          137|   */
          138|   flip = f: a: b: f b a;
             |                ^
          139|

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:395:23:

          394|
          395|       resultsByName = flip mapAttrs declsByName (name: decls:
             |                       ^
          396|         # We're descending into attribute ‘name’.

       … while evaluating the attribute 'matchedOptions'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:427:14:

          426|     in {
          427|       inherit matchedOptions;
             |              ^
          428|

       … while evaluating 'recurse'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:295:23:

          294|     let
          295|       recurse = path: set:
             |                       ^
          296|         let

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:303:8:

          302|         in mapAttrs g set;
          303|     in recurse [] set;
             |        ^
          304|

       … while evaluating 'mapAttrsRecursiveCond'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:293:36:

          292|   */
          293|   mapAttrsRecursiveCond = cond: f: set:
             |                                    ^
          294|     let

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:140:28:

          139|           # For definitions that have an associated option
          140|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                            ^
          141|

       … while evaluating 'evalModules'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:63:17:

           62|      evalModules) and the less declarative the module set is. */
           63|   evalModules = { modules
             |                 ^
           64|                 , prefix ? []

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/types.nix:520:12:

          519|         merge = loc: defs:
          520|           (evalModules {
             |            ^
          521|             modules = allModules defs;

       … while evaluating 'merge'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/types.nix:519:22:

          518|         check = x: isAttrs x || isFunction x || path.check x;
          519|         merge = loc: defs:
             |                      ^
          520|           (evalModules {

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:559:59:

          558|       if isDefined then
          559|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                                                           ^
          560|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while evaluating the attribute 'value'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:570:27:

          569|     optionalValue =
          570|       if isDefined then { value = mergedValue; }
             |                           ^
          571|       else {};

       … while evaluating anonymous lambda

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/types.nix:394:22:

          393|       merge = loc: defs:
          394|         mapAttrs (n: v: v.value) (filterAttrs (n: v: v ? value) (zipAttrsWith (name: defs:
             |                      ^
          395|             (mergeDefinitions (loc ++ [name]) elemType defs).optionalValue

       … from call site

       … while evaluating anonymous lambda

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/modules/component-driver.nix:95:14:

           94|     lib.mapAttrs
           95|       (name: pkg: if pkg == null then null else builder.build-package config pkg)
             |              ^
           96|       (config.packages // lib.genAttrs (config.nonReinstallablePkgs ++ config.bootPkgs) (_: null));

       … from call site

       … while evaluating anonymous lambda

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/default.nix:103:49:

          102|   isLocalPackage = p: p.isLocal or false;
          103|   selectLocalPackages = ps: lib.filterAttrs (n: p: p != null && isLocalPackage p) ps;
             |                                                 ^
          104|

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:125:62:

          124|   filterAttrs = pred: set:
          125|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                                                              ^
          126|

       … while evaluating anonymous lambda

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:125:29:

          124|   filterAttrs = pred: set:
          125|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                             ^
          126|

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:125:18:

          124|   filterAttrs = pred: set:
          125|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
             |                  ^
          126|

       … while evaluating 'filterAttrs'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:124:23:

          123|   */
          124|   filterAttrs = pred: set:
             |                       ^
          125|     listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));

       … from call site

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/default.nix:103:29:

          102|   isLocalPackage = p: p.isLocal or false;
          103|   selectLocalPackages = ps: lib.filterAttrs (n: p: p != null && isLocalPackage p) ps;
             |                             ^
          104|

       … while evaluating 'selectLocalPackages'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/default.nix:103:25:

          102|   isLocalPackage = p: p.isLocal or false;
          103|   selectLocalPackages = ps: lib.filterAttrs (n: p: p != null && isLocalPackage p) ps;
             |                         ^
          104|

       … from call site

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/builder/shell-for.nix:6:39:

            5|   # dependencies will be included in the shell's `ghc-pkg list`.
            6|   packages ? ps: builtins.attrValues (haskellLib.selectLocalPackages ps)
             |                                       ^
            7|   # `components` function selects components that will be worked on in the shell itself.

       … while evaluating anonymous lambda

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/builder/shell-for.nix:6:14:

            5|   # dependencies will be included in the shell's `ghc-pkg list`.
            6|   packages ? ps: builtins.attrValues (haskellLib.selectLocalPackages ps)
             |              ^
            7|   # `components` function selects components that will be worked on in the shell itself.

       … from call site

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/builder/shell-for.nix:26:22:

           25|
           26|   selectedPackages = packages hsPkgs;
             |                      ^
           27|   additionalPackages = additional hsPkgs;

       … while evaluating the attribute 'name'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/builder/shell-for.nix:136:5:

          135|   mkShell (mkDrvArgs // {
          136|     name = mkDrvArgs.name or name;
             |     ^
          137|

Could you paste the entire output and tell us which option from the starter pack you chose?

@Avatar33 I updated the question with output

Some characters pasted from Windows are encoded in ways that your shell can't interpret. Either (1)  type the command manually, or (2) after pasting the command into the shell, manually replace all whitespace with simple spaces before running it.

Thank @Hysteria, I typed the commands but it doesn't work. I updated my question with more information, can you take a look :D

don't know if it can help, but after cloning the plutus-apps repository, I ran cabal update, and then nix-shell. Once that was finished, I just followed the README and ran cabal build plutus-pab. I then followed the instructions on page 2 of this document -> https://docs.google.com/document/d/13112LHG9vVvNUs40oZSqZ-DF6_yFiT_SJZ2NaEmjMM4/edit# although I did not do step 3 (nix-build -A plutus-playground.server), and it seems to work fine. I hope you manage to find the issue


text:
slotToEndPOSIXTime error
Firstly, when I attempt to build a repl of week01 what I get is
Then when I attempt to use slotToEndPOSIXTime I get
Any help would be greatly appreciated, thanks!  Everything else works great up until this point.

It’s because def :: SlotConfig method is not found.
You have to “import Data.Default” first

I needed sleep last night and figured it would be a while before anyone answered.  Thank you for being so quick!  THIS WORKED!  Thank you so much!


text:
Need help installing pioneer-based code on intel Mac (Big Sur)
I'm following the instructions laid out in https://docs.plutus-community.com/docs/setup/MacOS.html to setup my intel Mac (Big Sur) dev environment for cohort 3 of the pioneer program and having issues.
I've successfully completed steps 1-8 (in the link above): I have nix installed, rebooted computer and the cloned plutus code.
When I do Step 9, which is
nix build -f default.nix plutus.haskell.packages.plutus-core.components.library
I get
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
adding the suggested tag seems to build fine so I can get by this step.
But then I can't get step 10 to work.  When I enter
nix-build -A plutus-playground.client
it replies with
error: attribute 'plutus-playground' in selection path 'plutus-playground.client' not found
I'm new to nix and cabal so don't really know where to start to resolve this.  I see lots of other files named pluts-xxx in the plutus directory, but nothing related named "plutus-playground"
Can someone please tell me what do I need to run or load in order to get this to work?
Thanks

In step 7, there should be a 2nd line instructing you clone the plutus-apps.  Change plutus.git to plutus-apps.git in step 7 to clone it, then run the playground nix-build from the top of that second repo.

thanks, this was it.  This list must have been made before the components (like the playground) was split out from the plutus repo and into plutus-apps repo

also found that trying to run
nix-build -A plutus-pab
in Step 11 wouldn't work for me in plutus-apps. I had to use
nix-build default.nix -A plutus-apps.haskell.packages.plutus-pab
which I found in plutus-apps/plutus-pab-executables/README.md

Please accept the answer if it's working. Please also consider opening a pull requests against https://github.com/nstankov-bg/docs.plutus-community.com to fix the community documentation.

done and will look at the docs repo and what I can contribute/improve


text:
What is minimum RAM for running plutus-playground-server on Ubuntu VirtualBox?
I am facing this issues when running
$ nix-build -A plutus-playground.server
> error: 1 dependencies of derivation
> '/nix/store/39qxl421bhkzks2zrra7vy3yl6qqhsib-zlib-lib-zlib-0.6.2.3-config.drv'
> failed to build

It is probably RAM size issue. What is minimum RAM for running plutus-playground-server on Ubuntu VirtualBox?

I would be surprised if it worked in less that 8G of RAM. Having a decent amount of swap would not hurt either.

I increased to 10GB fo Virtual Box and $nix-build -A plutus-playground.server run successfully. Swap set to 2GB in VM

Welcome to Cardano SE! As a new user be sure to take the [Tour].

This question could be improved and is not generating good quality answers, please read [answer] and the relevant pinned messages in [help] if you are going to answer this question.

As all answers, it depends on your setup. Currently I run the plutus-playground-server setup on a VM with 8gb of ram available (but the playground only uses 1gb of that space). The thing to consider and optimize is the way you run you VM. I run my VM with the libvirt stack (this hypervisor runs near native hardware speeds, very lightweigth). Also I do not render a DE on my VM. I just SSH into the VM and only use the terminal, this also saves a lot of ram usage. So I guess that 2gb will suffice bare minimum (I have not tested this).
a good guide for this hypervisor: https://octetz.com/docs/2020/2020-05-06-linux-hypervisor-setup/
Good luck!

I have seen, that my setup needs around 12GB. Maybe you can optimize it more, but for me it was around 12GB.


text:
Installing on WLS2 - error: experimental Nix feature 'nix-command' is disabled
I am completely green here. I'm following the instructions laid out in https://docs.plutus-community.com/docs/setup/WindowsWSL.html to setup my windows environment for cohort 3 of the pioneer program and having issues.  I've successfully completed steps 1-7 (in the link above), but when I do Step 8, which is ...
nix build -f default.nix plutus.haskell.packages.plutus-core.components.library
I get ...
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
Where do I add that flag in the nix build command?
Thanks

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

Previously there was another plutus repository, now they made an update with another name plutus-apps, the execution of the command must be updated so that it points to that reference of the plutus-apps project
nix --extra-experimental-features nix-command build -f default.nix plutus-apps.haskell.packages.plutus-core.components.library

This worked for my macOS Monterey 2015 Quad i7 setup.

As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Think I have resolved it.
nix --extra-experimental-features nix-command build -f default.nix plutus.haskell.packages.plutus-core.components.library

I was a little bit on the tutorial and just started setting the environment. Sorry for that indeed.
I get the following error when i try to build plutus with nix command
error: getting status of /home/user/default.nix: no such file or directory
Thanks

it's showing the following error in my installation:
error: getting status of: '/home/user/default.nix': no such file or directory
Please help is needed.

As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.


text:
Webpack warning when starting plutus-playground-client
I am getting a warning when I run npm start on the plutus-playground-client:
ℹ ｢wds｣: webpack output is served from /
ℹ ｢wds｣: Content not from webpack is served from /home/datapool/plutus-apps/plutus-playground-client/dist
⚠ ｢wdm｣: WARNING in Compiling Unsafe.Coerce

And at the end I get flagged the final output:
webpack compiled with 1 warning
ℹ ｢wdm｣: Compiled with warnings.

The problem seems to stem from Unsafe.Coerce. Any explanation on this and how I might avoid the warning?

This is nothing to be concerned about. I see it reporting a different module for the warning.
⚠ ｢wdm｣: WARNING in Compiling Web.DOM.Internal.Types

There will be various warnings emitted. But they are only warnings. The fact that the exact warning isn't shown by npm isn't great though.
You won't be able to avoid warnings, unless the developers adhere to an overly strict warning-free code (e.g. -Werror). Then again lot of software emits warnings during compilation, sometimes they are just compiler diagnostics.


text:
Where do I find correct and current git checkout?
Update and detailed answer Feb 4, 2022.
For the purposes of the Plutus Pioneer Program, the checkout information can be found in the weekly cabal.project file, located (for Week04, as an example, and on my system) at

~/plutus/plutus-pioneer-program/code/week04/cabal.project

I have developed a system using aliases that load when I enter my shell (using a text file sourced from within .zshrc) and my nix-shell (same file, but sourced from .bashrc which is what nix uses). Among those aliases are:

alias pp='cd ~/plutus/plutus; ls -laFh; pwd'
alias ppa='cd ~/plutus/plutus-apps; ls -laFh; pwd'
alias ppp='cd ~/plutus/plutus-pioneer-program; ls -laFh; pwd'
alias pppw4='cd ~/plutus/plutus-pioneer-program/code/week04; ls -laFh; pwd'

So now my sequence is

pp
git pull
ppp
git pull
ppa
git pull
pppw4
cat cabal.project

The "git pull" following the "ppp" is what brings in the weekly lesson/project files.
I then look within cabal.project for the following section (the key portion is directly under "plutus-apps.git") Be careful because there are numerous other tags in that file.

package cardano-wallet-core-integration
  optimization: False

source-repository-package
  type: git
  location: https://github.com/input-output-hk/plutus-apps.git
  tag:ea1bfc6a49ee731c67ada3bfb326ee798001701a
  subdir:
    freer-extras
    playground-common
    plutus-chain-index-core
    plutus-contract
    plutus-ledger
    plutus-ledger-constraints
    quickcheck-dynamic

-- Direct dependency.
-- Are you thinking of updating this tag to some other commit?

I then use this info to add an alias to my aliases file.

alias pppcheckoutw4='cd ~/plutus/plutus-apps; git checkout ea1bfc6a49ee731c67ada3bfb326ee798001701a'

That way I can easily do the git checkout in the future with

pppcheckoutw4

and then enter the nix shell (always from within the Plutus-apps directory!)

Once in the nix shell I do "$ pppw4" (or whichever week it is) and then "$ cabal update" and then "$ cabal repl" and I am ready to work.
So now I have an efficient and organized system for doing my "git pull"s and "git checkout" before diving into my nix shell and then my cabal repl. May you find your way as pleasant.
=========== Original Question ===========
When setting up plutus-playground, I have seen comments and at least one other source that advised running

git checkout 3746610e53654a1167aeb4c6294c6096d16b0502
#Newer??
git checkout 7f53f18dfc788bf6aa929f47d840efa1247e11fd

inside the plutus-apps directory, prior to running

[$] nix-build -A plutus-playground.client
[$] nix-build -A plutus-playground.server

This seemed to be the key for me to successfully build and run the playground, yet it is not in the canonical instructions and I have no idea how I could have deduced this on my own. Where does that line(code) come from (I assume github, but where?) and should it be included in the canonical instructions? How is it different from "git commit"? Does it have anything to do with the similar codes in the cabal.project files in plutus and plutus-apps? Still learning, explanation appreciated!

You can find it in the Plutus Pioneer Program cabal.project file under the plutus-apps dependency entry.

Use 41149926c108c71831cfe8d244c83b0ee4bf5c8a as specified here

answer is insufficient, does not follow good practices as stated: https://stackoverflow.com/help/closed-questions


text:
Haskell Language Server - linker error: symbol sqlite3_fts3_may_be_corrupt
When I run haskell-language-server in nix-shell in plutus-pioneer-progam i get this error.
   sqlite3_fts3_may_be_corrupt
whilst processing object file
   /nix/store/jmhwwzn1yfjzlxavz16afkf1r4shmp8z-persistent-sqlite-lib-persistent-sqlite-2.13.0.3/lib/x86_64-linux-ghc-8.10.4.20210212/persistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4/HSpersistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4.o
The symbol was previously defined in
   /nix/store/si95pc9hb5hr1yiyj7b2s75hl4bkn9g2-direct-sqlite-lib-direct-sqlite-2.3.26/lib/x86_64-linux-ghc-8.10.4.20210212/direct-sqlite-2.3.26-Gg0YVBPVrMk3LDxZxB2Bzf/HSdirect-sqlite-2.3.26-Gg0YVBPVrMk3LDxZxB2Bzf.o
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.```

Are you on macos?

I've found out that the issue comes from the playground stuff. (don't ask me why...)
Commenting the lines [360 .. 365], 24 and 28, the problem goes away.
Note that doing this, the old friend GHC Core to PLC plugin; E043:Error comes up, but at least you can navigate the code and look at the documentation.

What is the file that needs to be edited ?

https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week01/src/Week01/EnglishAuction.hs


text:
can i use the live playground platform, instead of local installation?
I wen through the environment setup detail and  got a problem.
The thing is my laptop is running out of resources. so i decided to utilize the online playground
environment for the tutorial. I just didn't want to make a local installation.
Tell me your words about it.
Thanks all in advance

At the time of writing playground platform isn't up to date. Progress about this issue is tracked here https://github.com/input-output-hk/plutus-apps/issues/195

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

As the online Plutus Playground is not available at the moment (see
here), and your local computer doesn't have the required resources (around 35GB of disk and 8GB of RAM), I'd recommend to run it in a Linux virtual machine in the cloud (AWS, Azure, Google Cloud, etc.), where you'll be able to pay only for the minutes of running time plus a small amount for the storage if you want it to persist, or you can look for a traditional VPS hosting that you can find for less than $10 a month. Cheers!