text:
Plutus Pioneers Program Environment Setting, nix-shell command cause syntax error, 8.10.5 is out of date
I'm encountered syntax error message as below when I command "nix-shell" to build environment setting. Could you advise what makes this error message?
--- error message ---
trace: WARNING: 8.10.5 is out of date, consider using 8.10.7.
error: syntax error, unexpected end of file at /nix/store/14hkipxfa9j8ngs02f7llgpqr4l7mrdq-happy-plan-to-nix-pkgs/default.nix:1:1:
--- end of error message ---
My system setting :
OS : ubuntu 20.04lts
I've completed following steps in advance to set up environment.
sudo sh -c 'apt update && apt install curl' to install curl
sudo apt-get install vim to install vim
sudo apt-get install git to install git
sh <(curl -L https://nixos.org/nix/install) --no-daemon to install nix via single user
sudo vim nix.conf  to create a new nix.conf file
Paste the following lines:
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=
experimental-features = nix-command
git clone https://github.com/input-output-hk/plutus-apps to clone the correct plutus-apps repo
git checkout 7f53f18dfc788bf6aa929f47d840efa1247e11fd
nix-build -A plutus-playground.server

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

looks like we're following the same instructions to install the IOHK binary caches with a couple of small differences, and honestly, I have no idea whether this makes any difference. I believe that may have used the multi-user installation for nix. 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

Actually the error message "out of date" were not root cause of syntax error. I checked out both plutus-pioneer-program and plutus-apps and then ran again above command and pass through this error. Thanks your comments it was helpful. You made me think differently.


text:
How does the final transaction in the auction example know who did the bid?
In the second transaction of the auction example, these are the output EUTxO's. In the final transaction, only wallet 1 and the script are inputs. How does the script know that wallet 3 has done the highest bid? I would expect that the script also stores 'wallet 3' as data, so it's known who had done the bid.
Or, in the closing Tx, how does the script know that wallet 3 did the bid (from the playground, this doesn't seem to be stored.)

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

Each change in state in the auction contract passes a new datum (arbitrary data). The auction datum is made up of the 'Auction' and 'Bid' records. The bid record has a 'bBidder' field which is the public key of the bidder. You can't see this in the playground because the actual datum value isn't stored on-chain, the hash is which allows others to validate. When a validator (or the simulator) calculates the highest bidder, it does it from the start based off the series of eUXTOs'.
As to how does the auction example know who started the bid? When a new eUXTO is added to the series of bids, the validator calculates the previous bids up to the current one, in order to discover the datum. This datum is then used in the contract script again to place the next bid.
The reason this can be done is because the result is entirely deterministic. Based off the same inputs (transactions in/endpoints), you'll get the same output.

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

OK, the datum is not shown in the explorer/playground - that was not clear to me. (I thought it would show the datum, since it does show the some other values, such as how much Ada and T it has in it's state).
btw, if the actual datum value isn't stored onchain, it's stored offchain, right? Where exactly is it stored? (Is it on 1 place, which doesn't seem like a good idea to me, or is it also somehow redundant?)

The datum isn't stored anywhere. The hash of the datum is stored on-chain. Because Plutus is deterministic, whenever a node is trying to run your request, it can re-calculate the datum.

Since I previously mentioned that datums are never stored on-chain, I thought it relevant to note that Post-CIP32 (coming June/Oct), this will no longer be true, and it will be possible to store datums on-chain.

source: Stack Exchange

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

sort: votes


text:
Error on cabal build - Encounterd missing dependesies
I followed the instructions on lecture one - part 3 and I was trying to start week 1 project.
When I run cabal build got the following error:
[nix-shell:~/plutus-pioneer-program/code/week01]$ sudo cabal build
Warning: The build command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-build command
or the legacy v1-build alias as new-style projects will become the default in
the next version of cabal-install. Please file a bug if you cannot replicate a
working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
[__0] trying: plutus-pioneer-program-week01-0.1.0.0 (user goal)
[__1] next goal: base (dependency of plutus-pioneer-program-week01)
[__1] rejecting: base-4.12.0.0/installed-4.1... (conflict:
plutus-pioneer-program-week01 => base^>=4.14.1.0)
[__1] fail (backjumping, conflict set: base, plutus-pioneer-program-week01)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: plutus-pioneer-program-week01, base
Trying configure anyway.
Configuring plutus-pioneer-program-week01-0.1.0.0...
cabal: Encountered missing dependencies:
aeson -any,
base >=4.14.1.0 && <4.15,
data-default -any,
playground-common -any,
plutus-contract -any,
plutus-ledger -any,
plutus-ledger-constraints -any,
plutus-tx -any,
plutus-tx-plugin -any

Could not resolve dependencies and cabal: Encountered missing dependencies is the errors here as far I can understand. I tried again by running cabal update and then cabal build but again I get the same error(s) that I described above. Any ideas? What am I doing wrong?

try "cabal update" before "cabal build".

I tried it and it still does not work. Thanks anyway.

Why are you using sudo? Try without.
And update of course.

If I don't I get an access denied error. I tried with update and it does not work.

Check and make sure that your version of the repo has the correct commit-id.

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


text:
nix-build fails to build plutus or plutus-playground server/client with error: reading from file: Is a directory
I'm attempting to finish the setup for plutus pioneers cohort3 on wsl2 (Windows 10) with Ubunutu 20.04
Nix version: 2.5.1
I cloned the plutus-apps repo (and previously tried the plutus repo before instructions to change to plutus-apps)
I have followed several different sets of instructions, reinstalled nix, tried removing and recloning the repo, and various other potential fixes, but always get to the same error:
/plutus-apps$ nix-build -A plutus-playground.server --show-trace
error: reading from file: Is a directory

       … while evaluating 'gitignoreToRegexes'

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:86:24:

           85|   # string -> [[regex bool]]
           86|   gitignoreToRegexes = gitignore:
             |                        ^
           87|     assert throwIfOldNix;

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:151:47:

          150|
          151|   gitignoreFilter = ign: root: filterPattern (gitignoreToRegexes ign) root;
             |                                               ^
          152| }

       … 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/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:46:18:

           45|       # Last item has the last say; might as well start there
           46|       reversed = reverseList patterns;
             |                  ^
           47|

       … while evaluating anonymous lambda

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:56:13:

           55|     in
           56|       name: _type:
             |             ^
           57|         let

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:75:14:

           74|     let ra = pa name type;
           75|         rb = pb name type;
             |              ^
           76|     in if rb != null

       … while evaluating 'mergePattern'

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:73:33:

           72|   # may override the result of preceding ones.
           73|   mergePattern = pa: pb: (name: type:
             |                                 ^
           74|     let ra = pa name type;

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:74:14:

           73|   mergePattern = pa: pb: (name: type:
           74|     let ra = pa name type;
             |              ^
           75|         rb = pb name type;

       … while evaluating 'mergePattern'

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:73:33:

           72|   # may override the result of preceding ones.
           73|   mergePattern = pa: pb: (name: type:
             |                                 ^
           74|     let ra = pa name type;

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:36:18:

           35|       let
           36|         result = r (toString path) type;
             |                  ^
           37|       in

       … while evaluating 'runFilterPattern'

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:34:14:

           33|   runFilterPattern =
           34|     r: path: type:
             |              ^
           35|       let

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:84:32:

           83|                               type == nodeTypes.directory &&
           84|                               (parse-gitignore.runFilterPattern currentPatterns (dir + "/${name}") type)
             |                                ^
           85|                            ) nodes;

       … while evaluating anonymous lambda

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:82:35:

           81|     let nodes = readDir dir;
           82|         dirs = filterAttrs (name: type:
             |                                   ^
           83|                               type == nodeTypes.directory &&

       … 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/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:82:16:

           81|     let nodes = readDir dir;
           82|         dirs = filterAttrs (name: type:
             |                ^
           83|                               type == nodeTypes.directory &&

       … while evaluating 'findDescendantPatternsTree'

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:80:49:

           79|   # currentPatterns.
           80|   findDescendantPatternsTree = currentPatterns: dir:
             |                                                 ^
           81|     let nodes = readDir dir;

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:70:7:

           69|     in
           70|       findDescendantPatternsTree startingPatterns dir;
             |       ^
           71|

       … while evaluating 'findPatternsTree'

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:60:22:

           59|    */
           60|   findPatternsTree = dir:
             |                      ^
           61|     let

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:22:24:

           21|     let
           22|       patternsBelowP = findPatternsTree basePath;
             |                        ^
           23|       basePathStr = toString basePath;

       … while evaluating 'getPatterns'

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:34:18:

           33|   getPatterns =
           34|     patternTree: pathElems:
             |                  ^
           35|       if length pathElems == 0

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:39:14:

           38|         if hd == "" || hd == "."
           39|         then getPatterns patternTree (tail pathElems)
             |              ^
           40|         else

       … while evaluating 'getPatterns'

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:34:18:

           33|   getPatterns =
           34|     patternTree: pathElems:
             |                  ^
           35|       if length pathElems == 0

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:28:59:

           27|         localDirPathElements = splitString "/" localDirPath;
           28|         patternResult = parse-gitignore.runFilterPattern (getPatterns patternsBelowP localDirPathElements)."/patterns" path type;
             |                                                           ^
           29|         nonempty = any (nodeName: gitignoreFilter (basePath + "/${nodeName}") != false)

       … while evaluating 'runFilterPattern'

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/rules.nix:34:14:

           33|   runFilterPattern =
           34|     r: path: type:
             |              ^
           35|       let

       … from call site

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:28:25:

           27|         localDirPathElements = splitString "/" localDirPath;
           28|         patternResult = parse-gitignore.runFilterPattern (getPatterns patternsBelowP localDirPathElements)."/patterns" path type;
             |                         ^
           29|         nonempty = any (nodeName: gitignoreFilter (basePath + "/${nodeName}") != false)

       … while evaluating anonymous lambda

       at /nix/store/wqw9whwr9qkhhzjs81cv38y4ssspd0sw-source/find-files.nix:25:13:

           24|     in
           25|       path: type: let
             |             ^
           26|         localDirPath = removePrefix basePathStr (toString (dirOf path));

       … from call site

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/clean-source-with.nix:75:17:

           74|            ((includeSiblings || lib.strings.hasPrefix (origSrcSubDir + "/") path)
           75|              && filter path type # Use the filter function to decide if we need it
             |                 ^
           76|            )

       … while evaluating 'filter''

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/clean-source-with.nix:67:23:

           66|         else path: type: true;
           67|       filter' = path: type:
             |                       ^
           68|         # Respect the parent filter

       … from call site

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/clean-source-with.nix:109:18:

          108|       filter = filter';
          109|       outPath = (builtins.path { filter = filter'; path = origSrc; name = name'; }) + origSubDir;
             |                  ^
          110|       _isLibCleanSourceWithEx = true;

       … while adding path '/home/toddy/Cardano-all-stuff/plutus-apps'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/clean-source-with.nix:109:18:

          108|       filter = filter';
          109|       outPath = (builtins.path { filter = filter'; path = origSrc; name = name'; }) + origSubDir;
             |                  ^
          110|       _isLibCleanSourceWithEx = true;

       … while evaluating 'check'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/types.nix:356:15:

          355|       name = "path";
          356|       check = x: isCoercibleToString x && builtins.substring 0 1 (toString x) == "/";
             |               ^
          357|       merge = mergeEqualOption;

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/types.nix:611:18:

          610|       description = "${t1.description} or ${t2.description}";
          611|       check = x: t1.check x || t2.check x;
             |                  ^
          612|       merge = loc: defs:

       … while evaluating 'check'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/types.nix:611:15:

          610|       description = "${t1.description} or ${t2.description}";
          611|       check = x: t1.check x || t2.check x;
             |               ^
          612|       merge = loc: defs:

       … from call site

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

          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 anonymous lambda

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

          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;

       … from call site

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

          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 'mergedValue'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:557:5:

          556|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          557|     mergedValue =
             |     ^
          558|       if isDefined then

       … while evaluating the option `src':

       … while evaluating the attribute 'value'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:525:9:

          524|     in warnDeprecation opt //
          525|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          526|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

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

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

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:301:20:

          300|               then recurse (path ++ [name]) value
          301|               else f (path ++ [name]) value;
             |                    ^
          302|         in mapAttrs g set;

       … while evaluating 'g'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:298:19:

          297|           g =
          298|             name: value:
             |                   ^
          299|             if isAttrs value && cond value

       … from call site

       … while evaluating 'readIfExists'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/modules/cabal-project.nix:4:25:

            3| with types;
            4| let readIfExists = src: fileName:
             |                         ^
            5|       let origSrcDir = src.origSrcSubDir or src;

       … from call site

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/modules/cabal-project.nix:49:17:

           48|       type = nullOr str;
           49|       default = readIfExists config.src config.cabalProjectFileName;
             |                 ^
           50|     };

       … while evaluating the attribute 'default'

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/modules/cabal-project.nix:49:7:

           48|       type = nullOr str;
           49|       default = readIfExists config.src config.cabalProjectFileName;
             |       ^
           50|     };

       … while evaluating the attribute 'value.content'

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

          707|     { _type = "override";
          708|       inherit priority content;
             |              ^
          709|     };

       … while evaluating the attribute 'value._type'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:648:73:

          647|       highestPrio = foldl' (prio: def: min (getPrio def) prio) 9999 defs;
          648|       strip = def: if def.value._type or "" == "override" then def // { value = def.value.content; } else def;
             |                                                                         ^
          649|     in {

       … while evaluating anonymous lambda

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:547:19:

          546|           # Avoid sorting if we don't have to.
          547|           if any (def: def.value._type or "" == "order") defs''.values
             |                   ^
          548|           then sortProperties defs''.values

       … from call site

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

          546|           # Avoid sorting if we don't have to.
          547|           if any (def: def.value._type or "" == "order") defs''.values
             |              ^
          548|           then sortProperties defs''.values

       … while evaluating the attribute 'values'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:551:9:

          550|       in {
          551|         values = defs''';
             |         ^
          552|         inherit (defs'') highestPrio;

       … while evaluating the attribute 'mergedValue'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:557:5:

          556|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          557|     mergedValue =
             |     ^
          558|       if isDefined then

       … while evaluating the option `cabalProject':

       … while evaluating the attribute 'value'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/modules.nix:525:9:

          524|     in warnDeprecation opt //
          525|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          526|         inherit (res.defsFinal') highestPrio;

       … while evaluating anonymous lambda

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

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

       … from call site

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:301:20:

          300|               then recurse (path ++ [name]) value
          301|               else f (path ++ [name]) value;
             |                    ^
          302|         in mapAttrs g set;

       … while evaluating 'g'

       at /nix/store/kawxd91ly09hlyqprqs7yn650s3cfvf6-source/lib/attrsets.nix:298:19:

          297|           g =
          298|             name: value:
             |                   ^
          299|             if isAttrs value && cond value

       … from call site

       … while evaluating anonymous lambda

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/lib/call-cabal-project-to-nix.nix:9:1:

            8| in
            9| { name          ? src.name or null # optional name for better error messages
             | ^
           10| , src

       … from call site

       at /nix/store/8n76c1c3nz2wl6dzxmxdz2y5xrx70flw-source/overlays/haskell.nix:487:36:

          486|               args = { caller = "cabalProject'"; } // args';
          487|               callProjectResults = callCabalProjectToNix args;
             |                                    ^
          488|               plan-pkgs = importAndFilterProject {

       … 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 'packages.plutus-playground-server.components.exes.plutus-playground-server'

       at /home/toddy/Cardano-all-stuff/plutus-apps/nix/pkgs/haskell/default.nix:63:10:

           62| rec {
           63|   inherit index-state compiler-nix-name project projectAllHaddock projectPackages projectPackagesAllHaddock packages;
             |          ^
           64|   inherit extraPackages;

       … while evaluating the attribute 'server'

       at /home/toddy/Cardano-all-stuff/plutus-apps/plutus-playground-client/default.nix:87:3:

           86|   inherit client generate-purescript start-backend;
           87|   server = playground-exe;
             |   ^
           88| }

I've included the entire trace for completeness.  I get the same error when running:
nix build -f default.nix plutus.haskell.packages.plutus-core.components.library --extra-experimental-features nix-command --show-trace

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

did you

Go to the latest commit of the repository, before doing nix-build:

git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a

this gives you a message that you are at HEAD ****f5c8a
Going to this commit helped me, I had build errors too

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

Hey, yeah I was at that commit.  I just started over with a fresh VM and after getting it working, did some minor additional setup, and it broke again in the same way.  I have no idea why my custom setup would be impacting the repo like this, but that's the only thing that makes sense

No your should not be the issue. I have the same setup: wsl2+ Ubuntu and it runs great


text:
PPP Cohort 3 Lecture 1 (English Auction): Why does the buyer get the `minLovelace` (2 ADA) in the end even though the seller payed it initially?
In my example (same as in the lecture) the wallet 1 starts the auction and wallet 3 wins it.
As the contract always has to have some ADA as Lars explains it looks like Wallet 1 pays 2 ADA to the contract in slot 1 to satisfy this rule as it has 2 ADA less (minus fees) in the UTxO. See:

But in the end Wallet 3 who wins the auction gets this 2 ADA.
I guess those 2 ADA have to be there to cover some fees in some special cases.
But why does Wallet 3 and not Wallet 1 gets the 2 ADA in the end?

Due to my low rep score, I cannot comment in Mitchell Turner's answer, so I answer here instead :)
As Mitchell said, all UTxOs must have the minLovelace amount of ADA attached to it. I just want to add a couple points to it

The amount of minLovelace (in the EnglishAuction) is hardcoded by Lars to 2 ADA - https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week01/src/Week01/EnglishAuction.hs#L54

When Wallet1 closes the Auction, token T is sent to Wallet3 -> so the 2 ADA stored alongside token T is send to Wallet3 as well (See this https://github.com/input-output-hk/plutus-pioneer-program/blob/main/code/week01/src/Week01/EnglishAuction.hs#L323)

This min-ada-value requirement will set size bound to both max number of UTxO and max UTxO size. Main reason is: A ledger without a size bound is vulnerable to being populated by so much data that users will unable to process it (or run a node) with machines meeting the recommended specifications for running a node.

min-ada-value is adjusted and calculated values depending on size of UTxO (note: 1 UTxO can contains multiple different types of Tokens including ADA)

You can see this for more information https://docs.cardano.org/native-tokens/minimum-ada-value-requirement

If the address is not spendable by the user sending the tokens, the ada sent alongside the tokens no longer belongs to the sender

Before transferring custom tokens, users may choose to use off-chain communication to negotiate who supplies the ada to cover the min-ada-value in the output made by the transferring transaction

As the contract always has to have some ADA

All UTxOs must have the minLovelace amount of ADA attached to it. That includes UTxOs at script addresses and in wallets. A transaction couldn't output the T token to Wallet 3 without including the minLovelace ADA (both are included in the same UTxO).
This is so bad actors don't just mint tons of new UTxOs and bloat the network. There is a maximum number of UTxOs that can exists since ADA is capped.

Isn't that what fees are for?

Fees are to pay the network for validating your transaction.

Oh, you mean to prevent bloating of the chain? Fees are great to prevent spamming the network, but it's not sufficient to prevent someone from doing permanent damage to the chain. Every time someone spins up a new node, they need to validate every transaction in the history of the chain. Without a minLovelace amount, someone could  mint 1,000,000,000 tokens, each with their own output. That would take up a lot of storage on the node machine. Sure, that would be an expensive transaction, but it would permanently bloat the chain. minLovelace protects against that attack vector.

I understand that fees are also for paying the platform. But I don't understand why it needs fees and the additional mechanism you mention to prevent that someone spams the network. I thought it is rather a collateral. If someone forces to send an invalid transaction then this collateral would be used. See https://docs.cardano.org/plutus/collateral-mechanism

The minLovelace mechanism isn't the collateral. That is, again, separate. The collateral is related to transaction validation on Cardano being deterministic, which is awesome, but requires the safety measures mentioned in the link you included.


text:
WSL2 install - plutus fails to build, unable to open db file in 'nix/var/nix/db/db.sqlite'
I'm attempting to finish the setup for plutus pioneers cohort3 on wsl2 (Windows 10) with Ubunutu 20.04. When I run the command:
nix --extra-experimental-features nix-command build -f default.nix plutus.haskell.packages.plutus-core.components.library
I get:
error: executing SQLite statement 'pragma synchronous = normal': unable to open database file (in '/nix/var/nix/db/db.sqlite')
I have already created /etc/nix/nix.conf to configure nix with the IOHK binary cache. I also checked and there is no var folder within the nix directory. Did I fail to create a db along the way or is something else amiss?

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

I had success by uninstalling/removing Nix, and then installing it again
Uninstalling:

remove the . "$HOME/.nix-profile/etc/profile.d/nix.sh" line in
your ~/.profile or ~/.bash_profile
rm -rf $HOME/{.nix-channels,.nix-defexpr,.nix-profile,.config/nixpkgs}
sudo rm -rf /nix

Reinstalling:

sh <(curl -L https://nixos.org/nix/install) --no-daemon
. $HOME/.nix-profile/etc/profile.d/nix.sh

You need to change the permissions on your /nix directory.
If you run this command you should be able to move forward:
chmod 775 /nix

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

add code in-line with enter code here

I had this problem yesterday and I found that shutting down the distro and restarting it after installing nix worked to fix this issue, it may work for you as well.

Exit out of the ubuntu distro
In a windows terminal (powershell or whatever) use wsl -l -v to see the running distros
Then use wsl --terminate <DistributionName> to stop the distro
Then use wsl --distribution <DistributionName> to start the distro again
Now you can try to build again.

Here's where I found the wsl commands -
https://winaero.com/terminate-running-wsl-linux-distro-windows-10/

On another note you should be using the plutus-apps repo not the plutus repo.
Here's a link to a doc from another pioneer who setup the environemnt with WSL that may help you -
https://docs.google.com/document/d/1mLyuGmCvZLqFotpVElbhYR5Q6PUatGxSeGuulJ1izJA/edit

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

deleting the /nix/var directory
and then running
nix build -f default.nix docs.site --extra-experimental-features nix-command
fixed the
error: executing SQLite statement 'pragma synchronous = normal': unable to open database file (in '/nix/var/nix/db/db.sqlite')
error for me.

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


text:
Compiler Error {-# LANGUAGE DataKinds #-}
I try to compile EnglishAuction.hs code in playground web app and keep on getting compiler error.
"[compiler] [E] loadObj "/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": failed"

I just removed the module section of the code in EnglishAuction.hs and paste it into playground web. It work and no compiler error.
module Week01.EnglishAuction
( Auction (..)
, StartParams (..), BidParams (..), CloseParams (..)
, AuctionSchema
, start, bid, close
, endpoints
, schemas
, ensureKnownCurrencies
, printJson
, printSchemas
, registeredKnownCurrencies
, stage
) where


text:
Latest Repository
I cloned the latest Plutus-apps repository:
git clone https://github.com/input-output-hk/plutus-apps
Then afterwards when uploading the latest version with commit hash:git checkout 7f53f18dfc788bf6aa929f47d840efa1247e11fd
Terminal responds with:reference is not a tree: 7f53f18dfc788bf6aa929f47d840efa1247e11fd
What did I do wrong?

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.

You will need to run
plutus-apps $ git fetch --all

prior to
plutus-apps $ git checkout 7f53f18dfc788bf6aa929f47d840efa1247e11fd

The first one will make sure you have the most recent view of the git repository from upstream. The second will then checkout to the provided revision. git checkout does not automatically do a git fetch.


text:
(Solved) error:\n Variable not in scope: main :: GHC.Types.IO a0 in English Auction
I'm trying to compile the English Auction script on a local plutus-playground-client session and I'm getting this error:
 error:\n    Variable not in scope: main :: GHC.Types.IO a0

Any help on why this is?

You have to delete the module declaration at the top of the file. Try that and recompile. Lars mentions this here: https://youtu.be/K61Si6iQ-Js?t=86
P.S. I missed this originally as well!

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

Yes removing the module declaration works. Sorry to miss that!


text:
Plutus Playground Client fails to load: npm ERR! code ELIFECYCLE
$ nix --version
nix (Nix) 2.5.1

$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 8.10.4.20210212

$ cat /etc/issue
Ubuntu 21.10 \n \l

I have the plutus playground server running inside a nix-shell in another terminal:
$ netstat -natlp | grep plutus
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      3772215/plutus-play

Then i get into another nix-shell, cd to the plutus-playground-client (i already did git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a) and run npm start or npm run start
This is what i'm getting anyway:
16:33 :) ../plutus-playground-client # npm start

> plutus-playground-client@1.0.0 start /home/atcasanova/plutus/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 [RawError "/nix/store/xvj7mn015p98yypgwvzk4cq31b9j5xq7-plutus-ledger-constraints-lib-plutus-ledger-constraints-0.1.0.0/lib/x86_64-linux-ghc-8.10.4.20210212/libHSplutus-ledger-constraints-0.1.0.0-EN1avZ1OL0p63dNgqFuLBm-ghc8.10.4.20210212.so: undefined symbol: plutuszmledgerzmapizm0zi1zi0zi0zmKIxxnVyHrLq1ei02VYnb9P_PlutusziV1ziLedgerziBytes_zdwzdcshowsPrec_info\n"]))
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 ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-01-13T19_34_10_171Z-debug.log

I guess it's fixed.
At first i was running the ubuntu-packed version of nix-bin, which was 2.3.10.
I then downloaded the newest version of nix following these instructions.
After loading the new version (since i've installed it with the --no-daemon flag i had to load a shell script) it kept malfunctioning. Then another user on the discord channel told me it would be nice to do a garbage collect and rebuild the server since i changed versions.
nix-collect-garbage
nix-build -A plutus-playground.server

It took a few hours but when it was done i've got everything running.

I was able to overcome this issue by running GC_DONT_GC=1 npm start.

What exactly that means?

Can you make this answer more clear and explicit?  We are catering to varied skill levels and many visitors whose native language is not English.  The few extra minutes it takes to make the answer clear and precise benefits everybody.

It will also make it more likely that @alfredo will mark it as the accepted answer. ;-)

Please make sure you have purescript-servant-support and purescript-bridge-json-helpers installed
Have you tried installing those ?

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

I had the same issue with the commit from the setup guide 41149926c108c71831cfe8d244c83b0ee4bf5c8a. Using different commit worked for me. You can try git checkout 7f53f18dfc788bf6aa929f47d840efa1247e11fd.

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


text:
plutus-playground-client crashes on Intel Mac (Big Sur)
After setting up environment for cohort 3 of the pioneers program, running the plutus-playground-client crashes on my Intel Mac (Big Sur).
I've been able to successfully set up Nix and all the code repos as described in course materials and from other sources (like the list provided in Lessons Learned setting up plutus-playground - feedback welcome). When I run the plutus-playground-server it seems to run with the following output (although I'm a little bothered about the env var warnings):
[nix-shell:~/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client]$ plutus-playground-server
plutus-playground-server: for development use only
[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

But when I run
npm start from within nix-shell, the client crashes
as seen here
[nix-shell:~/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client]$ npm start

> plutus-playground-client@1.0.0 start /Users/stevenmason/Documents/__projects/cardano/code/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-6c4731ae725049b4/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-6c4731ae725049b4/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-6c4731ae725049b4/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/stevenmason/.npm/_logs/2022-01-13T19_43_24_861Z-debug.log

The contents of the log is
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin/node',
1 verbose cli   '/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin/npm',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.14.14
3 info using node@v14.17.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle plutus-playground-client@1.0.0~prestart: plutus-playground-client@1.0.0
6 info lifecycle plutus-playground-client@1.0.0~start: plutus-playground-client@1.0.0
7 verbose lifecycle plutus-playground-client@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle plutus-playground-client@1.0.0~start: PATH: /nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/stevenmason/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client/node_modules/.bin:/nix/store/d9000clw08vx5ls6rjzshr6w1dmp2hkw-bash-interactive-5.1-p12/bin:/nix/store/r3cw1f1b49440awbyk870vhn4gs4pvq9-ghc-shell-for-packages-ghc-8.10.4.20210212-env/bin:/nix/store/jx31ah14p6pf488i7wwd88y2izmxi0wj-clang-wrapper-7.1.0/bin:/nix/store/xhijdap7ln3nw867cq6m3knshww9f2rn-clang-7.1.0/bin:/nix/store/crjmgrws5w2pjhm5k887m93rrkcf36hb-coreutils-8.32/bin:/nix/store/4j3q5kmmdwkgppn6g8hna8wg6a4zrvxd-cctools-binutils-darwin-wrapper-949.0.1/bin:/nix/store/falx4gakl6k1q64aqr4f8mvy8vfqcqaq-cctools-binutils-darwin-949.0.1/bin:/nix/store/krhkk38bd42357y2z158l3r09k2mdj51-pkg-config-wrapper-0.29.2/bin:/nix/store/51pqfp0f7h03jsvh2a4fyimbp2hkzwgp-alex-exe-alex-3.2.6/bin:/nix/store/4klljapwi8g41xv815af7gfd7sv4rjws-happy-exe-happy-1.20.0/bin:/nix/store/mjs3g246lbdp413axx5j10jxpzkkwlbw-doctest-exe-doctest-0.18.1/bin:/nix/store/vy0swc77m6nz61awgsipg03s8mszif8i-editorconfig-core-c-0.12.1/bin:/nix/store/qw2j33zylr4gz77rbrnrdqg56sqdlw9x-ghcid-0.8.7-bin/bin:/nix/store/hmmba0bqn54xw13w8hm2rcdy504lr9js-jq-1.6-bin/bin:/nix/store/d6f5yc829p8nmaccs67wkjs5bwqa1770-nix-flakes-alias/bin:/nix/store/ds6m4l0xhv850pqds6y6cxipqrf4r64a-nixpkgs-fmt-1.1.0/bin:/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin:/nix/store/8wyjxi4phrhrvmjsvbcdxjff88hmvq21-shellcheck-0.7.2-bin/bin:/nix/store/3gzgnpg6nf6qa120s7gz5xpb6f0pf80z-sqlite-3.35.5-bin/bin:/nix/store/j7f4sgvfcnvz59ay3jmz5212xgb5pd6v-stack-2.7.3/bin:/nix/store/kkx3hcr3px00wpmadnjj3cldqnsd9vlc-python3.9-yq-2.12.2/bin:/nix/store/ad19ya4siaxhz63w0m8xh97067iahks0-python3-3.9.6/bin:/nix/store/kzbbn2k96mgjrk8rg152073af51hj2sh-python3.9-argcomplete-1.12.3/bin:/nix/store/05zmnmy39zp5j3prwfhiy84zv98c7v1d-python3.9-chardet-4.0.0/bin:/nix/store/3j6ljn1bc604k8v5ri16q8bz5l8nl7za-python2.7-setuptools-44.0.0/bin:/nix/store/8vdbhdsmlhvll54pwmkkrhvpmcmh7vz8-python-2.7.18/bin:/nix/store/mvyh8afbd47kfpqjsgpnbv4ajb670kca-z3-4.8.10/bin:/nix/store/7c096h8vzvl96ni4wklf26rzf42p4pyq-cabal-install-exe-cabal-3.6.2.0/bin:/nix/store/qxzkl3pvmj1agri8a4k6awd4gsd61in2-cardano-cli-exe-cardano-cli-1.32.1/bin:/nix/store/8mawdcyar3ywar6c16p258lfb25qd3qn-cardano-node-exe-cardano-node-1.32.1/bin:/nix/store/wh73413j6pylms06mza4462xzlpbli3x-cardano-wallet-exe-cardano-wallet-2021.12.15/bin:/nix/store/rwb735hnzskimykgcnw5i42p9hyd0a2k-cardano-repo-tool-exe-cardano-repo-tool-0.1.0.0/bin:/nix/store/hnj1vx7z3idysp0ykyq9vf935ak3cgha-fix-png-optimization/bin:/nix/store/fraynam5fa5q6q7flf3alpcp6hfxipp5-fix-purty/bin:/nix/store/aa2xihy0bxkkgf3j78sc2crb61y57v6h-fix-stylish-haskell/bin:/nix/store/5fhjibn8vnkmbaivzdw62yg34qbykw3m-haskell-language-server-exe-haskell-language-server-1.3.0.0/bin:/nix/store/7cbz32gyp6l5m0i97zqam4lzdzgiv2m8-haskell-language-server-wrapper/bin:/nix/store/zwkmxz2bgyzvhyf0xxhnwnvg885lnyzh-hie-bios-exe-hie-bios-0.7.6/bin:/nix/store/2hh7ba4f243q65i9pk0xli6g55k384z9-hlint-exe-hlint-3.2.7/bin:/nix/store/1hdj8zn64h1q10g9kw1v75s826lj2ydz-pab-nami-demo-generate-purs/bin:/nix/store/zrqbg3v8rynqzzhjcd86zb9yyin3cjc8-pab-nami-demo-server/bin:/nix/store/2nr8xfy3zqdgxfmxlc3r48gijfdwbnrf-plutus-playground-generate-purs/bin:/nix/store/601kdlvidgan842yfklrmvpbz6a5xkf7-plutus-playground-server/bin:/nix/store/m8ixb6svc1l8fzxlh67c4qm96vbb6d1i-node_psa-0.8.2/bin:/nix/store/2d664y3zphch8qg72cg19hgprxrhcn9l-node_purescript-language-server-0.15.8/bin:/nix/store/rnvv5rz6hi23r0vhply8dmp2wjdmc7mx-purescript-v0.14.5/bin:/nix/store/2nhbwz6k00njy334ad3d7k9wf0kgjfj6-purty-7.0.0/bin:/nix/store/qvgi2dmj9h91hiasmpmd9bar9qzv9l4y-spago-0.20.3/bin:/nix/store/wacwgza57b0f3qvbrcaw7sbvxyvn46wi-spago2nix/bin:/nix/store/b88jr6n685vp762f5y81kq50saw0p9jm-stylish-haskell-exe-stylish-haskell-0.13.0.0/bin:/nix/store/isp8r9zcpgl8283vplckpidlc6g6pxmj-updateMaterialized/bin:/nix/store/ry116681l3qpfvjj0wp4alfabp2fnkk5-update-client-deps/bin:/nix/store/hrxaiplqwgf0m6i27ffgl0hza1hkvri5-build-and-serve-docs/bin:/nix/store/a1w9dirw10sk22nk8f9yykfxdm428lxx-python3-3.9.6-env/bin:/nix/store/fci25bpkavmg481ws49qdjvv9k4vmm6y-ncurses-6.2/bin:/nix/store/qgygs5g9l0zxhs8fzjjqpmmlzps1hlrd-libiconv-50/bin:/nix/store/crjmgrws5w2pjhm5k887m93rrkcf36hb-coreutils-8.32/bin:/nix/store/2fzds9cqx148i1lf84sc9i0982bv9rbx-findutils-4.8.0/bin:/nix/store/adigdkh0pibb4afqf5q2sv3503ln0iyb-diffutils-3.7/bin:/nix/store/z6ih791dzyjvdqm8gl5glz065kk8zh7p-gnused-4.8/bin:/nix/store/lr3fvwhvd8zpmjbibd3h02qdx85mxrv4-gnugrep-3.6/bin:/nix/store/phq0s0i1vhlvs7y77gyygnyd1zm76mlh-gawk-5.1.0/bin:/nix/store/q7wxq69v35d0bxiqrycldz00wg9kxqzd-gnutar-1.34/bin:/nix/store/3n9fvf4ybdwizym6cwnjf6f57p7mvrab-gzip-1.10/bin:/nix/store/j998frnsa1hxkfbysq0bkw6hjfrd928v-bzip2-1.0.6.0.2-bin/bin:/nix/store/aqrq990va9j1v6gvrgxksr5av9vpcxz3-gnumake-4.3/bin:/nix/store/715y5lnw12vdcc3hh9sc9vbkdi6c83x6-bash-4.4-p23/bin:/nix/store/cqadarnj29fpv1vm8bzbh6dpb8aaxzjz-patch-2.7.6/bin:/nix/store/00vcq1i9x1dwwn21dqkagybcxa1lcnwi-xz-5.2.5-bin/bin:/Users/stevenmason/.yarn/bin:/Users/stevenmason/.config/yarn/global/node_modules/.bin:/Users/stevenmason/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/Users/stevenmason/.yarn/bin:/Users/stevenmason/.config/yarn/global/node_modules/.bin:/Users/stevenmason/.pyenv/shims:/Users/stevenmason/Documents/__projects/temp_gcloud/google-cloud-sdk/bin:/Users/stevenmason/.nvm/versions/node/v10.16.0/bin:/Users/stevenmason/.rvm/gems/ruby-2.5.5/bin:/Users/stevenmason/.rvm/gems/ruby-2.5.5@global/bin:/Users/stevenmason/.rvm/rubies/ruby-2.5.5/bin:/usr/local/opt/python/libexec/bin:/usr/local/sbin:/Users/stevenmason/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/texbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/git/bin:/Users/stevenmason/.rvm/bin:/Library/android-sdk-macosx/tools:/Library/android-sdk-macosx/platform-tools:/Applications/Postgres.app/Contents/Versions/9.4/bin:/Library/android-sdk-macos/tools/emulator:/Library/android-sdk-macos/tools/tools:/Library/android-sdk-macos/tools/tools/bin:/Library/android-sdk-macos/tools/platform-tools:/Library/android-sdk-macos/tools/emulator:/Library/android-sdk-macos/tools/tools:/Library/android-sdk-macos/tools/tools/bin:/Library/android-sdk-macos/tools/platform-tools:/nix/store/lx1v7fr9487halyyzk42a0n9yy285vcy-python3.9-pre-commit-2.13.0/bin
9 verbose lifecycle plutus-playground-client@1.0.0~start: CWD: /Users/stevenmason/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client
10 silly lifecycle plutus-playground-client@1.0.0~start: Args: [
10 silly lifecycle   '-c',
10 silly lifecycle   'plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev'
10 silly lifecycle ]
11 silly lifecycle plutus-playground-client@1.0.0~start: Returned: code: 1  signal: null
12 info lifecycle plutus-playground-client@1.0.0~start: Failed to exec start script
13 verbose stack Error: plutus-playground-client@1.0.0 start: `plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:400:28)
13 verbose stack     at ChildProcess.<anonymous> (/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:400:28)
13 verbose stack     at maybeClose (internal/child_process.js:1055:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid plutus-playground-client@1.0.0
15 verbose cwd /Users/stevenmason/Documents/__projects/cardano/code/plutus-apps/plutus-playground-client
16 verbose Darwin 20.6.0
17 verbose argv "/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin/node" "/nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4/bin/npm" "start"
18 verbose node v14.17.4
19 verbose npm  v6.14.14
20 error code ELIFECYCLE
21 error errno 1
22 error plutus-playground-client@1.0.0 start: `plutus-playground-generate-purs && npm install && npm run install:spago && npm run build:webpack:dev`
22 error Exit status 1
23 error Failed at the plutus-playground-client@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

The error in this log references /nix/store/qmv0vl6qk7j51pw10dghn91k0liddcki-nodejs-14.17.4 which I don't see in /nix/store.  I assume this is likely the problem, but I'm new to nix and don't know how to fix this.  I see lots of other 'packages' in the store but not this one. Can someone please tell me what I can try to get this working.
BTW, this problem seems similar to Error Starting plutus-playground-client (posted Sep 2021), but no one has provided and answer to that question
Thanks

I've been trying to reproduce your issue, but wasn't able to. Could you please provide where you got the git clone command from (for reference) and provide your current git revision? You can obtain that from the plutus-apps folder with plutus-apps $ git rev-parse HEAD.

Also, to get the contract to properly compile on the server end, I had to include the same command as was mentioned to start the client: GC_DONT_GC=1 plutus-playground-server

could only mark one answer as correct, but this was need to to get everything working.

It did get this working, but for completeness, I got the git clone from the Github repo (copy to clipboard).  And git rev-parse HEAD gave me 41149926c108c71831cfe8d244c83b0ee4bf5c8a

To make npm work, you can try GC_DONT_GC=1 npm start.
However; I found the way the playground starts using nix-build in the script to start the server and running npm to get the frontend fickle and convoluted. My coworker Shay and I worked on https://github.com/input-output-hk/plutus-pioneers. This is still pretty raw and hopefully the logic will eventually be added into plutus-apps repository, but here's a quick run-down of how to use it:
Make sure you have nix 2.5 (or some 2.4pre's will work as well, but do yourself a favor and upgrade to nix 2.5).
In nix.conf (file where binary cache is setup) add:
experimental-features = nix-command flakes

Then just run: nix develop github:input-output-hk/plutus-pioneers
When that completes run start
At that point you'll have frontend and backend playground running and accessible in browser with self-signed certificate at  https://localhost:8009/. You can also get all the plutus docs at  https://localhost:8009/doc.
cardano-cli is in the PATH and can find the node socket by default. To validate that you can run cardano-cli query tip --testnet-magic 1097911063
To shut services down when you're done, just run stop. If you run into any bugs using, please file an issue on the GH tracker.

Thanks for your suggestion.  Adding the GC_DONT_GC=1 worked for me.

Curious about your other advice though.  I have nix 2.5, but wondering where do I run the nix develop github:input-output-hk/plutus-pioneers from - what directory?  And also what is the context for using this?  Is this an alternative/preferred way that insiders use to start up the playground?   Also don't have cardano-cli.  I'll have to get it (and build it I assume)

This is my teams effort to improve the UX for all pioneers. I hope to get it upstreamed into plutus-apps but we're still working on tweaking it at the moment. Biggest drawback right now is on a mac it's building a bunch of stuff not in the binary cache.


text:
git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a for English Auction doesn't work
According to cabal.project script for the English Auction, the git branch for this plutus script is:
source-repository-package
    type: git
    location: https://github.com/input-output-hk/plutus-apps.git
    tag: 41149926c108c71831cfe8d244c83b0ee4bf5c8a

But when I do a git checkout of the plutus-apps, I am unable to run the plutus-playground-server.
However when I use as different branch as discuss here:
(Solved) Error running plutus-playground-client in Linux
I can run both server and client without a hitch but unfortunately the project script doesn't compile as it's in the wrong repository.
Is there a way to correct this?

I used a more recent one 7f53f18dfc788bf6aa929f47d840efa1247e11fd and it all worked.

@Alex
Yes that checkout allows me to build the server but I get this error when running the client:
/bin/plutus-playground-server: No such file or directory

So I am able to run the server but not the client on that commit.


text:
How to set plutus-apps NixOS options on Mac
This is the first time I've used nix. On plutus-apps readme, I changed nix.conf but I don't know how to do this step.
2.On NixOS, set the following NixOS options:
nix = {
binaryCaches          = [ "https://hydra.iohk.io" "https://iohk.cachix.org" ];
binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=" ];
};

If you're using an M1 Mac follow these instructions https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md
You should probably uninstall Nix first though (scroll to the bottom of that page to get a script for an easier uninstall)

I followed steps 4-6 in https://docs.plutus-community.com/docs/setup/MacOS.html and those worked for me (I have an Intel Mac - Big Sur). You could try them and see if they work for you. Those steps are:
Step 4. Edit the /etc/nix/nix.conf file:
nano /etc/nix/nix.conf
note, you will have to create that file if it doesn't exist
Step 5 - Add these lines to the file:
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:DpRUyj

Step 6 - Restart your computer - important that you do this

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


text:
Difference in the commit chosen between Plutus Pioneers lecture and given documents
When building plutus-apps locally I encountered a difference between the document that was shared a few days ago and the first lecture of Plutus Pioneers.
The document says the following:
git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a

In the first lecture of plutus pioneers we have the following:
git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a

Should I build plutus-apps again with the commit version specified on the video or the version described in the documents is fine?

As I don't have enough reputation to comment yet, I'll post my comments here. In your question you have used the same commit number from both sources (document and video). I assume that's a typo. The commit listed in the video https://www.youtube.com/watch?v=zPaDp4R9X7o&list=PLNEK_Ejlx3x2nLM4fAck2JS6KhFQlXq2N&index=3 (time 4:24) is 41149926c108c71831cfe8d244c83b0ee4bf5c8a and that matches what's in plutus-pioneer-program/cabal-project. What was the commit in the document (I can't determine which source you used)?

@SteveMason Welcome aboard!  Please follow the guidelines in the help center and accept the limitations that your account has.  I know it is frustrating but they are there for the benefit of the community and the quality of the site.  We all benefit in the long run.

@SteveMason Here's how to build up your reputation so that you can comment: What is reputation?

Each week there will be a new id/tag for the git checkout, as Plutus is under constant development. Use the one from the lecture this week, and then next week use the one from next week's lecture.
Here's a video which helps explain commits and checking out. I'm new to this stuff as well so it helped me understand a bit better.
https://www.youtube.com/watch?v=7y_htm0sw-I

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

I used git checkout 7f53f18dfc788bf6aa929f47d840efa1247e11fd and it worked. It's a bit more recent.

The commit in the lecture, which is the one in the cabal file of the first week code works fine and I would recommend using that to be in line with the lecturer.


text:
How does the English Auction contract handle concurrency?
In the English Auction example, let's say both wallet 2 and 3 submit a transaction to bid at the same time.
(In the simulator, I just don't add a wait time between wallet 1&2 bids).
When Wallet 1 closes the auction, nothing happens in the simulator - only the first transaction is seen :

In general, how does Cardano handle a situation when 2 wallets (say from different geographical locations) submit transactions at the same time ? Do both transactions fail or just 1 ?

Whichever transaction the block producer decides to include in block will succeed. Only one can succeed though.
The auction datum exists on a UTxO and each UTxO can only be spent once. In the case of the auction, the validator requires a new UTxO with a new Datum is created to replace the spent TxO. That new Datum isn't visible until the next block though.
Concurrency is a popular topic of conversations in the community and there are many ways a dApp designer can allow participants to interact concurrently. It often requires architectures that are unique to Cardano. Check out this post which includes a lot of helpful resources about concurrency.

To add to the above, this is a simple example and doesn't have concurrency support in it. A more complex script would likely have some sort of concurrency model.


text:
What goes inside the block?
After going through lecture 1, where can I find out more information about what is stored in each block in blockchain ?
I am guessing that all the UTxOs and the script addresses will be there, as well as the (on-chain) plutus scripts themselves.
If the UTxOs are all in the blockchain, is it the user/wallet responsibility to safely maintain all the UTxOs that he owns ?
Thanks!

The UTxO set is not on the blockchain. Blocks contain transactions (including input UTxO references, output addresses, scripts, certificates (eg for delegation and other purposes) etc.
The UTxO set is an ephemeral data structure than can be built from the original genesis state and then apply blocks to it.

When, say, Alice sends money to Bob, how does Bob know which UTxO output belongs to him (so that he can consume that money) ? Is it the job of the wallet to scan through all new UTxOs that are generated in the blockchain, then compare this new UTxO with Bob's wallet -  and if it matches, add the new UTxO to Bob's wallet ? Is this a correct assumption ?

Yes, that is correct.


text:
First time compiling sample Plutus code in local Plutus Playground failed. Can't figure out why
I've been a mainframe programmer my for decades.  Never developed on small server platforms. So the biggest challenge I'm having is dealing with the nerve wracking OS setup, Github cloning, server building, nix running craziness,  etc etc etc
These are the steps I accomplished leading up to my Failed Compile.
I followed The Plutus Playground Local Instance Instructions in the Plutus Env: Setup Starter Pack
1 Installed WSL (Ubuntu)   (couldn't get git to work until I did this.) Tried multiple thing. But only this worked.
then:

Download the plutus-apps repository: git clone https://github.com/input-output-hk/plutus-apps
COMPLETED

Go to the latest commit of the repository: git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a
COMPLETED

At top of this repo, nix-build -A plutus-playground.server
COMPLETED

4 Enter nix-shell then:      This ran literally all day and finished at the $prompt
 COMPLETED
after nix-shell build stopped entered these two cmnds:
[nix-shell:~/plutus-apps]$ cd plutus-playground-client
[nix-shell:~/plutus-apps/plutus-playground-client]$ npm run start

 COMPLETED
I then navigated to localhost in browser which loaded the demo code to be compiled.
I hit the compile button , it displayed a Compilation Failed message and display the following errors in the Linux Command window:
 FAILED

"This ran literally all day and finished at the $prompt", did you add the IOG caches to your nix configuration? That could explain why it built so much.

No, I saw mention of that after the fact in the week #1 Exercises.

No, I saw mention of that after the fact in the week #1 Exercises.   I figured at some point I should go back and do that.  It def should've been in the Plutus Env: Setup Starter Pack  instructions, it would've saved me a lot of time.   I have no choice but to push through all the apps I don't know (Linux, Nix, Haskell etc and learn on the fly through trial and error.     Thanks man.

FYI, I answered another question that's similar but not the same here that shows some details of a new tool I created that's a little less convoluted. It uses the power of nix to abstract away a lot of the ugliness. https://cardano.stackexchange.com/a/6464/382

Notwithstanding the value/importance of cache issue pointed out by @angerman, the cause of the main question of your OP (i.e., the error on port 8080) appears to be that you started the client on 8009, but didn't show any steps for starting the server.
Open a second terminal session, enter the nix-shell, and start the server, and you should be set.

Thanks, this is great.  I see that I missed that step on the Setup Starter Pack.   Can I ask another quick question?       Cache setup says to update /etc/nix/nix.conf      Where is the /etc folder?   I haven't been able to locate it.   Do I have to create it?  If so what folder do I create it in.

You should find the necessary etc/ folder from your root directory.
In a terminal, you can do the following from anywhere to get there.
:~/plutus-apps$ cd /
bring you to this prompt...
:/$
that is your root dir/path (/) prompt
now;
:/$ ls
...and you should see something like this...
bin   dev  home  lib32  libx32      media  nix  proc  run   snap  sys  usr
boot  etc  lib   lib64  lost+found  mnt    opt  root  sbin  srv   tmp  var
Note the etc/ dir.
Now that you know where it is, from here just change to the etc/ directory.
If you need to make a nix folder, simply use the mkdir command.
I am not sure how comfortable you are in the bash shell. If you are, here is a handy concatenated line to mkdir and create a nix.conf file at the same time:
sudo mkdir folder && sudo touch $_/file.txt

or -> sudo mkdir etc/nix/ && sudo touch $_/nix.conf
I hope that helps you out with this. Good luck!

This my friend is excellent!!  Thank you so much


text:
nix installation issue on Fedora 35
I just ran sh <(curl -L https://nixos.org/nix/install) --daemon  to install nix via its installation instructions. I proceeded through the installation menu where it backs up your bashrc and other config files. y on sudo permissions, it installs and doesn't complain.
systemctl status systemctl status nix-daemon.service
daemon running with no issues. However when I execute nix-shell I get
nix-shell: /nix/store/jsp3h3wpzc842j0rz61m5ly71ak6qgdn-glibc-2.32-54/lib/libc.so.6: version GLIBC_2.33' not found (required by /usr/local/lib/libsodium.so.23)

When I execute nix-env --version same error.
I've uninstalled / reinstalled nix several times now and getting the same error. Checked Fedora 35 glibc version  ldd --version and get back 2.34
Any advice on getting nix-shell to execute properly in Fedora 35?

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

Where id you run nix-shell, in which folder?

Fixed. I had the Cardano node previously installed which involves compiling and installing libsodium. What I did was go into the libsodium folder and sudo make libsodium uninstall Then re-ran nix installation and now I get a nix-shell.

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

For me the make command failed and I had to go to /usr/local/lib, created a backup directory and moved all libsodium.* files to it. This removed that existing lib and nix installed fine.

I went ahead and got ahold of a fedora 35 install. I was not able to install the --daemon version, due to fedoras SELinux enforcement. I did however manage to install nix in single user mode.
and nix-shell works.
$ nix-shell -p hello
these 42 paths will be fetched (61.29 MiB download, 281.92 MiB unpacked):
...
[nix-shell:~]$ hello
Hello, world!

[nix-shell:~]$

Sadly I'm getting the same error with single user mode installation.
sh <(curl -L https://nixos.org/nix/install) --no-daemon
copying Nix to /nix/store...........................................
/nix/store/azld8vfyqb4fx6bxdz28n3nw23nghf88-nix-2.5.1/bin/nix-store: /nix/store/jsp3h3wpzc842j0rz61m5ly71ak6qgdn-glibc-2.32-54/lib/libc.so.6: version `GLIBC_2.33' not found (required by /usr/local/lib/libsodium.so.23)
/tmp/nix-binary-tarball-unpack.PWdwdaEWRp/unpack/nix-2.5.1-x86_64-linux/install: unable to register valid paths

I had the same issue. I noticed it happens when you had/have previously setup a Cardano node since that required setting up libsodium. The issue is with the LD_LIBRARY_PATH envronment variable added in the process.
To solve it I commented out that variable export in the ~/.bashrc file. You may need to restart the terminal for the change to take effect.


text:
How does Mithril increase Cardano network throughput?
Charles talks about Mithril as a means to light client wallets.
My understanding of mithril is it takes a screenshot of sorts of upcoming blocks and by representing the blocks in a lighter manner for validation it can improve the network throughput.
So the reason this speeds up wallets is because it's less data to download.
I can understand how this helps for light client wallets but I understand less so how it helps increase network throughput. Is it that it allows for quicker validation of blocks because its less information to be passing around? At that point is it fair to say it doesn't speed up the network so much but instead would allow Cardano to speed up the network if they wanted to move to a more DAG style network design?

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

Blockchain throughput is a measure of how many actions are completed within a given time frame. You are absolutely right saying, that if the fewer Full Node wallets downloading the entire blockchain at a certain point in time, the higher the throughput of the blockchain is. Cardano "Light" Nodes (that are somewhat similar to SPV nodes in Bitcoin, but work slightly differently) can verify payments without needing to download the entire blockchain. Thus, it directly affects the throughput – this is true due to the fact that Cardano does not yet have a fair P2P connection.
However, there's one non-obvious thing touching Cardano decentralization. Read about it here.


text:
VSCode + Docker setup problems on Mac (Intel)
I am following the steps as described in the repository, using VSCode and Docker.
https://github.com/input-output-hk/plutus-starter
All the dependencies looks good, but it failed on building the cardano-node.
Failed to build exe:cardano-node from cardano-node-1.30.0.
Build log (
/Users/rogeriodeleonpereira/.cabal/logs/ghc-8.10.7/crdn-nd-1.30.0-7743fe52.log
):
Configuring executable 'cardano-node' for cardano-node-1.30.0..
Preprocessing executable 'cardano-node' for cardano-node-1.30.0..
Building executable 'cardano-node' for cardano-node-1.30.0..
[1 of 2] Compiling Paths_cardano_node ( dist/build/cardano-node/autogen/Paths_cardano_node.hs, dist/build/cardano-node/cardano-node-tmp/Paths_cardano_node.o )
[2 of 2] Compiling Main             ( app/cardano-node.hs, dist/build/cardano-node/cardano-node-tmp/Main.o )
Linking dist/build/cardano-node/cardano-node ...
Undefined symbols for architecture x86_64:
  "_crypto_vrf_proof_to_hash", referenced from:
      _Lcjn0_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
  "_crypto_vrf_prove", referenced from:
      _LcjgN_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
  "_crypto_vrf_verify", referenced from:
      _LciZz_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
  "_crypto_vrf_secretkeybytes", referenced from:
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_signKeySizzeVRF_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
      _LcjD1_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
  "_crypto_vrf_keypair_from_seed", referenced from:
      _Lcj9q_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
  "_crypto_vrf_sk_to_pk", referenced from:
      _Lcj6R_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
  "_crypto_vrf_publickeybytes", referenced from:
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_verKeySizzeVRF_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
      _Lcjrs_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
  "_crypto_vrf_proofbytes", referenced from:
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_certSizzeVRF_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
  "_crypto_vrf_outputbytes", referenced from:
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_zdfVRFAlgorithmPraosVRFzuzdcsizzeOutputVRF_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_vrfKeySizzeVRF_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_verify1_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
  "_crypto_vrf_seedbytes", referenced from:
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_zdfVRFAlgorithmPraosVRFzuzdcseedSizzeVRF_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_zdfVRFAlgorithmPraosVRF4_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_zdfVRFAlgorithmPraosVRF5_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
      _crdnzmcryptzmprszm2zi0zi0zmac404e8e_CardanoziCryptoziVRFziPraos_zdfVRFAlgorithmPraosVRF2_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
      _LshDn_info in libHScrdn-crypt-prs-2.0.0-ac404e8e.a(Praos.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
cabal: Failed to build exe:cardano-cli from cardano-cli-1.30.0 (which is
required by exe:plutus-starter-pab from plutus-starter-0.1.0.0). See the build
log above for details.
Failed to build exe:cardano-node from cardano-node-1.30.0 (which is required
by exe:plutus-starter-pab from plutus-starter-0.1.0.0). See the build log
above for details.

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

Can you please provide some more context which instructions you are following exactly, so that the instruction can potentially be amended to be clearer?

These missing symbols _crypto_vrf_* are in libsoidum-vrf library. You seem to be linking the cardano-node against your systems provided libsodium. That sadly doesn't work as the official libsodium does not have the vrf extension.

Thank you for the answer. In my first attempt to build it, I got an error saying that libsodium was missing. I used brew to install it, and in my second attempt, I got the error you just commented. I will remove the libsodium version I have and I will try the version in the repository you shared.

After several more attempts, I figured out that I was building using the wrong terminal window. After changing my docker settings to increase the memory and swap sizes, I made it with no problem.

Can you accept this answer so the question will be closed since this is resolved?


text:
How to create a smart contract constant variable?
I am using state machines to create a smart contract. How can I create a variable that will be defined by the user when it runs the first step of the state machine and that then can't be modified anymore?
In other words, it's a variable that is created by using the smart contract endpoints but that can't be modified later on until the state machine reaches its end.
Finally, would it be possible to make this validation on-chain?

You could modify your datum type to something like so: {constants: {...}, old_datum: {...}}
Then, make your old validations take old_datum (you could unwrap old_datum as the same name as your current datum even), and validate output constants==input constants. You will want an exception to this rule if the input does not come from the script, to allow setting the constants at first, so you could logically enforce something like "for each input utxo, if that input resided at this script, enforce that there is some unique output utxo with the same constants".

Accidentally made a new answer when I meant to update old one.


text:
plutus-playground-server exits with with network error
When starting the plutus-playground-server in a nix-shell on an Ubuntu 20.04 machine (ref. step 4 in the plutus setup instructions), it terminates with the following error:
Interpreter ready
plutus-playground-server: Network.Socket.socket: unsupported operation (Address family not supported by protocol)

Coincidently, when attempting to start a daedalus wallet on this machine after upgrading from 4.5.2. to 4.6.0, the node crashes due to what appears to be an ipv6 issue (ref. If the ipv6 is disabled on the system, the node crashes on boot #3449). I'm wondering now whether these issues are related?
I believe I have the latest tools and libraries installed: ghc version 8.10.4.20210212, cabal version 3.6.2.0, nix version 2.5.1.
If the issue in Github is related, there's some speculation about NordVPN, which I use on that machine: Here's some details:
    /etc/sysctl.conf

    # Disable IPV6 to prevent IPv6 leaks with NordVPN
    net.ipv6.conf.all.disable_ipv6 = 1
    net.ipv6.conf.default.disable_ipv6 = 1
    net.ipv6.conf.lo.disable_ipv6 = 1
    net.ipv6.conf.tun0.disable_ipv6 = 1

> ip addr show

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 38:d5:47:25:6d:81 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s31f6
       valid_lft 49116sec preferred_lft 49116sec
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 52:54:00:82:ef:25 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN group default qlen 1000
    link/ether 52:54:00:82:ef:25 brd ff:ff:ff:ff:ff:ff
5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:95:7a:3c:75 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever

can you provide output of ip addr show?

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


text:
plutus-pab still not building
I had plutus-playground up and running with a prior commit, but am trying to get the latest version running. I have cloned everything fresh in a new folder. I have successfully run the following inside the plutus-apps directory.

git checkout 41149926c108c71831cfe8d244c83b0ee4bf5c8a
nix-build -A plutus-playground.client
nix-build -A plutus-playground.server
nix-build -A plutus-playground.generate-purescript
nix-build -A plutus-playground.start-backend

Now I am at plutus-pab. I am in bash. I have tried the following and received the following errors:

bash-3.2$ nix-build -A plutus-pab
error: attribute 'plutus-pab' in selection path 'plutus-pab' not found
bash-3.2$ GC_DONT_GC=1 nix-build -A plutus-pab
error: attribute 'plutus-pab' in selection path 'plutus-pab' not found
bash-3.2$ nix-build ./default.nix -A plutus-apps.haskell.packages.plutus-pab
Segmentation fault: 11
bash-3.2$ GC_DONT_GC=1 nix-build ./default.nix -A plutus-apps.haskell.packages.plutus-pab
this derivation will be built:
  /nix/store/yz5wyg4yv21xvwq9nmwb3bcb6fcvx30y-plutus-pab-0.1.0.0-coverage-report.drv
building '/nix/store/yz5wyg4yv21xvwq9nmwb3bcb6fcvx30y-plutus-pab-0.1.0.0-coverage-report.drv'...
sandbox-exec: pattern serialization length 83683 exceeds maximum (65535)
error: builder for '/nix/store/yz5wyg4yv21xvwq9nmwb3bcb6fcvx30y-plutus-pab-0.1.0.0-coverage-report.drv' failed with exit code 65;
       last 1 log lines:
       > sandbox-exec: pattern serialization length 83683 exceeds maximum (65535)
       For full logs, run 'nix log /nix/store/yz5wyg4yv21xvwq9nmwb3bcb6fcvx30y-plutus-pab-0.1.0.0-coverage-report.drv'.
bash-3.2$ GC_DONT_GC=1 nix-build ./default.nix -A plutus-pab
error: attribute 'plutus-pab' in selection path 'plutus-pab' not found
bash-3.2$

This is really feeling like broken code. What needs to be fixed to get this to work?

Which instructions are you following? The plutus-pab is a library.

The "canonical" instructions here, step 11.  https://docs.plutus-community.com/docs/setup/MacOS.html  I've gotten those other variations of the instructions for elsewhere, including Discord. Libraries still need to be built, don't they? My understanding is that all this code is actively being developed and changing. This does not act like a stable commit.

The issues you are seeing are from the nix tool that's being used. Sorry for asking more questions, as I can't reproduce this. What operating system is this, and what does nix --version report?

macOS Catalina 10.15.7 on two separate machines. Nix version 2.51. The problem may have been due to having "sandbox - true" in /etc/nix/nix.conf. That was a suggestion elsewhere but appears to not be currently correct. I now have everything successfully running and am attempting to re-trace my steps on another virgin machine (Mojave) while carefully documenting (for future generations!) what actually works for me, today.

Yes. sandbox = true on macOS with nix is not well supported at all. Especially not with more complicated nix expressions.


text:
Is nix on an Intel Mac too problematic?
After too many errors I didn't know how to fix. I removed nix, even that was difficult. The nix blog show some progress in supporting M1 Macs but there are still problems. Has anyone succeeded with plutus projects with nix on an Intel Mac?

Please be more precise in what errors and problem you did encounter. This will make it easier to provide a good answer.

No, it is not. In fact I'm running the plutus-playground-server and plutus-playground-client on an x86_64-darwin machine with nix right now.

Intel Macs should not be a problem.

It should be fine - I got it running a day ago by following this guide which is for apple silicon (M1) macs : https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md
with 2 differences:

in step 3, when modifying nix.conf file, remove the "aarch64-darwin" string
later when you are starting plutus playground server and clients I did not need to prefix the commands with "GC_DONT_GC=1"

hope this helps.

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


text:
Running week01 expressions in repl
I am new to haskell and I am trying to run a few expressions from the English Auction Contract in the repl.
So if I want to run ValidatorHash "f" from the second last line of the Contract in week01, how do I do it in the repl here [nix-shell:~/plutus-pioneer-program/code/week01]$ cabal repl?
What I tried
> import Ledger.ValidatorHash
> Ledger.ValidatorHash "f"
error: Couldn't match expected type ‘PlutusTx.Builtins.Internal.BuiltinByteString’
                  with actual type ‘[Char]’

then
> import PlutusTx.Builtins.Internal
> Ledger.ValidatorHash (BuiltinByteString "f")
error: Couldn't match expected type ‘bytestring-0.10.12.0:Data.ByteString.Internal.ByteString’
                  with actual type ‘[Char]’

then
> import Data.ByString as BS
error: Could not find module ‘Data.ByString’
    Perhaps you meant
      Data.ByteString (needs flag -package-key bytestring-0.10.12.0)
      Data.String (from base-4.14.1.0)

So do I really need to close this repl and figure out the way to open the repl with the flag?
Or is there something very obvious that I am missing?

Edit #1: added non-typo error for bytestring
> import Data.ByteString as BS
error: Could not load module ‘Data.ByteString’
    It is a member of the hidden package ‘bytestring-0.10.12.0’.
    Perhaps you need to add ‘bytestring’ to the build-depends in your .cabal file.

Looks like bytestring is hidden. Is it still possible to run ValidatorHash "f" using any other means?

Edit #2
My question was initially specific to find out the origin of 66 when using the token in week01 code as ValidatorHash "f" is taken from this statement in the contract myToken = KnownCurrency (ValidatorHash "f") "Token" (TokenName "T" :| []). But I was unable to evaluate it.

It was newbie mistake. There are these lines at the top
{-# LANGUAGE DataKinds                  #-}
{-# LANGUAGE DeriveAnyClass             #-}
{-# LANGUAGE DeriveGeneric              #-}
{-# LANGUAGE DerivingStrategies         #-}
{-# LANGUAGE FlexibleContexts           #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase                 #-}
{-# LANGUAGE MultiParamTypeClasses      #-}
{-# LANGUAGE NoImplicitPrelude          #-}
{-# LANGUAGE OverloadedStrings          #-}
{-# LANGUAGE RecordWildCards            #-}
{-# LANGUAGE ScopedTypeVariables        #-}
{-# LANGUAGE TemplateHaskell            #-}
{-# LANGUAGE TypeApplications           #-}
{-# LANGUAGE TypeFamilies               #-}
{-# LANGUAGE TypeOperators              #-}

I ran the following in the repl
:set -XDataKinds
:set -XDeriveAnyClass
:set -XDeriveGeneric
:set -XDerivingStrategies
:set -XFlexibleContexts
:set -XGeneralizedNewtypeDeriving
:set -XLambdaCase
:set -XMultiParamTypeClasses
:set -XNoImplicitPrelude
:set -XOverloadedStrings
:set -XRecordWildCards
:set -XScopedTypeVariables
:set -XTemplateHaskell
:set -XTypeApplications
:set -XTypeFamilies
:set -XTypeOperators

and then simply evaluated the expression and it worked!
> Ledger.ValidatorHash "f"
66

Somewhere you have a typo. "ByString" should be "ByteString".

thanks, I changed my final question to address it.

Perhaps you need to add ‘bytestring’ to the build-depends in your .cabal file.

Do you have a cabal file somewhere? If so, you need to add the bytestring package.

Instead of making bytestring work, can I just evaluate ValidatorHash "f"? Or do I need to setup some flags (like maybe :set -XTemplateHaskell)? I was successfully able to compile week01 so I was trying to run this expression in the repl.


text:
lzma-0.0.0.3 missing when building week 01 code
I am in a nix-shell and attempting to build the code for week 1. After lots of promising output, it fails with this error.

Failed to build lzma-0.0.0.3. The failure occurred during the configure step.
Build log (
/Users/jwb/.cabal/logs/ghc-8.10.2.20201118/lzm-0.0.0.3-09eda932.log ):
Configuring library for lzma-0.0.0.3..
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: lzma.h
* Missing (or bad) C library: lzma
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.If the
library file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
If the header file does exist, it may contain errors that are caught by the C
compiler at the preprocessing stage. In this case you can re-run configure
with the verbosity flag -v3 to see the error messages.
cabal: Failed to build lzma-0.0.0.3 (which is required by
plutus-pioneer-program-week01-0.1.0.0). See the build log above for details.

I did cabal update beforehand, both outside and inside nix-shell. Any suggestions?

are you sure you're in the nix-shell window? Nix should build any external dependencies you need.

Still learning. I ended up completely re-installing the Plutus-playground, and then compiled this code directly in the playground, which worked, and which appears to be the "correct" way for these lessons. I needed to remove the module header code as demonstrated in the current Plutus Pioneers lesson #1 (https://www.youtube.com/watch?v=K61Si6iQ-Js&list=PLNEK_Ejlx3x2nLM4fAck2JS6KhFQlXq2N&index=5 from 1:10 to 1:40)  Perhaps the week 01 code is not intended to be built as an actual real app?

You probably need to install the development package:
apt install liblzma-dev

Works for me. Thanks.


text:
Is Redeemer similar to <ScriptSig> in bitcoin context?
In the (e)UTxO model, discussed in the 1st lecture of PPP#3, I am trying to understand the differences between the UTxO model of Bitcoin and the (e)UTxO model of Cardano.
From what I understand, the "script" in Cardano is similar to the locking script (ScriptPubKey) used in Bitcoin, and "redeemer" is similar to the unlocking script (ScriptSig). The main difference being that Cardano script is Turing Complete. Is this a correct assumption ?
And what is the new "Datum" used in Cardano and how large is it ? I assume that "Datum" is stored "on-chain"?

One way to think of it is that:

The Datum is a piece of data that's attached to the UTXO by the producer,
The Redeemer is a piece of data that's provided by the consumer,
When the UTXO is consumed, the script is run with both the Datum and the Redeemer as arguments and it can thus verify its spent in the right context.

The Datum can be "arbitrarily" large subject to the Tx size limits. What's get stored in the UTXO is actually not the Datum itself but its hash. The spending transaction has to provide the actual Datum, of course matching the hashes stored in the UTXO.
I think your analogy is correct but I am not knowledgeable enough with Bitcoin to be sure.
HTH.

Thank you. Just found this thread which has lots of info : https://cardano.stackexchange.com/questions/471/what-exactly-is-a-redeemer?rq=1

It might help understand from where do these inputs of the functions come from:

the Redeemer is a piece of data constructed at the moment the user wants to interact with e smart contract, this piece of data is only available for the running transaction and is often used to allow the same smart contract to execute different logic based on the requested action of the user

the ScriptContext is passed by the node that is running the script, it passes transaction-related pieces of information such as who is giving the inputs and where those inputs are going (outputs), along with other transaction information such as the time the transaction is being executed

the Datum is what allows for the Turing completeness in the (e)UTxO model.
It is attached to an UtxO belonging to the smart contract, in particular, the Datum is often used to encode the state of the script and it can be useful to store variables that can change.
More in general the Datum allows the script to have some memory of the past of the script, and this is the reason the Datum makes Cardano smart contracts Turing complete