text:
Bad File Descriptor on nix-build of Plutus-Apps on Mac M1
I am seeing an error building Plutus-Apps on Mac M1.
After precisely following
https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md
UPDATE: This did resolve. These errors appears to be due to corrupted cache in nix store from download on in the cache itself.
as recommended here:
Building Plutus-apps on Mac M1
I get an Invalid File Descriptor error. Here are the logs
 copying path '/nix/store/lkbwcc0zyq9jzz8mk149rmfxw6ycl627-curl-7.81.0-dev' from  'https://hydra.iohk.io'...
 building '/nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv'...

 ErrorErrorxexecuting '/nix/store/067f780bk90ghn7yhz914d5fykmll7a4-bash-5.1-p16/bin/bash': Bad file descriptor
 error: builder for '/nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv' failed with exit code 1;
   last 2 log lines:
   >
   > ErrorErrorxexecuting '/nix/store/067f780bk90ghn7yhz914d5fykmll7a4-bash-5.1-p16/bin/bash': Bad file descriptor
   For full logs, run 'nix log /nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv'.
 (use '--show-trace' to show detailed location information)

here is full logs:
    nix log /nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv
 ^A
 ^E^@^@^@^@^@^@^@Error^@^@^@^@^@^@^@^@^@^@^@^E^@^@^@^@^@^@^@Error^@^@^@x^@^@^@^@^@^@^@executing '/nix/store/067f780bk90ghn7yhz914d5fyk>
lines 1-2/2 (END)

Here is logs with full trace:
 deano@Ds-MacBook-Pro plutus-apps % nix-build --show-trace -A plutus- playground.server
 building '/nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv'...

 ErrorErrorxexecuting '/nix/store/067f780bk90ghn7yhz914d5fykmll7a4-bash-5.1-p16/bin/bash': Bad file descriptor
 error: builder for '/nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv' failed  with exit code 1;
   last 2 log lines:
   >
   > ErrorErrorxexecuting '/nix/store/067f780bk90ghn7yhz914d5fykmll7a4-bash-5.1- p16/bin/bash': Bad file descriptor
   For full logs, run 'nix log /nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv'.

    … while realising the context of path  '/nix/store/dv269kw7fp6y81n0k20w9s4a05s2z4f7-source'

   at /Users/deano/plutus/plutus-apps/default.nix:13:16:

       12| , sources ? import ./nix/sources.nix { inherit system; } //  sourcesOverride
       13| , haskellNix ? import sources.haskell-nix {
         |                ^
       14|     pkgs = import sources.nixpkgs { inherit system; };

   … while evaluating 'throwIfNot'

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/lib/trivial.nix:379:22:

      378|   */
      379|   throwIfNot = cond: msg: if cond then x: x else throw msg;
         |                      ^
      380|

   … from call site

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/pkgs/top-  level/default.nix:55:5:

       54|   checked =
       55|     throwIfNot (lib.isList overlays) "The overlays argument to nixpkgs   must be a list."
         |     ^
       56|     lib.foldr (x: throwIfNot (lib.isFunction x) "All overlays passed to nixpkgs must be functions.") (r: r) overlays

   … while evaluating anonymous lambda

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/pkgs/top-level/default.nix:19:1:

       18|
       19| { # The system packages will be built on. See the manual for the
         | ^
       20|   # subtle division of labor between these two `*System`s and the three

   … from call site

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/pkgs/top-   level/impure.nix:82:1:

       81|
       82| import ./. (builtins.removeAttrs args [ "system" ] // {
         | ^
       83|   inherit config overlays localSystem;

   … while evaluating anonymous lambda

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/pkgs/top- level/impure.nix:14:1:

       13|
       14| { # We put legacy `system` into `localSystem`, if `localSystem` was not   passed.
         | ^
       15|   # If neither is passed, assume we are building packages on the current

   … from call site

   at /Users/deano/plutus/plutus-apps/nix/default.nix:30:10:

       29|
       30|   pkgs = import sources.nixpkgs {
         |          ^
       31|     inherit crossSystem;

   … while evaluating the attribute 'pkgs'

   at /Users/deano/plutus/plutus-apps/nix/default.nix:44:10:

       43| {
       44|   inherit pkgs plutus-apps sources;
         |          ^
       45| }

And here is nix.conf
% cat /etc/nix/nix.conf

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

 system = x86_64-darwin
 extra-platforms = x86_64-darwin aarch64-darwin

 sandbox = false
 extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
 experimental-features = nix-command
 extra-experimental-features = flakes

I tried increasing file limits ..
launchctl limit maxfiles
maxfiles    200000         200000

But still get the error.

I did install GCH separately before but I don't think that should be a factor in running nix-shell or nix build

No it does not affect at all because GHC comes with Nix. When you enter a in a shell you already have access to all plutus dependencies.

[60 of 60] Compiling Blockfrost.API   ( src/Blockfrost/API.hs, dist/build/Blockfrost/API.o, dist/build/Blockfrost/API.dyn_o )
error: builder for '/nix/store/zx91r06dgsdddrmd1gzpx2ckiaw9qf29-blockfrost-api-lib-blockfrost-api-0.3.1.0.drv' failed with exit code 1;
last 10 log lines:

[51 of 60] Compiling Blockfrost.API.Cardano.Assets ( src/Blockfrost/API/Cardano/Assets.hs, dist/build/Blockfrost/API/Cardano/Assets.o, dist/build/Blockfrost/API/Cardano/Assets.dyn_o )

both  server and client compile ok now. I suspect that was corrupted download of cache or corrupted cache.  But now I get above error during nix-shell run

I think these errors are from corrupt download of cache but not sure.

I ran nix-shell again but keep getting the compile error with Blockfront API

detail logs shows: location info>: error: : dlopen(/nix/store/3g1j67mmalbr40mryf53a67ip3kj17i3-blockfrost-api-lib-blockfrost-api-0.3.1.0-config/lib/links/libHScontainers-0.6.2.1-ghc8.10.4.20210212.dylib, 0x0005): cannot dlopen > [43 of 60] Compiling Blockfrost.Util.Pagination

ok, got passed this error of dlopen by rerunning nix-shell in another terminal

You may want to try to follow the guide for Mac M1 here:
https://plutus-community.readthedocs.io/en/latest/#Environment/Build/Mac_M1/

I am following that. And the errors above are not now appearing.  The nix-build of server and client worked ok after rerunning a few times. However the step of running nix-shell is now giving an error.

error is [60 of 60] Compiling Blockfrost.API   ( src/Blockfrost/API.hs, dist/build/Blockfrost/API.o, dist/build/Blockfrost/API.dyn_o )
error: builder for '/nix/store/zx91r06dgsdddrmd1gzpx2ckiaw9qf29-blockfrost-api-lib-blockfrost-api-0.3.1.0.drv' failed with exit code 1;
last 10 log lines:

[51 of 60] Compiling Blockfrost.API.Cardano.Assets ( src/Blockfrost/API/Cardano/Assets.hs, dist/build/Blockfrost/API/Cardano/Assets.o, dist/build/Blockfrost/API/Cardano/Assets.dyn_o )

The previous errors with file descriptors I suspect are from corrupt download of cache or corrupt cache.

60 of 60] Compiling Blockfrost.API   ( src/Blockfrost/API.hs, dist/build/Blockfrost/API.o, dist/build/Blockfrost/API.dyn_o )
error: builder for '/nix/store/zx91r06dgsdddrmd1gzpx2ckiaw9qf29-blockfrost-api-lib-blockfrost-api-0.3.1.0.drv' failed with exit code 1;
last 10 log lines:

[60 of 60] Compiling Blockfrost.API   ( src/Blockfrost/API.hs, dist/build/Blockfrost/API.o, dist/build/Blockfrost/API.dyn_o )
For full logs, run 'nix log /nix/store/zx91r06dgsdddrmd1gzpx2ckiaw9qf29-blockfrost-api-lib-blockfrost-api-0.3.1.0.drv'.
error: 1 dependencies of derivation '/nix/store/a45kgfid8c37ika0bx6f6dy6hrlya168-blockfrost-client-core-lib-blockfrost-client-core-0.2.0.0-config.drv' failed to build
error: 1 dependencies of derivation '/nix/store/j7rszs8r90643v61cv430fp21z8n9456-blockfrost-client-core-lib-blockfrost-client-core-0.2.0.0.drv' failed to build

sorry to post log here but I could not update the question at this time.

detail logs shows: location info>: error:
: dlopen(/nix/store/3g1j67mmalbr40mryf53a67ip3kj17i3-blockfrost-api-lib-blockfrost-api-0.3.1.0-config/lib/links/libHScontainers-0.6.2.1-ghc8.10.4.20210212.dylib, 0x0005): cannot dlopen >
[43 of 60] Compiling Blockfrost.Util.Pagination ( src/Blockfrost/Util/Pagination.hs, dist/build/Blockfrost/Util/Pagination.o, dist/build/Blockfrost/Util/Pagination.dyn_o )
[44 of 60] Compiling Blockfrost.Util.Sorting ( src/Blockfrost/Util/Sorting.hs, dist/build/Blockfrost/Util/Sorting.o, dist/build/Blockfrost/Util/Sorting.dyn_o )

I tried running nix-shell again but same result. Any suggestions for this?

got passed this error by rerunning nix-shell in another terminal. It must have been a resource limit of some type.


text:
Plutus Starter nix-shell build errors on MacOS Monterey M1 - ghc-cabal: Encountered missing or private dependencies
MacOS Monterey, Apple M1
Installed latest GHC via https://www.haskell.org/ghcup/ but not Stack.
Installed nix 2.8.0 multiuser
Set Cache in /etc/nix/nix.conf as below:
UPDATE: I have since updated nix.conf file for M1. See bottom of question for latest nix.conf and corresponding error message
             sandbox = false
             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=

Steps to reproduce:
git clone https://github.com/input-output-hk/plutus-starter

cd plutus-starter

nix-shell

Result: Note see Update below. This might have been due to nix.conf not setup properly for M1.
       > Configuring mtl-2.2.2...
   > "/nix/store/jjjbvzpal4b7n6hmnychrq07w36jnzjw-ghc-8.10.7/bin/ghc-pkg" update -v0 --force --package-db=libraries/bootstrapping.conf libraries/mtl/dist-boot/inplace-pkg-config
   > "inplace/bin/ghc-cabal" configure libraries/hpc dist-boot --with-ghc="/nix/store/jjjbvzpal4b7n6hmnychrq07w36jnzjw-ghc-8.10.7/bin/ghc" --with-ghc-pkg="/nix/store/jjjbvzpal4b7n6hmnychrq07w36jnzjw-ghc-8.10.7/bin/ghc-pkg"  --package-db=/private/tmp/nix-build-ghc-8.8.4.drv-1/ghc-8.8.4-configured-src/libraries/bootstrapping.conf --disable-library-for-ghci --enable-library-vanilla --enable-library-for-ghci --disable-library-profiling --disable-shared --with-hscolour="/nix/store/v35zbnmxnxh1axccw5agmplam8nbr0b8-hscolour-exe-HsColour-1.24.4/bin/HsColour" --configure-option=CFLAGS="-Wall    -Wno-unknown-pragmas" --configure-option=LDFLAGS="  " --configure-option=CPPFLAGS="   " --gcc-options="-Wall    -Wno-unknown-pragmas   " --configure-option=--with-iconv-includes="/nix/store/cg81y8mlrvd3crly089xy6xd63nvzm4w-libiconv-50/include" --configure-option=--with-iconv-libraries="/nix/store/cg81y8mlrvd3crly089xy6xd63nvzm4w-libiconv-50/lib" --configure-option=--with-gmp-includes="/nix/store/nwfxg1dpzpkq9w2awp4zs5jawn4fvyb0-gmp-6.2.1-dev/include" --configure-option=--with-gmp-libraries="/nix/store/j75k7na64g7xly1gxrkz44sby1gdc0sa-gmp-6.2.1/lib" --configure-option=--with-curses-libraries="/nix/store/bs7hpi27xc0y2qynvx4n1zpnv3s5bnkx-ncurses-6.2/lib"   --constraint "binary == 0.8.7.0"   --constraint "transformers == 0.5.6.2"   --constraint "mtl == 2.2.2"   --constraint "hpc == 0.6.0.3"   --constraint "ghc-boot-th == 8.8.4"   --constraint "ghc-boot == 8.8.4"   --constraint "template-haskell == 2.15.0.0"   --constraint "text == 1.2.4.0"   --constraint "parsec == 3.1.14.0"   --constraint "Cabal == 3.0.1.0"   --constraint "ghc-heap == 8.8.4"   --constraint "ghci == 8.8.4"   --constraint "terminfo == 0.4.1.4" --with-gcc="clang" --with-ld="ld" --with-ar="ar" --with-alex="/nix/store/x1qgmqksr03kvdslwakbn4qbi4f5h3bs-alex-exe-alex-3.2.4/bin/alex" --with-happy="/nix/store/ic7q31ff5n34k0x1x1xm8jldzh88c58s-happy-exe-happy-1.19.12/bin/happy"
   > Configuring hpc-0.6.0.3...
   > ghc-cabal: Encountered missing or private dependencies:
   > base >=4.4.1 && <4.14
   >
   > libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/package-data.mk: No such file or directory
   > make[1]: *** [libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/package-data.mk]        Error 1
   > make: *** [Makefile:124: all] Error 2
   For full logs, run 'nix log /nix/store/40hp5wypw0djadrrcb1346hk2y0ridf2-ghc-8.8.4.drv'.
    error: 1 dependencies of derivation '/nix/store/qgyzqd5v4yn32fgns4vqwcr3qrqgy8ii-ghc-8.10.4.20210212-configured-src.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/3i1f6vn82wg07dwvr24dm26l45jzx3sw-ghc-8.10.4.20210212.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/irws4cdrncz0gdg5m68blqj3h0p86ivx-Cabal-lib-Cabal-3.4.1.0-config.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/xrwzqagrirvim8bs8kpiqxikqf78qn30-Cabal-lib-Cabal-3.6.2.0-config.drv' failed to build

Also earlier in the nix-shell log I saw the following:
    [217 of 285] Compiling Distribution.Simple.Program.GHC ( libraries/Cabal/Cabal/Distribution/Simple/Program/GHC.hs, bootstrapping/Distribution/Simple/Program/GHC.o )
    'apple-a7' is not a recognized processor for this target (ignoring processor)

Things I have tried:
Search for all nix.conf file and add the cache entries as above.
run as root: sudo nix-shell
sudo nix-build etc.
I am not familiar with nix and I might have missed some steps to be done prior to running nix-shell
PS. Also would like to clean the nix caches? So I can try again with clean cache. Is it the following?
  rm $HOME/.cache/nix/binary-cache-v*.sqlite*

or is there a nix command for this?
And the nix log command for further details did not work either:
  nix log /nix/store/40hp5wypw0djadrrcb1346hk2y0ridf2-ghc-8.8.4.drv
  error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override

using --extra-experimental-features indicates log is not recognized nix command.
UPDATE: Per suggestion I have updated the nix.conf per https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md
And my exact nix.conf file is now:
 sandbox = false
 system = x86_64-darwin
 extra-platforms = x86_64-darwin aarch64-darwin
 experimental-features = nix-command
 extra-experimental-features = flakes
 extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
 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=

However, I now see a different error message:
 copying path '/nix/store/v3bzn8kiwxaip81hbdv9q3jhkxcmqrhk-git-2.32.0' from 'https://hydra.iohk.io'...
 building '/nix/store/zcv0q6cmd39zr580w9sq0z1wbkak0mqk-git-ls-files.drv'...

 ErrorErrorxexecuting '/nix/store/715y5lnw12vdcc3hh9sc9vbkdi6c83x6-bash-4.4-p23/bin/bash': Bad file descriptor
 error (ignored): error: end of string reached
 error: builder for '/nix/store/zcv0q6cmd39zr580w9sq0z1wbkak0mqk-git-ls-files.drv' failed with exit code 1;
   last 2 log lines:
   >
   > ErrorErrorxexecuting '/nix/store/715y5lnw12vdcc3hh9sc9vbkdi6c83x6-bash-4.4-p23/bin/bash': Bad file descriptor
   For full logs, run 'nix log /nix/store/zcv0q6cmd39zr580w9sq0z1wbkak0mqk-git-ls-files.drv'.
 (use '--show-trace' to show detailed location information)

I see this running under both both bash and zsh shells
Here is full trace:
 sudo nix-shell --show-trace
 building '/nix/store/zcv0q6cmd39zr580w9sq0z1wbkak0mqk-git-ls- files.drv'...

 ErrorErrorxexecuting '/nix/store/715y5lnw12vdcc3hh9sc9vbkdi6c83x6-bash-4.4-p23/bin/bash': Bad file descriptor
 error: builder for '/nix/store/zcv0q6cmd39zr580w9sq0z1wbkak0mqk-git-ls-files.drv'   failed with exit code 1

   … while realising the context of path '/nix/store/g0769lx8bm7lna4gsdchiayk6n7gdcx5-git-ls-files/files'

   at /nix/store/bvynxhgsxhp6ds11ak1wnjx5h8avmfwf-source/lib/clean-git.nix:146:26:

      145|           submoduleDirs = lines (readFile (files + "/submoduleDirs"));
      146|           files = lines (readFile (files + "/files"));
         |                          ^
      147|         };

   … while evaluating 'lines'

   at /nix/store/bvynxhgsxhp6ds11ak1wnjx5h8avmfwf-source/lib/clean-git.nix:33:11:

perhaps it has something to do with this issue that mentions both bad file descriptors and too many open file descriptors? https://github.com/NixOS/nixpkgs/issues/101459

The following git repo has the latest information on setting up your environment in Mac M1. I personally followed this tutorial and worked perfectly. I suggest you delete everything you have done before and start from scratch following this link. https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md

Ok, did you get try this with plutus-starter project?

I did update with your suggestion for M1 based nix.conf file but used the cache suggested for the Plutus Starter. See updated logs above

I also see file descriptor error when running nix-build on Plutus-Apps

I dont think you should use the plutus-start-project for now , the repo they have on github is not updated , and you have to do a lot of things to fix it to make it run right now.

Well I followed the instructions for M1 above for Plutus-Apps and reinstalled nix as well. However, I am still seeing the invalid file descriptor errors as indicated in my update above.

I did install ghc before so perhaps that might be having an effect. I think with nix this should not be a factor however

I dont really know what exact error you are getting , hit me up on my email shanyuzhang123@gmail.com. We can hop on a zoom or google meet call. I can try to help you set up from there,

actually we can meet on discord if you want Shan#7955

Sounds good, I will send you email and hop on discord as well

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

source: Stack Exchange

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

sort: votes


text:
Plutus-Starter Starter PAB backend server does not return wallet id
Server seems to have built ok:
[nix-shell:~/plutus/plutus-starter]$ cabal build plutus-starter-pab
Resolving dependencies...
Up to date

I am using Plutus-Starter project on Macbook Monterey M1 but have not been able to generate the wallet Ids or confirm that the server fully started. It seems to just say "[INFO] Starting PAB backend server on port 9080" full log is below. Is there a verbose mode for starting the server?
[nix-shell:~/plutus/plutus-starter]$ cabal exec -- plutus-starter-pab
[INFO] Slot 0: TxnValidate 08111487e032e647e23e6e6866665ab726a4c92532e9589f9e670f2585e35807
[INFO] Starting plutus-starter PAB webserver on port 9080. Press enter to exit.
[INFO] W[2]: Balancing an unbalanced transaction:
               Tx:
                 Tx 318797441458154cf284463902d8e152cc240ab65a58fff5287b0a1f5d5de3a1:
                   {inputs:
                   collateral inputs:
                   outputs:
                     - Value (Map [(,Map [("",10000000000)])]) addressed to
                       PubKeyCredential: bb22a3608c50bdb141d2f1255836a7f4fc829a47d801c985746cfca6 (no staking credential)
                   mint: Value (Map [])
                   fee: Value (Map [])
                   mps:
                   signatures:
                   validity range: Interval {ivFrom = LowerBound NegInf True, ivTo = UpperBound PosInf True}
                   data:}
               Requires signatures:
               Utxo index:
               Validity range:
                 (-∞ , +∞)
[INFO] W[2]: Finished balancing:
               Tx e5581a9ec85d0525e8aee67e8ec2e453b6e098121aa29fab8698ff091ebd3bd6:
                 {inputs:
                    - 08111487e032e647e23e6e6866665ab726a4c92532e9589f9e670f2585e35807!20

                    - 08111487e032e647e23e6e6866665ab726a4c92532e9589f9e670f2585e35807!21

                 collateral inputs:
                   - 08111487e032e647e23e6e6866665ab726a4c92532e9589f9e670f2585e35807!20

                 outputs:
                   - Value (Map [(,Map [("",9999999489)])]) addressed to
                     PubKeyCredential: 80a4f45b56b88d1139da23bc4c3c75ec6d32943c087f250b86193ca7 (no staking credential)
                   - Value (Map [(,Map [("",10000000000)])]) addressed to
                     PubKeyCredential: bb22a3608c50bdb141d2f1255836a7f4fc829a47d801c985746cfca6 (no staking credential)
                 mint: Value (Map [])
                 fee: Value (Map [(,Map [("",511)])])
                 mps:
                 signatures:
                 validity range: Interval {ivFrom = LowerBound NegInf True, ivTo = UpperBound PosInf True}
                 data:}
[INFO] W[2]: Signing tx: e5581a9ec85d0525e8aee67e8ec2e453b6e098121aa29fab8698ff091ebd3bd6
[INFO] W[2]: Submitting tx: e5581a9ec85d0525e8aee67e8ec2e453b6e098121aa29fab8698ff091ebd3bd6
[INFO] Slot 1: TxnValidate e5581a9ec85d0525e8aee67e8ec2e453b6e098121aa29fab8698ff091ebd3bd6
[INFO] Starting PAB backend server on port 9080

I don't see confirmation that it fully started but there is a response to service definition request:
 % curl -s http://localhost:9080/api/contract/definitions | jq
[
  {
    "csrSchemas": [
      {
        "argument": {
          "contents": [
            [
              "guessWord",
              {
                "tag": "FormSchemaString"
              }
            ]
          ],
          "tag": "FormSchemaObject"
        },
        "endpointDescription": {
          "getEndpointDescription": "guess"
        }
      },
      {
        "argument": {
          "contents": [
            [
              "secretWord",
              {
                "tag": "FormSchemaString"
              }
            ],
            [
              "amount",
              {
                "tag": "FormSchemaValue"
              }
            ]
          ],
          "tag": "FormSchemaObject"
        },
        "endpointDescription": {
          "getEndpointDescription": "lock"
        }
      }
    ],
    "csrDefinition": "GameContract"
  }
]

This does not seem to include enough endpoint information.
And the Wallet Creation request returns empty
deano@Ds-MacBook-Pro ~ % curl -s -d '' http://localhost:9080/wallet/create
deano@Ds-MacBook-Pro ~ %

Update: Digging into the source I see some instructions in a readme file related to starting the PAB backend server for a local cluster but I am not sure this is related.
cat ./dist-newstyle/src/plutus-ap_-cbcc5c6ab544aad6/plutus-pab-executables/README.md
#### Example

1. Build necessary components:

cabal build plutus-pab-local-cluster

2. Get config data:

  Clone <https://github.com/input-output-hk/cardano-wallet/> to $DIR and set the
  `SHELLEY_TEST_DATA` environment variable:

export SHELLEY_TEST_DATA=$DIR/lib/shelley/test/data/cardano-node-shelley

3. Run the local cluster:

cabal exec plutus-pab-local-cluster

4. Wait until the message `Starting PAB backend server on port 9080` appears.

5. Run the integration test:

curl -H "Content-Type: application/json" -v \
       -X POST \
       -d '{"caID":{"tag":"IntegrationTest"},"caWallet":{"getWalletId":"2d4cc31a4b3116ab86bfe529d30d9c362acd0b44"}}' \
       localhost:9080/api/contract/activate

A couple of log messages appear, the last one should say something like "Tx
confirmed. Integration test complete."

PAB Server starting message seems to be in PABLogMsg
I don't see there there is any message available within PABLogMsg to confirm a successful start.  I think there are no further messages about this. However there is some reason the PAB Server cannot create the walletId. Do I need to be running anything else for this to work?
[nix-shell:~/plutus/plutus-starter]$ cat ./dist-newstyle/src/plutus-ap_-cbcc5c6ab544aad6/plutus-pab/src/Plutus/PAB/Monitoring/PABLogMsg.hs
{-# LANGUAGE DataKinds            #-}
{-# LANGUAGE DeriveAnyClass       #-}
{-# LANGUAGE DeriveGeneric        #-}
{-# LANGUAGE DerivingVia          #-}
{-# LANGUAGE FlexibleContexts     #-}
{-# LANGUAGE LambdaCase           #-}
{-# LANGUAGE OverloadedStrings    #-}
{-# LANGUAGE TypeApplications     #-}
{-# LANGUAGE UndecidableInstances #-}

-- | PAB Log messages and instances
module Plutus.PAB.Monitoring.PABLogMsg(
    PABLogMsg(..),
    ChainIndexServerMsg,
    WalletMsg,
    PABServerLogMsg,
    AppMsg(..),
    CoreMsg(..),
    PABMultiAgentMsg(..),
    RequestSize(..),
    WalletClientMsg(..)
    ) where

import Cardano.Api qualified as C
import Cardano.BM.Data.Tracer (ToObject (toObject), TracingVerbosity (MaximalVerbosity))
import Cardano.BM.Data.Tracer.Extras (StructuredLog, Tagged (Tagged), mkObjectStr)
import Cardano.ChainIndex.Types (ChainIndexServerMsg)
import Cardano.Node.Types (PABServerConfig, PABServerLogMsg)
import Cardano.Wallet.Mock.Types (WalletMsg)
import Control.Monad.Freer.Extras.Beam (BeamLog)
import Data.Aeson (FromJSON, ToJSON, Value)
import Data.Aeson.Text (encodeToLazyText)
import Data.Text (Text)
import Data.Text qualified as T
import GHC.Generics (Generic)
import Plutus.Contract.Effects (PABReq, PABResp)
import Plutus.Contract.Resumable (Response)
import Plutus.Contract.State (ContractResponse)
import Plutus.PAB.Core.ContractInstance (ContractInstanceMsg)
import Plutus.PAB.Effects.Contract (PABContract (..))
import Plutus.PAB.Events.Contract (ContractInstanceId)
import Plutus.PAB.Instances ()
import Prettyprinter (Pretty (pretty), colon, line, viaShow, (<+>))
import Wallet.Emulator.LogMessages (TxBalanceMsg)
import Wallet.Emulator.MultiAgent (EmulatorEvent)
import Wallet.Emulator.Wallet (Wallet)

data WalletClientMsg =
    WalletClientError String
    | BalanceTxError String
    deriving stock (Eq, Show, Generic)
    deriving anyclass (ToJSON, FromJSON)

instance Pretty WalletClientMsg where
    pretty = viaShow

instance ToObject WalletClientMsg where
    toObject _ m = mkObjectStr (T.pack $ show m) ()

data AppMsg t =
    ActiveContractsMsg
    | ContractHistoryMsg
    | PABMsg (PABLogMsg t)
    | AvailableContract Text
    | ContractInstances (ContractDef t) [ContractInstanceId]
    | ContractHistoryItem ContractInstanceId (Response PABResp)
    deriving stock (Generic)

deriving stock instance (Show (ContractDef t)) => Show (AppMsg t)
deriving anyclass instance (ToJSON (ContractDef t)) => ToJSON (AppMsg t)
deriving anyclass instance (FromJSON (ContractDef t)) => FromJSON (AppMsg t)

instance (Pretty (ContractDef t)) => Pretty (AppMsg t) where
    pretty = \case
        ActiveContractsMsg               -> "Active contracts"
        ContractHistoryMsg               -> "Contract history"
        PABMsg m                         -> pretty m
        AvailableContract t              -> pretty t
        ContractInstances t s            -> pretty t <+> pretty s
        ContractHistoryItem instanceId s -> pretty instanceId <> colon <+> pretty (fmap encodeToLazyText s)

data PABLogMsg t =
    SCoreMsg (CoreMsg t)
    | SChainIndexServerMsg ChainIndexServerMsg
    | SWalletMsg WalletMsg
    | SMockserverLogMsg PABServerLogMsg
    | SMultiAgent (PABMultiAgentMsg t)
    deriving stock (Generic)

deriving stock instance (Show (ContractDef t)) => Show (PABLogMsg t)
deriving anyclass instance (ToJSON (ContractDef t)) => ToJSON (PABLogMsg t)
deriving anyclass instance (FromJSON (ContractDef t)) => FromJSON (PABLogMsg t)

instance Pretty (ContractDef t) => Pretty (PABLogMsg t) where
    pretty = \case
        SCoreMsg m             -> pretty m
        SChainIndexServerMsg m -> pretty m
        SWalletMsg m           -> pretty m
        SMockserverLogMsg m    -> pretty m
        SMultiAgent m          -> pretty m

{- ToObject instances

'ToObject.toObject' is very similar to 'ToJSON.toJSON' except that

* 'toObject' has an additional paramter for verbosity
* 'toObject' must always produce a JSON object (key-value map)

In the definitions below, every object produced by 'toObject' has a field
'string' with a friendly description of the message, similar to its
'Pretty' instance. Additional fields depend on the type of message.

-}

instance (ToJSON (ContractDef t), StructuredLog (ContractDef t)) => ToObject (AppMsg t) where
    toObject v = \case
        ActiveContractsMsg ->
            mkObjectStr "Listing active contract instances" ()
        ContractHistoryMsg ->
            mkObjectStr "Showing contract history" ()
        PABMsg m -> toObject v m
        AvailableContract t ->
            mkObjectStr "Available contract" t
        ContractInstances exe ids ->
            mkObjectStr
                "Active instances for contract"
                (exe, Tagged @"instances" ids)
        ContractHistoryItem i state ->
            mkObjectStr "Contract history item" $
                case v of
                    MaximalVerbosity -> Left (i, state)
                    _                -> Right i

instance (StructuredLog (ContractDef t), ToJSON (ContractDef t)) => ToObject (PABLogMsg t) where
    toObject v = \case
        SCoreMsg m             -> toObject v m
        SChainIndexServerMsg m -> toObject v m
        SWalletMsg m           -> toObject v m
        SMockserverLogMsg m    -> toObject v m
        SMultiAgent m          -> toObject v m

-- | FIXME: Redundant?
data PABMultiAgentMsg t =
    EmulatorMsg EmulatorEvent
    | ContractInstanceLog (ContractInstanceMsg t)
    | UserLog T.Text
    | BeamLogItem BeamLog
    | PABStateRestored Int
    | RestoringPABState
    | StartingPABBackendServer Int
    | WalletBalancingMsg Wallet TxBalanceMsg
    | WalletClient WalletClientMsg
    deriving stock Generic

instance (StructuredLog (ContractDef t), ToJSON (ContractDef t)) => ToObject (PABMultiAgentMsg t) where
    toObject v = \case
        EmulatorMsg e              -> mkObjectStr "emulator message" (Tagged @"payload" e)
        ContractInstanceLog m      -> toObject v m
        UserLog t                  -> toObject v t
        BeamLogItem b              -> toObject v b
        RestoringPABState          -> mkObjectStr "Restoring PAB state ..." ()
        PABStateRestored n         -> mkObjectStr ( "PAB state restored with "
                                                 <> T.pack (show n)
                                                 <> " contract instance(s)."
                                                  ) ()
        StartingPABBackendServer i -> mkObjectStr "starting backend server" (Tagged @"port" i)
        WalletBalancingMsg w m     -> mkObjectStr "balancing" (Tagged @"wallet" w, Tagged @"message" m)
        WalletClient m -> toObject v m

deriving stock instance (Show (ContractDef t)) => Show (PABMultiAgentMsg t)
deriving anyclass instance (ToJSON (ContractDef t)) => ToJSON (PABMultiAgentMsg t)
deriving anyclass instance (FromJSON (ContractDef t)) => FromJSON (PABMultiAgentMsg t)

instance Pretty (ContractDef t) => Pretty (PABMultiAgentMsg t) where
    pretty = \case
        EmulatorMsg m         -> pretty m
        ContractInstanceLog m -> pretty m
        UserLog m             -> pretty m
        BeamLogItem b         -> pretty b
        RestoringPABState     -> "Restoring PAB state ..."
        PABStateRestored 0    -> "No contract instance were restored in the PAB state."
        PABStateRestored 1    -> "PAB state restored with 1 contract instance."
        PABStateRestored n    -> "PAB state restored with"
                              <+> pretty n
                              <+> "contract instances."
        StartingPABBackendServer port ->
            "Starting PAB backend server on port" <+> pretty port
        WalletBalancingMsg w m -> pretty w <> colon <+> pretty m
        WalletClient m -> pretty m

data CoreMsg t =
    FindingContract ContractInstanceId
    | FoundContract (Maybe (ContractResponse Value Value PABResp PABReq))
    | ConnectingToAlonzoNode PABServerConfig C.SlotNo
    deriving stock Generic

deriving stock instance (Show (ContractDef t)) => Show (CoreMsg t)
deriving anyclass instance (ToJSON (ContractDef t)) => ToJSON (CoreMsg t)
deriving anyclass instance (FromJSON (ContractDef t)) => FromJSON (CoreMsg t)

instance Pretty (ContractDef t) => Pretty (CoreMsg t) where
    pretty = \case
        FindingContract i      -> "Finding contract" <+> pretty i
        FoundContract c        -> "Found contract" <+> viaShow c
        ConnectingToAlonzoNode config slotNo ->
                "Connecting to Alonzo node with config:"
            <>  line
            <>  pretty config
            <>  line
            <>  "The tip of the local node:"
            <+> viaShow slotNo

instance (StructuredLog (ContractDef t), ToJSON (ContractDef t)) => ToObject (CoreMsg t) where
    toObject v = \case
        FindingContract instanceID ->
            mkObjectStr "finding contract instance" instanceID
        FoundContract state ->
            mkObjectStr "found contract" $
                case v of
                    MaximalVerbosity -> Left (Tagged @"contract" state)
                    _                -> Right ()
        ConnectingToAlonzoNode _ _ -> mkObjectStr "Connecting to Alonzo node" ()

newtype RequestSize = RequestSize Int
    deriving stock (Show)
    deriving newtype (ToJSON, FromJSON)

instance Pretty RequestSize where
    pretty (RequestSize i) = pretty i <+> "bytes"

I realize that this doesn't directly answer your question, but I spent a lot of time (too much?) on getting the pab local cluster working.   The issue is that you will need to pivot away from the PAB when you get to the testnet because there are limitation using the pab on the testnet (shared wallet passwords, 3+ days for chain index synch, etc.) and not even possible using it on mainnet.  The PAB is awesome for development and using the simlutor, but it ends there.
So, in hindsight it is probably best to just focus on using a local devnet from cardano-node directly.  Then interact with your plutus scripts the way you will when you get to the testnet and mainnet.
I've just released The Open Source Cardano Lottery project and in that repository is working code and script examples for setting up & interacting with a local devnet and a testnet.   It has basic shell scripts for a PAB, but there are other options out there but I have not tried them (eg. PyCardano, cardano-serialization-lib
).
https://github.com/lley154/cardano-lottery
Hope this helps!

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


text:
How to get cardano-node to work with public systemd sockets?
I get no errors but no traffic and am at a loss. A couple of things:

I load a new service from file cardano-node.xml: firewall-cmd --permanent --new-service-from-file=/usr/lib64/firewalld/services/cardano-node.xml

I reload so it becomes runtime: firewall-cmd --reload

I see it in my default zone, allowing two ports, that match the TCP sockets handed by systemd. netstat -ap | grep <port> shows it, though as systemd. grep cardano shows something else:

    tcp6       0      0 [::]:29171              [::]:*                  LISTEN      1/systemd
    tcp        0      0 localhost:12788         0.0.0.0:*               LISTEN      4513/cardano-node

When inspecting with Wireshark, without passing sockets both an A and AAAA query is made, the former giving me an answer and my node starts downloading. When passing sockets only the AAAA query is made and the node does nothing.

I've set the scribe to JournalSK and debug level to info but there's nothing to go on. In fact, I remember more output using stderr/stdin with a simple cardano-node run, so I suspect something is off here too.
setupScribes:
  - scKind: JournalSK
    scName: journal
    scFormat: ScText
    scRotation: null

# For the Katip logging backend this specifies the default scribes that trace
# output is sent to if it is not configured to be sent to other scribes.
defaultScribes:
  - - JournalSK
    - journal

Is Katip and EKGViewBK something that needs to be installed separately or are they libraries used internally?

You're looking at firewall but socket activation is at systemd level. Can you share your unit files for the sockets and your node service?

Sure here you go: https://paste.ee/p/CJLcz
It's my understanding once the service gets started the sockets get passed to it. I assumed no traffic was getting out and thought firewall.

I did a little digging and it looks like an A query is never made when using the premade sockets so the node never gets it's peers and nothing happens!

I guess the lack of an answer section means relays-new.cardano-node.iohk.io doesn't support IPv6? Also, are the IP's in the IPv4 response relays or my closest peers? Sorry, I am learning as I go. Look forward to knowing what I'm doing wrong!


text:
problem setting up the plutus environment
Noob here. I am basically just trying to learn plutus on my own I am on week01. When I ran the following command:
[nix-shell:~/plutus-apps/plutus-playground-client]$ npm run start (or even just npm start)
I get this error:

I tried "npm audit fix --force" and it did not help. Is there any suggestion on how I can overcome this issue? Thank you!

Hay man the best way is to spin up a VM like VirtualBox and make sure your dependencies match. Your problem here is that you are using a version of Webpack not compatible with your version of Plutus.
Step 1)
set up Ubuntu VM (recommend Ubuntu 20.4 LTS its the one I'm using so it works). optional setup vscode its pretty good.
Step 2)
Clone Plutus-apps repo
Step 3)
Clone plutus pioners program
Step 4)
install ghc and nixos
step 5)
open up the cabal build file from the week of the PPP your on. Press ctrl + F and look up apps. there should be a plutus-apps now highlighted in the file copy the commit reference right below it.
step 6)
cd into your plutus-apps dir and git checkout <refrance you just copied>
Step 7)
nix-shell
Step 8)
cd to the correct week of Plutus pioneers program
cabal build
code .
you should now be in the environment inside vscode in the correct location ready to code.
to set up the client and server for the playground and the documentation look up the Plutus Env_ Setup Starter Pack.pdf

Looks like the --inline option was depecated from webpack as per: https://stackoverflow.com/questions/70528429/webpack-cli-error-webpack-cli-error-unknown-option-inline
What build guide are you following? Do they suggest a certain version of webpack to use?
(--inline should still be a valid option within the version that they suggest).
If they don't suggest a webpack version to use then you can go through the various versions on one of the NPM websites to find and install the right one.
Or you might be able to find and remove --inline from the build script, then rerun it.
Or work off of a different/more recent build guide maybe?

Hey @MC_Brisbane, I tried all your suggestions: 1) I used the latest iteration of plutus-pioneer-program, 2) used older versions of webpack, 3) deleted --inline from package.jason. None of them solved the issue. Deleting --inline actually threw out a different error.
I just really wonder how it's working for others but not for me? I followed all the build instructions to the tee.

Hi John, can you provide a link to the guide that you are following. Also which was the latest version of webpack that you tried that has --inline included?

Hi MC_Brisbane, thank you for trying to help me with this issue. I basically watch Lars' plutus tutorial videos as well as tutorials from other youtubers. I did not follow the plutus docs because it is outdated and there was no mention about the issue that I am currently having. The third video below really helped me overcome previous issues I've encountered.

Lars - https://www.youtube.com/watch?v=AnID8hn68DA&list=PLK8ah7DzglhhM57VKQTMIGDZj5OnmfgOX
https://www.youtube.com/watch?v=mnfItts6VbU
https://www.youtube.com/watch?v=CXHmbOkoVG8&list=WL&index=1

Also, the "--inline" that I deleted is not within webpack (I am using 5.72.1) but from the package.json file within the plutus-playground-client folder of plutus-apps. I am not sure if this is what I should delete(?)
Thank you again for helping!

At lot has changed since those 2021 videos were put together, but I'm sure they still have useful info. Looking at the 'PPP 030103' Jan 2022 videos (https://www.youtube.com/watch?v=zPaDp4R9X7o), Lars mentions that you need to set up NIX and start by cloning https://github.com/input-output-hk/plutus-pioneer-program and https://github.com/input-output-hk/plutus-apps (NOTE: this is not the main plutus codebase) Can you confirm that you followed each of these installation instructions? If not I'd lean towards starting over and following the IOHK github instructions and guidance from Lars' videos.

Can you post the full error details from the 'npm start' command. Also, I presume that the PP Server is running correctly when you run 'npm start' - can you please confirm, just in case?

Hello MC_Brisbane, my apologies if I have not responded to you earlier. I've been putting off some of my activities as I've been focusing on finding a job. It's very stressful but when I squared this problem away, I will be back to learning Plutus. I really appreciate your help!

No problem, John. We can pick this up again later. Best of luck with the job search.

@MC_Brisbane-JUSTPool migth sound silly but have you tryied running npm install before?


text:
Extract keypair from hd wallet address and use for signing/verifying via libsodium
I like to use priv/pub keypair of an hd wallet address to sign/verfify data (outside a transaction signment). Based on this question i know how to derive the private key out of an address and i assume to get the public key via:
./cardano-address key inspect <<< $(cat public.key)

and then use the 'extended_key' value.
I try to verify the extracted keypair via libsodium:
sign:     libsodium.crypto_sign(message, sender_secret_ed25519)
verify:   libsodium.crypto_sign_open(signed_message, sender_pubkey_ed25519)

and fail to verify a signed message.
I think i may use the wrong public and/or private key or i need to convert the keys somehow.
does anyone have a recommendation to get this working?


text:
systemd auto run stake poll issue (code=exited, status=127)
I have been trying to run the Cardano node by systemd for about 3 days but not getting any luck
I can run startBlockProducingNode.sh manually without error, Cardano node run successfully
The systemd failed with (code=exited, status=127) but did not say any error
Below is the systemd status
May 20 15:40:56 systemd[1]: Started Cardano node service.
May 20 15:40:56 systemd[1]: cardano-node.service: main process exited, code=exited, status=127/n/a
May 20 15:40:56 systemd[1]: Unit cardano-node.service entered failed state.
May 20 15:40:56 systemd[1]: cardano-node.service failed.
May 20 15:41:01 systemd[1]: cardano-node.service holdoff time over, scheduling restart.
May 20 15:41:01 systemd[1]: Stopped Cardano node service.

By the way, I'm using ec2 from aws

Can you post your systemd settings into your question for us to review. There is a good chance that more environment settings need to be set, when compared to your user that runs the script successfully. Also check your system logs for any extra details eg permissions issues

I have solved the issue by myself, here is the solution:
The solution for those who followed the Cardano developer portal to build the stake pool but failed to use systemd to start

move the file

$ which cardano-node

~/.local/bin/cardano-node

$ cd ~/.local/bin/

$ sudo cp cardano-cli /usr/local/bin/

$ sudo cp cardano-node /usr/local/bin/

Set the enviroment in systemd file

Environment="LD_LIBRARY_PATH=/usr/local/lib"
Environment="PKG_CONFIG_PATH=/usr/local/lib/pkgconfig"
Environment="CARDANO_NODE_SOCKET_PATH="$HOME/cardano-src/db/node.socket"


text:
Maximum transaction fees possible & maximum ada needed for collateral as per current protocol parameters
As per my understanding, the formula to calculate for the transaction fees is a * tx' + b where tx' is the size of the transaction (in bytes).
Now the current value of a & b is 44 & 155381 respectively and bounding tx' by 16384, I get that fees is always <= 0.876277 ada. And therefore the ada only balance needed as collateral should always be <= ⌈1.5 * 0.876277⌉ = 1.314416 ada (collateral percentage is set to 150 inside current protocol parameters).
Is the above formulation correct?

Your formula is correct if no Plutus script is executed in the transaction. If a Plutus script validates the transaction, then one needs to add the cost of the most costly possible Plutus script. Here is a recipe: Language.Marlowe.Runtime.Transaction.Constraints.maximumFee.
The collateralPercentage procotol parameter will tell you how much greater than the fee the collateral requirement is. Currently it is 150%..


text:
Obtain a wallet address from PKH and wallet ID in python?
I need a bech32 wallet address and all that I have is my wallet PKH and a wallet Id. Is there a way to derive that bech32 address in python?
Needed to perform queries on blockfrost and find how much amount of ADA I have in my wallet.

You can use pycardano to derive the address from a public key file.
Example:
from pycardano import Key, Address, Network

pk = Key.load("/path/to/payment.vkey")
pkh = pk.hash()
addr = Address(payment_part=pkh, Network.MAINNET)
print(addr)

If you already have the public key hash, use the following code to get pkh:
from pycardano import VerificationKeyHash
pkh = VerificationKeyHash(bytes.fromhex("1234abcd..."))

You can learn more about key and address manipulations in this page: https://pycardano.readthedocs.io/en/latest/guides/address.html

The PKH is for verifying the authenticity of a signed transaction. We couldn't convert it to the bech32 wallet address. Hashing is a one-way function. It means that if you hash a piece of data, it is impossible to revert the hash to its original form.
For instance, we consider a simple function used to get the modulus of 3 and a list of the input value
1 `mod` 3 = 1
2 `mod` 3 = 2
3 `mod` 3 = 3
4 `mod` 3 = 1

In this example, the list of the input value is [1,2,3,4] and the list of hash results is [1,2,3,1]. So the 1 can be from 1, 4, 7, and so on. This is for the demonstration only, In practice hash functions shouldn't result in a small range of values like this.


text:
Failed to build atlas examples with cabal
I tried both in the main branch and in the atlas-0.3-update branch and get the same result. but when i run cabal build i get the same error fatal: Could not parse object 'c30d0de6875d75edd64d1aac2272886528bc492d'.
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/servant-o_-d7933ffd24e60785'...
remote: Enumerating objects: 1757, done.
remote: Counting objects: 100% (357/357), done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 1757 (delta 320), reused 321 (delta 299), pack-reused 1400
Receiving objects: 100% (1757/1757), 385.48 KiB | 1.68 MiB/s, done.
Resolving deltas: 100% (818/818), done.
HEAD is now at 4165b83 Allow lens-aeson 1.2 (#27)
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/blockfros_-88bd16c71266eeaf'...
remote: Enumerating objects: 1524, done.
remote: Counting objects: 100% (70/70), done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 1524 (delta 35), reused 28 (delta 23), pack-reused 1454
Receiving objects: 100% (1524/1524), 264.98 KiB | 1.11 MiB/s, done.
Resolving deltas: 100% (1025/1025), done.
HEAD is now at 206e1a0 Merge pull request #39 from blockfrost/release/api-0.8.1
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/atlas-bc9347bbf4453d47'...
remote: Enumerating objects: 3615, done.
remote: Counting objects: 100% (1258/1258), done.
remote: Compressing objects: 100% (458/458), done.
remote: Total 3615 (delta 802), reused 1048 (delta 689), pack-reused 2357
Receiving objects: 100% (3615/3615), 986.51 KiB | 3.29 MiB/s, done.
Resolving deltas: 100% (2122/2122), done.
HEAD is now at e98e072 Merge pull request #235 from geniusyield/196-no-separate-change-output-for-fee-over-approximation
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/plutus-si_-405d5a8470902f38'...
remote: Enumerating objects: 3780, done.
remote: Counting objects: 100% (455/455), done.
remote: Compressing objects: 100% (189/189), done.
remote: Total 3780 (delta 213), reused 419 (delta 193), pack-reused 3325
Receiving objects: 100% (3780/3780), 776.16 KiB | 2.10 MiB/s, done.
Resolving deltas: 100% (1895/1895), done.
HEAD is now at 0cb63af Added function to know output references at a payment credential
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/bech32-b0701c420aaaffda'...
remote: Enumerating objects: 3973, done.
remote: Counting objects: 100% (232/232), done.
remote: Compressing objects: 100% (88/88), done.
remote: Total 3973 (delta 146), reused 188 (delta 124), pack-reused 3741
Receiving objects: 100% (3973/3973), 12.37 MiB | 13.76 MiB/s, done.
Resolving deltas: 100% (2808/2808), done.
HEAD is now at e341e7f Bump copyright years. (#57)
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/cardano-a_-69e96f3eceed3ed5'...
remote: Enumerating objects: 21355, done.
remote: Counting objects: 100% (3108/3108), done.
remote: Compressing objects: 100% (776/776), done.
remote: Total 21355 (delta 2386), reused 2988 (delta 2286), pack-reused 18247
Receiving objects: 100% (21355/21355), 76.06 MiB | 20.55 MiB/s, done.
Resolving deltas: 100% (16643/16643), done.
HEAD is now at 6b55f96d Merge pull request #223 from input-output-hk/paweljakubas/mbo-preparation
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/cardano-s_-dd52ae23692dff9'...
remote: Enumerating objects: 313, done.
remote: Counting objects: 100% (167/167), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 313 (delta 64), reused 162 (delta 64), pack-reused 146
Receiving objects: 100% (313/313), 1.00 MiB | 3.09 MiB/s, done.
Resolving deltas: 100% (114/114), done.
HEAD is now at a91add1 update aeson v2
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/cardano-w_-c9e033b0ec7ad11b'...
remote: Enumerating objects: 295476, done.
remote: Counting objects: 100% (13988/13988), done.
remote: Compressing objects: 100% (5178/5178), done.
remote: Total 295476 (delta 7416), reused 12780 (delta 6485), pack-reused 281488
Receiving objects: 100% (295476/295476), 243.78 MiB | 27.35 MiB/s, done.
Resolving deltas: 100% (198692/198692), done.
HEAD is now at 3f0d2f3abe Release v2023-07-18 (#4046)
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/haskell-s_-e5692cba7ac918b3'...
remote: Enumerating objects: 1798, done.
remote: Counting objects: 100% (412/412), done.
remote: Compressing objects: 100% (198/198), done.
remote: Total 1798 (delta 179), reused 371 (delta 174), pack-reused 1386
Receiving objects: 100% (1798/1798), 279.41 KiB | 1.31 MiB/s, done.
Resolving deltas: 100% (994/994), done.
HEAD is now at 3c4efcc Merge branch 'main' into drop-v0
Cloning into '/home/cardano/projects/github/atlas-examples/dist-newstyle/src/openapi3-8b632f0d82841c8c'...
remote: Enumerating objects: 4264, done.
remote: Counting objects: 100% (318/318), done.
remote: Compressing objects: 100% (120/120), done.
remote: Total 4264 (delta 209), reused 256 (delta 164), pack-reused 3946
Receiving objects: 100% (4264/4264), 953.71 KiB | 3.08 MiB/s, done.
Resolving deltas: 100% (2080/2080), done.
fatal: Could not parse object 'c30d0de6875d75edd64d1aac2272886528bc492d'.

This commit was used due to dependency upon cardano-wallet library. Recently, it was updated on their end, consequently we had to update it as well, as in this PR.
Atlas should build well with latest commit of main. If you have trouble building it, then our CI file should help.
Unfortunately, atlas-examples repository isn't updated in sync with latest Atlas changes. Maybe you can help with it :)

I changed the tag and the sha of the opanapi3 repo as shown in the file changes of the PR you linked. however now i get a different set of errors. something Error: cabal: Could not resolve dependencies something about a version constraint caused the previous version to fail: excluded by constraint '^>=4.14.1.0' from 'atlas'). i would share with you the whole error but comments in stack exchange don't allow me to post the entire error.


text:
Unable to run cardano-node on Preview and Pre-Production Testnet
System Info: macOS Monterey Version 12.6. with an M1 Chip.
I'm using cardano-node 1.35.3 that is installed with the Daedalus Mainnet wallet by appending the following in my .zshrc file:
export PATH="/Applications/Daedalus Mainnet.app/Contents/MacOS:$PATH"

I followed this guide to run cardano-node: https://developers.cardano.org/docs/get-started/running-cardano/
I get the configuration files from here: https://book.world.dev.cardano.org/environments.html
As in the guide above, my directory structure looks like this:
$HOME/cardano/
├── db
├── alonzo-genesis.json
├── byron-genesis.json
├── config.json
├── shelley-genesis.json
└── topology.json
1 directory, 5 files

In this directory, I run the following command:
cardano-node run \
  --topology topology.json \
  --database-path db \
  --socket-path db/node.socket \
  --host-addr 127.0.0.1 \
  --port 1337 \
  --config config.json

When I use the configuration files for mainnet and the old testnet, the command works as expected and the node is syncing because I see output like this:
Chain extended, new tip: b4624d1ad9fa00eaf81b57fa0561f24593d11adca70b45ee967484c8d5c26efa at slot 27173

However, when using the configuration files for the preview and pre-production testnet, I get the following output/error which repeats itself and the node does not sync. How can I solve this?
[student-:cardano.node.PeerSelection:Info:52] [2022-10-07 14:09:06.10 UTC] TraceGovernorWakeup
[student-:cardano.node.PeerSelection:Info:52] [2022-10-07 14:09:06.10 UTC] TracePromoteColdPeers 50 0 (fromList [3.72.231.105:30002])
[student-:cardano.node.ConnectionManager:Info:68] [2022-10-07 14:09:06.10 UTC] TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 0, inboundConns = 0, outboundConns = 0})
[student-:cardano.node.ConnectionManager:Info:68] [2022-10-07 14:09:06.10 UTC] TrConnectError (Just 127.0.0.1:3001) 3.72.231.105:30002 Network.Socket.connect: <socket: 29>: unsupported operation (Can't assign requested address)
[student-:cardano.node.ConnectionManager:Info:68] [2022-10-07 14:09:06.10 UTC] TrConnectionManagerCounters (ConnectionManagerCounters {fullDuplexConns = 0, duplexConns = 0, unidirectionalConns = 0, inboundConns = 0, outboundConns = 0})
[student-:cardano.node.PeerSelection:Info:52] [2022-10-07 14:09:06.10 UTC] TracePromoteColdFailed 50 0 3.72.231.105:30002 41.140901877674s Network.Socket.connect: <socket: 29>: unsupported operation (Can't assign requested address)
[student-:cardano.node.PeerSelection:Info:52] [2022-10-07 14:09:29.81 UTC] TraceGovernorWakeup
[student-:cardano.node.PeerSelection:Info:52] [2022-10-07 14:09:29.81 UTC] TracePublicRootsRequest 100 1
[student-:cardano.node.LedgerPeers:Info:50] [2022-10-07 14:09:29.81 UTC] [String "FetchingNewLedgerState",Number 0.0]
[student-:cardano.node.LedgerPeers:Info:50] [2022-10-07 14:09:29.82 UTC] [String "FallingBackToBootstrapPeers"]
[student-:cardano.node.LedgerPeers:Info:50] [2022-10-07 14:09:29.82 UTC] [String "UseLedgerAfter",Number 322000.0]
[student-:cardano.node.PublicRootPeers:Info:69] [2022-10-07 14:09:29.82 UTC] TracePublicRootRelayAccessPoint [RelayAccessDomain "preview-node.world.dev.cardano.org" 30002]
[student-:cardano.node.PublicRootPeers:Info:69] [2022-10-07 14:09:29.82 UTC] TracePublicRootRelayAccessPoint [RelayAccessDomain "preview-node.world.dev.cardano.org" 30002]
[student-:cardano.node.PublicRootPeers:Info:69] [2022-10-07 14:09:29.85 UTC] TracePublicRootResult "preview-node.world.dev.cardano.org" [(3.72.231.105,60)]
[student-:cardano.node.PeerSelection:Info:52] [2022-10-07 14:09:29.85 UTC] TracePublicRootsResults (fromList []) 1 2s

Full output here: https://gist.github.com/samuelpullely/60223a98066dd5f72c597a681021c2a3
Similar (unresolved) questions:

Cardano-Node Preview Testnet PeerSelection Error (Ubuntu 22.04 Docker container)

Running preview/preprod Cardano-node on windows (Windows)

It seems like this issue does not only appear on macOS.

When I copied and pasted text, I faced the similar problem. May be formatting matters. Try getting raw files directly from github like:
curl -O -J https://raw.githubusercontent.com/input-output-hk/cardano-world/master/docs/environments/preprod/alonzo-genesis.json

Change "/preprod/" to "/preview/" and "alonzo-genesis.json" to other names, to fit your needs.
Also in my case, I have to change host-addr to 0.0.0.0 like:
--host-addr 0.0.0.0 \

Lastly, make sure the database in db folder is NOT from the mainnet/testnet/different net. To be super-safe, just empty the db folder.

Thanks a lot, changing the host-addr worked


text:
gLiveView not working and cnode.service could not be found setting up node for first time
My node is syncing right now for the first time but i can't check the progress or node status.
GLiveView failed to load and cnode.service could not be found

Did you set the port on gLiveView's env file?
Also gLiveView will not work until epoch 208 is synced as said here:

A node must synchronize to epoch 208 (Shelley launch) before
gLiveView.sh can start tracking the synchronization process.

For the problem with systemctl, are you sure that you've created the service?
Which guide did you follow?


text:
How build a transaction to add ADA and change the datum of a previous transaction with assets and ADA locked in a script
I have locked ADA and assets into a script.
I want to use the last transaction output and the ADA of a wallet as inputs and I want to have an output with some extra ADA locked and the datum changed
const settings = {
  protocolParams: {
    linearFee: {
      minFeeA: "44",
      minFeeB: "155381",
    },
    minUtxo: "4310",
    poolDeposit: "500000000",
    keyDeposit: "2000000",
    maxValSize: 5000,
    maxTxSize: 16384,
    priceMem: 0.0577,
    priceStep: 0.0000721,
    coinsPerUtxoByte: "4310",
  }
};
    const initTransactionBuilder = () => {
        const { protocolParams } = settings;
        const txBuilder = TransactionBuilder.new(
        TransactionBuilderConfigBuilder.new()
        .fee_algo(LinearFee.new(BigNum.from_str(protocolParams.linearFee.minFeeA), BigNum.from_str(protocolParams.linearFee.minFeeB)))
        .pool_deposit(BigNum.from_str(protocolParams.poolDeposit))
        .key_deposit(BigNum.from_str(protocolParams.keyDeposit))
        .coins_per_utxo_byte(BigNum.from_str(protocolParams.coinsPerUtxoByte))
        .max_value_size(protocolParams.maxValSize)
        .max_tx_size(protocolParams.maxTxSize)
        .prefer_pure_change(true)
        .build()
        );
        return txBuilder
    };
    const buildRedeemAdaFromPlutusScript = async (walletApi,
        { transactionIdLocked, transactionIndxLocked, lovelaceLocked, manualFee, CollatUtxos, newDatumStr, datumStr }) => {
        const txBuilder = initTransactionBuilder();
        const ScriptAddress = Address.from_bech32(settings.smartContract.addressScriptBech32);
        const shelleyChangeAddress = Address.from_bech32(await walletApi.getChangeAddress());

        let multiAsset = MultiAsset.new();
        let assets = Assets.new()
        assets.insert(
        AssetName.new(Buffer.from(assetNameHex, "hex")),
        BigNum.from_str(assetAmountToSend.toString())
        );
        multiAsset.insert(
        ScriptHash.from_bytes(Buffer.from(assetPolicyIdHex, "hex")),
        assets
        );

        const outputVal = 2 * lovelaceLocked - Number(manualFee);
        const outputValStr = outputVal.toString();

        let txOutputScriptBuilder = TransactionOutputBuilder.new();
        txOutputScriptBuilder = txOutputScriptBuilder.with_address(ScriptAddress);
        const dataHash = hash_plutus_data(PlutusData.new_integer(BigInt.from_str(newDatumStr)));
        txOutputScriptBuilder = txOutputScriptBuilder.with_data_hash(dataHash)
        txOutputScriptBuilder = txOutputScriptBuilder.next();
        txOutputScriptBuilder = txOutputScriptBuilder.with_coin_and_asset(BigNum.from_str(outputValStr), multiAsset)
        const txOutputScript = txOutputScriptBuilder.build();
        txBuilder.add_output(txOutputScript)

        txBuilder.add_input(
        ScriptAddress,
        TransactionInput.new(
            TransactionHash.from_bytes(Buffer.from(transactionIdLocked, "hex")),
            transactionIndxLocked.toString()),
            Value.new_with_assets(BigNum.from_str(lovelaceLocked.toString()), multiAsset)
        );

        const { txOutputs: txUnspentOutputs } = await walletApi.getUtxos();
        txBuilder.add_inputs_from(txUnspentOutputs, 2)
        txBuilder.add_change_if_needed(shelleyChangeAddress)

        txBuilder.set_fee(BigNum.from_str(Number(manualFee).toString()));
        const txBody = txBuilder.build();

        const scripts = PlutusScripts.new();
        scripts.add(PlutusScript.from_bytes(Buffer.from(settings.smartContract.plutusScriptCborHex, "hex")));

        const collateral = CollatUtxos;
        const inputs = TransactionInputs.new();
        collateral.forEach((utxo) => {
            inputs.add(utxo.input());
        });

        const datum = PlutusData.new_integer(BigInt.from_str(datumStr));

        const redeemers = Redeemers.new();
        const redeemer = Redeemer.new(
        RedeemerTag.new_spend(),
        BigNum.from_str("0"),
        datum,
        ExUnits.new(
            BigNum.from_str("7000000"),
            BigNum.from_str("3000000000")
        )
        );
        redeemers.add(redeemer);
        const datums = PlutusList.new();
        datums.add(datum);

        const transactionWitnessSet = TransactionWitnessSet.new();
        transactionWitnessSet.set_plutus_scripts(scripts);
        transactionWitnessSet.set_plutus_data(datums);
        transactionWitnessSet.set_redeemers(redeemers);
        const cost_model_vals = [
        205665, 812, 1, 1, 1000, 571, 0, 1, 1000, 24177, 4, 1, 1000, 32, 117366,
        10475, 4, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000, 100, 23000,
        100, 100, 100, 23000, 100, 19537, 32, 175354, 32, 46417, 4, 221973, 511, 0, 1,
        89141, 32, 497525, 14068, 4, 2, 196500, 453240, 220, 0, 1, 1, 1000, 28662, 4,
        2, 245000, 216773, 62, 1, 1060367, 12586, 1, 208512, 421, 1, 187000, 1000,
        52998, 1, 80436, 32, 43249, 32, 1000, 32, 80556, 1, 57667, 4, 1000, 10,
        197145, 156, 1, 197145, 156, 1, 204924, 473, 1, 208896, 511, 1, 52467, 32,
        64832, 32, 65493, 32, 22558, 32, 16563, 32, 76511, 32, 196500, 453240, 220, 0,
        1, 1, 69522, 11687, 0, 1, 60091, 32, 196500, 453240, 220, 0, 1, 1, 196500,
        453240, 220, 0, 1, 1, 806990, 30482, 4, 1927926, 82523, 4, 265318, 0, 4, 0,
        85931, 32, 205665, 812, 1, 1, 41182, 32, 212342, 32, 31220, 32, 32696, 32,
        43357, 32, 32247, 32, 38314, 32, 9462713, 1021, 10,
        ];
        const costModel = CostModel.new();
        cost_model_vals.forEach((x, i) => costModel.set(i, Int.new_i32(x)));
        const costModels = Costmdls.new();
        costModels.insert(Language.new_plutus_v1(), costModel);
        const scriptDataHash = hash_script_data(redeemers, costModels, datums);
        txBody.set_script_data_hash(scriptDataHash);
        txBody.set_collateral(inputs);
        const baseAddress = BaseAddress.from_address(shelleyChangeAddress);
        const requiredSigners = Ed25519KeyHashes.new();
        requiredSigners.add(baseAddress.payment_cred().to_keyhash());
        txBody.set_required_signers(requiredSigners);
        const tx = Transaction.new(
        txBody,
        TransactionWitnessSet.from_bytes(transactionWitnessSet.to_bytes())
        );
        let txVkeyWitnesses = await walletApi.api.signTx(Buffer.from(tx.to_bytes(), "utf8").toString("hex"), true);
        txVkeyWitnesses = TransactionWitnessSet.from_bytes(Buffer.from(txVkeyWitnesses, "hex"));
        transactionWitnessSet.set_vkeys(txVkeyWitnesses.vkeys());
        const signedTx = Transaction.new(
        tx.body(),
        transactionWitnessSet
        );
        const submittedTxHash = await walletApi.api.submitTx(Buffer.from(signedTx.to_bytes(), "utf8").toString("hex"));
        return { submittedTxHash };
    };

Error:
""transaction submit error ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError [UtxowFailure (UtxoFailure (FromAlonzoUtxoFail (ValueNotConservedUTxO (Value 2258970370 (fromList [(PolicyID {policyID = ScriptHash \"9560a89a549f66bb02c4a04525e8e367283f566ec0e34e1a31cf3aa2\"},fromList [(4a616c61436f696e,999962)])])) (Value 2259870370 (fromList [(PolicyID {policyID = ScriptHash \"9560a89a549f66bb02c4a04525e8e367283f566ec0e34e1a31cf3aa2\"},fromList [(4a616c61436f696e,999962)])])))))])""

From the error message it looks like your input value is not equal your output value minus fees, so I suggest checking the Tx inputs.


text:
Cardano Wallet Server Invalid Argument
I'm trying to run cardano wallet server but it keeps me giving an error and have no idea what's wrong with it.
This is the command I run:
    cardano-wallet serve \
      --port 1919 \
      --node-socket /home/ubuntu/cardano-src/cardano-node/data/node.socket \
      --mainnet /home/ubuntu/cardano-src/cardano-node/mainnet-byron-genesis.json \
      --database /home/ubuntu/cardano-src/cardano-node/data \

This is the error:
Invalid argument `/home/ubuntu/cardano-src/cardano-node/mainnet-byron-genesis.json'

Any help is appreciated, thank you all in advance!

Problem solved after deleting the path to the file. --mainnet doesn't need any parameter to pass.
cardano-wallet serve \
      --port 1919 \
      --node-socket /home/ubuntu/cardano-src/cardano-node/data/node.socket \
      --mainnet \
      --database /home/ubuntu/cardano-src/cardano-node/data \

It does not seem you need a genesis file for the mainnet. Check here https://input-output-hk.github.io/cardano-wallet/user-guide/common-use-cases/how-to-start-wallet-server

I did download the file again from here: https://hydra.iohk.io/build/14528927/download/1/mainnet-byron-genesis.json but I still got the same error :/


text:
Is there a place where we can find the Haskell library for Marlowe?
I investigated some Code examples, in haskell for Marlowe smart-contract, and used the "cabal repl" with the " :i " command, like this:
*Main> :i ValueEQ
type Observation :: *
data Observation = ... | ValueEQ Value Value | ...
-- Defined in ‘Language.Marlowe.Extended’
But I could not find the target library ‘Language.Marlowe.Extended’.
Is there a place where we can find the Haskell libraries for Marlowe?
There's perhaps also a haddock, like in Plutus, for Marlowe?

Here are instructions for accessing Marlowe types and functions from ghci.

Thank you very much, Brian, It will be very very helpful. By the way, your lecture on the Cli was really great too!

With some research, the Haskell libraries for Marlowe seems to be here precisely.

What you are looking for is the repo where the Marlowe lang is implemented, more specifically the data constructor that you show is defined in the Observation data type:
data Observation = AndObs Observation Observation
                 | OrObs Observation Observation
                 | NotObs Observation
                 | ChoseSomething S.ChoiceId
                 | ValueGE Value Value
                 | ValueGT Value Value
                 | ValueLT Value Value
                 | ValueLE Value Value
                 | ValueEQ Value Value
                 | TrueObs
                 | FalseObs
  deriving stock (Show,Generic)
  deriving anyclass (Pretty)

Which is found in Language.Marlowe.Extended. So you can directly refer to the repo where the Haskell libraries are defined.

Yes, with your links and some research, the Marlowe libraries seems to be here. Thanks Igodlab. I don't know if it's the same version as in the Marlowe Playground, yet.

You can look at the git rev in your cabal.project file to know what commit snapshot the Marlowe Playground uses.
Glad it helped! If you upvote and mark my answer as solved it will help other people find it ;)

You need at least 15 reputations to cast a vote, So I can't.

I have upvote your answer, which helped me in part, and put one with a bit more of precision, now that my reputation has grown, Igodlab.


text:
How do I test my smart-contract on Cardano
I'm from EVM background and I've started learning about Cardano lately. I was just wondering how do I write unit tests for my smart-contract written in Haskell? Since i've been doing unit testing in javascript for solidity, using mocha/chai. Can I use javascript here aswell for uint tests?
TIA!

I find that using the plutus PAB simulator is the best way to first test out your smart contract.   Once you confirm the smart contract logic is correct, you then move on to a local dev environment using cardano-cli to deploy your smart contract and run transactions against it.   Finally, once that is working, then you are ready for testnet testing which can be done either via the cardano-cli or through javascript wallet integration via Cardano serialization library.  This has been my experience to date and it will most likely be improved and be streamlined over time.
You can checkout my repo for some code examples and tips and trick I used for the PAB simulator, devnet and testnet testing.
https://github.com/lley154/cardano-lottery


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

fingerprint: asset1m4u92ke6820pkk07m8qmmguye02ewr8g6tezr0

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

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

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

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

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

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

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

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

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


text:
How to use webhook on Blockfrost?
I want to trigger a function when someone sent ADA to an address addr1xxxxxx.
I use webhook from Blockfrost. I see this link (https://blockfrost.dev/docs/start-building/webhooks/using-webhooks) to describe how to use it.
I works fine if I use public webhook site (https://webhook.site/)
but it fails to trigger on my own server.
I set up as follows:

I create a webhook on blockfrost website as follows.

The endpoint URL is set to the static address of my server, at port 6666.
Trigger condition is set when someone sends ADA to the address addr1xxxx

After creating this, Blockfrost will generate an Auth token.

I replace SECRET_AUTH_TOKEN in the following script by the above Auth token.

# Example of Python Flask app with /webhook endpoint
# for processing events sent by Blockfrost Secure Webhooks
from flask import Flask, request, json
from blockfrost import verify_webhook_signature

# You will find your webhook secret auth token in your webhook settings in the Blockfrost Dashboard
SECRET_AUTH_TOKEN = "SECRET-WEBHOOK-AUTH-TOKEN"

app = Flask(__name__)

# Define endpoint /webhook that accepts POST requests
@app.route('/webhook', methods=['POST'])
def webhook():
    if request.method == 'POST':
        # Validate webhook signature
        request_bytes = request.get_data()
        try:
            verify_webhook_signature(
                request_bytes, request.headers['Blockfrost-Signature'], SECRET_AUTH_TOKEN)
        except SignatureVerificationError as e:
            # In case of invalid signature verify_webhook_signature will raise SignatureVerificationError
            # for easier debugging you can access passed header and request_body values (e.header, e.request_body)
            print('Webhook signature is invalid.', e)
            return 'Invalid signature', 403

        # Get the payload as JSON
        event = request.json

        print('Received request id {}, webhook_id: {}'.format(
            event['id'], event['webhook_id']))

        if event['type'] == "transaction":
            # process Transaction event
            print('Received {} transactions'.format(len(event['payload'])))
            # loop through the payload (payload is an array of Transaction events)
            for transaction in event['payload']:
                print('Transaction id: {}, block: {} ({})'.format(
                    transaction['tx']['hash'], transaction['tx']['block'], transaction['tx']['block_height']))

        elif event['type'] == "block":
            # process Block event
            print('Received block hash {}'.format(event['payload']['hash']))

        elif event['type'] == "delegation":
            # process Delegation event
            print('Received {} delegations'.format(len(event['payload'])))
            # loop through the payload, payload is an array of objects with fields: "tx" (an object) and "delegations" (an array)
            for transaction in event['payload']:
                for delegation in transaction['delegations']:
                    print('Delegation from an address {} included in tx {}'.format(
                        delegation['address'], transaction['tx']['hash'])
                    )

        elif event['type'] == "epoch":
            # process Epoch event
            print('Epoch switch from {} to {}'.format(
                event['payload']['previous_epoch']['epoch'], event['payload']['current_epoch']['epoch']))

        else:
            # Unexpected event type
            print('Unexpected event type {}'.format(event['type']))

        return 'Webhook received', 200
    else:
        return 'POST Method not supported', 405

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=6666)

I run the script on my own server. My server has static as same as set in Endpoint URL

But when addr1xxx received ADA, the script was not trigger. I do not know where I am wrong.
I am new to webhook. Your help would help me a lot.Thanks

If it works on the public side, it probably a problem with your script. When you go to the Blockfrost dashboard and click on your webhook, what do you see in Failed requests?

The script is copied from here ( https://blockfrost.dev/docs/start-building/webhooks/using-webhooks.) with no change except the "SECRET-WEBHOOK-AUTH-TOKEN".
In "Failed request" of the dashboard, It says "Timeout awaiting 'request' for 5000ms". I think it could not reach my public website. But I dont know how to set it.

Yeah, it appears your website is not public. Firewall? Not listening on correct interface? Can you reach it from outside of your server?

yes. My site has public IP and domain. I can access it through Internet through port 80.

What do you mean on different port? If you go to https://portchecker.co/, put in the same IP and port you have put in your webhook, is it open?

Should I config URL endpoint in the dashboard is http://xxxxx:6060/webhook or just http://xxxxx:6060. I actually do not fully understand the script.

Definitely /webhook, as it says in the comment Define endpoint /webhook that accepts POST requests.

Thanks. One more question. Should I set the endpoint by the domain or IP address (of my server), or either of them is fine?

Ether is fine, it just needs to resolve correctly.

Thanks for quick guide. I will check the port and report later.

It works. Thanks for your support

I’m voting to close this question because the problem has been on end-user's network configuration and not related to Blockfrost.


text:
mustMintValueWithRedeemer - Number of tokens minted
On the Offchain code I am trying to mint a token using the following snippet
Constraints.mustMintValueWithRedeemer r (assetClassValue cTk 1)

In the validation code of the minting script I am trying to verify if only one token was minted
tkMinted :: Value
tkMinted = txInfoMint info

But when I try to check the number of currencies minted using the following code
symbols tkMinted

I see there are more than one type of currency in the value list. Is this expected ?
Here is a detailed snippet
--------------
-- Policy
--------------

data UsrParams = UsrParams {
    tk :: !TokenName
  , c :: !CurrencySymbol
} deriving (Show, Generic, FromJSON, ToJSON, ToSchema)

PlutusTx.makeIsDataIndexed ''UsrParams [('UsrParams , 0)]
PlutusTx.makeLift ''UsrParams

{-# INLINABLE usrPolicy #-}
usrPolicy :: UsrParams -> BuiltinData -> Contexts.ScriptContext -> Bool
usrPolicy params r ctx = traceIfFalse  "Failed to mint!" ( tkMinted == (Value.singleton (c params) (tk params) 1) )
  where
    info :: V2LedgerApi.TxInfo
    info = Contexts.scriptContextTxInfo ctx

    currencySymbol :: CurrencySymbol
    currencySymbol = c params

    tkMinted :: Value
    tkMinted = V2LedgerApi.txInfoMint info

---------------------
-- Test Code
---------------------

asset :: AssetClass
asset = AssetClass (usrCurrencySymbol, TokenName "T1")

getCoins :: Integer -> Value
getCoins i = assetClassValue asset i

-------------
-- Endpoint
-------------

mintEP :: () -> Contract w TradeSchema Text ()
mintEP _ = do
    let
        val     = getCoins 1
        lookups = Constraints.plutusV2MintingPolicy (usrMintingPolicy $ PlutusTx.toBuiltinData usrParams )
        tx      = Constraints.mustMintValue val

    ledgerTx <- submitTxConstraintsWith @Void lookups tx
    void $ awaitTxConfirmed $ getCardanoTxId ledgerTx
    Contract.logInfo @String $ printf "forged %s" (show val)

I don't understand why you're using <> here, is there another asset involved?

James - I have edited my question. I also added more snippets. The minting still fails


text:
Why do Binance stake pools pledge nothing?
Binance runs 62 pools close to saturation. See AdaPools: https://adapools.org/groups/binance-20. But I am more surprised that every one of them has only 2 ADA in pledge! I am confused why Binance does this since nothing-at-pledge pools are supposed to only earn 77% of fully-pledged pools' rewards. Binance isn't dumb (or so I think) and they have dominated staking for a while, so they should know this better than me. If there's any technical reason behind this, could someone share them so we can better run our own pools? Thank you.
Edit: most Binance pools only have 5 to 10 delegators: https://cexplorer.io/groups/binance though all of them are public pools. In addition, they are promising 15% yields on Cardano so they are probably using a custom system anyway.
Related questions:

Why do Binance run 62 pools if it is an exchange?
Are there any negative effects of having too many stake pools run by central exchanges?

DISCLAIMER: There is no official statement from Binance on that topic, so I can only speculate.

Binance is running (similar to other big exchanges) a very large amount of pools. To be able to provide a meaningful pledge on all of them, they would have to hold a large amount of ADA. This would expose them to the risk of market volatility and also lock a substantial amount of funds that they can't use for anything else.
They can't increase the pledge on some of the pools without increasing it on all of the pools, because this would be unfair for their customers. (Some get better rewards, some worse).
Therefore I think the only logical thing to do for Binance (or other big staking providers) is to simply accept that the pools are earning less than the maximum amount of rewards. They still earn more than enough for it to be a profitable business due to the large amount of controlled stake. The people coming short are their customers, but they are probably not aware of this.
Another option would be to take the pools private (100% margin fee) and distribute the rewards using their own custom system. But this would increase the operational cost.

Thank you! I did my own research, and most Binance pools only have 5 to 10 delegators: https://cexplorer.io/groups/binance though all of them are public pools. In addition, they are promising 15% yields on Cardano so I think they are indeed using a custom system.


text:
Chain index stop syncing after slot 62510369, maybe related with new Babbage era
Chain index is not syncing in tesnet after Slot: 62510369,
BlockId: d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9
I converted to POSIX TIME and is: Friday, 22 July 2022 8:19:45.999 AM, related with the time frame of the new babbage era.
I download and built the latest plutus apps (commit 139c0429f2c7a656ff6114e6373f895d29132860) and syncing from zero again with no success.
Im using with cardano-node-1.35.0-linux which is syncing 100%.
There was similar issues with cardano-db-sync and they said they fix the issue there.
https://github.com/input-output-hk/cardano-db-sync/issues/1181
https://github.com/input-output-hk/cardano-db-sync/issues/1182
Here also, some report about the chain index rolling back slots after this slot:
https://github.com/input-output-hk/plutus-apps/pull/557
Any idea?
Im Running in WSL2 with Ubuntu.
The message from chain index is:
[chain-index:Info:33] [2022-07-17 01:06:05.64 UTC] Syncing (98.21%). Processed 0 blocks, 1 rollbacks in the last 12s. Current tip is Point(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9)
Here is full detaiuled run of chain index with verbose:
Command line config:
AppConfig {acLogConfigPath = Nothing, acMinLogLevel = Just Debug, acConfigPath = Just "/home/manuelpadilla/source/cardano-falcon-stakepool-devs/cardano-falcon-stakepol-devs-haskell/files/config/cardano-chain-index/chain-index-config.json", acCLIConfigOverrides = CLIConfigOverrides {ccSocketPath = Nothing, ccDbPath = Nothing, ccPort = Nothing, ccNetworkId = Nothing, ccAppendTransactionQueueSize = Nothing}, acCommand = StartChainIndex}

Logging config:
Representation {minSeverity = Debug, rotation = Nothing, setupScribes = [ScribeDefinition {scKind = StdoutSK, scFormat = ScText, scName = "stdout", scPrivacy = ScPublic, scRotation = Nothing, scMinSev = Debug, scMaxSev = Emergency}], defaultScribes = [(StdoutSK,"stdout")], setupBackends = [KatipBK,AggregationBK,MonitoringBK,EKGViewBK], defaultBackends = [KatipBK,AggregationBK,EKGViewBK], hasEKG = Just (Endpoint ("localhost",12790)), hasGraylog = Nothing, hasPrometheus = Nothing, hasGUI = Nothing, traceForwardTo = Nothing, forwardDelay = Nothing, traceAcceptAt = Nothing, options = fromList []}

Chain Index config:
Socket: /home/manuelpadilla/source/tools/cardano-node-1.35.0-linux2/db/node.socket
Db: /home/manuelpadilla/source/tools/cardano-chain-index/chain-index.db
Port: 9083
Network Id: Testnet (NetworkMagic {unNetworkMagic = 1097911063})
Security Param: 2160
Store from: BlockNo 0
Append transaction queue size: 500

The tip of the local node: SlotNo 63654709
Connecting to the node using socket: /home/manuelpadilla/source/tools/cardano-node-1.35.0-linux2/db/node.socket
[chain-index:Debug:11] [2022-07-17 02:13:00.78 UTC] BeamLogItem: SqlLog: SELECT "t0"."row_slot" AS "res0", "t0"."row_block_id" AS "res1", "t0"."row_block_number" AS "res2" FROM "tips" AS "t0" ORDER BY "t0"."row_slot" DESC;
-- With values: []
Starting webserver on port 9083
A Swagger UI for the endpoints are available at http://localhost:9083/swagger/swagger-ui
[chain-index:Debug:33] [2022-07-17 02:13:02.79 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:02.79 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:14.08 UTC] BeamLogItem: SqlLog: DELETE FROM "unspent_outputs" WHERE ("output_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:14.08 UTC] BeamLogItem: SqlLog: DELETE FROM "unmatched_inputs" WHERE ("input_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:14.08 UTC] BeamLogItem: SqlLog: SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0";
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:14.79 UTC] BeamLogItem: SqlLog: SELECT "t0"."input_row_tip__row_slot" AS "res0", "t0"."input_row_out_ref" AS "res1" FROM "unmatched_inputs" AS "t0";
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:14.86 UTC] BeamLogItem: SqlLog: SELECT "t0"."row_slot" AS "res0", "t0"."row_block_id" AS "res1", "t0"."row_block_number" AS "res2" FROM "tips" AS "t0" ORDER BY "t0"."row_slot" ASC;
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:15.85 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:15.86 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] BeamLogItem: SqlLog: DELETE FROM "unspent_outputs" WHERE ("output_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] BeamLogItem: SqlLog: DELETE FROM "unmatched_inputs" WHERE ("input_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] RollbackSuccess: New tip is Tip(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9, BlockNumber 3680594)
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Info:33] [2022-07-17 02:13:27.56 UTC] Syncing (98.20%). Processed 0 blocks, 1 rollbacks in the last 11s. Current tip is Point(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9)
[chain-index:Debug:33] [2022-07-17 02:13:27.56 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:39.04 UTC] BeamLogItem: SqlLog: DELETE FROM "unspent_outputs" WHERE ("output_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:39.04 UTC] BeamLogItem: SqlLog: DELETE FROM "unmatched_inputs" WHERE ("input_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:39.04 UTC] BeamLogItem: SqlLog: SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0";
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:39.68 UTC] BeamLogItem: SqlLog: SELECT "t0"."input_row_tip__row_slot" AS "res0", "t0"."input_row_out_ref" AS "res1" FROM "unmatched_inputs" AS "t0";
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:39.77 UTC] BeamLogItem: SqlLog: SELECT "t0"."row_slot" AS "res0", "t0"."row_block_id" AS "res1", "t0"."row_block_number" AS "res2" FROM "tips" AS "t0" ORDER BY "t0"."row_slot" ASC;
-- With values: []
[chain-index:Debug:33] [2022-07-17 02:13:40.69 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:40.69 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] BeamLogItem: SqlLog: DELETE FROM "unspent_outputs" WHERE ("output_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] BeamLogItem: SqlLog: DELETE FROM "unmatched_inputs" WHERE ("input_row_tip__row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] RollbackSuccess: New tip is Tip(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9, BlockNumber 3680594)
[chain-index:Info:33] [2022-07-17 02:13:52.59 UTC] Syncing (98.20%). Processed 0 blocks, 1 rollbacks in the last 11s. Current tip is Point(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9)
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] BeamLogItem: SqlLog: DELETE FROM "tips" WHERE ("row_slot")>(?);
-- With values: [SQLInteger 62510369]
[chain-index:Debug:33] [2022-07-17 02:13:52.59 UTC] BeamLogItem: SqlLog: DELETE FROM "utxo_out_refs" WHERE EXISTS (SELECT "t0"."output_row_tip__row_slot" AS "res0", "t0"."output_row_out_ref" AS "res1" FROM "unspent_outputs" AS "t0" WHERE (("t0"."output_row_tip__row_slot")>(?)) AND (("row_out_ref")=("t0"."output_row_out_ref")));
-- With values: [SQLInteger 62510369]

I'm not clear on what system you are having a problem with. You mentioned that your cardano-node is 100% synced - is your issue with your local cardano-db-sync? What errors/warnings are you getting in the log file? Share some log details here.

Im not using cardano-db-sync.
The problem is with plutus-app cardano-chain-index, need to run pab.
Im using WSL and ubuntu.
There is not error, just repeting all the time:
[chain-index:Info:33] [2022-07-17 01:06:05.64 UTC] Syncing (98.21%). Processed 0 blocks, 1 rollbacks in the last 12s. Current tip is Point(Slot 62510369, BlockId d931221f9bc4cae34de422d9f4281a2b0344e86aac6b31eb54e2ee90f44a09b9)
Looks like it is doing rollbacks all the new blocks.

cardano-node version 1.35.1 fixes the deserialisation error you mentioned.

Similar to cardano-db-sync references you found, every repo that is interacting with node has to go through updates to be able to read blocks post Vasil H/F.

Here also, some report about the chain index rolling back slots after this slot: https://github.com/input-output-hk/plutus-apps/pull/557

As mentioned in the issue, the work for compatibility with Vasil for plutus-apps is being done in next-node branch, it's not yet ready for PAB and will likely be part of upcoming release.

Perfect! I'll be more patience then! Is it normal to release a new version of the blockchain without all the required updates in the infrastructure around? Node, Wallet, Chain Index, Pab, DB-Sync? All the devs are going to pass by problems if we do the other way around. Some products could be in production, and they are going to stop working... don't you think?

The release being marked on node does not make it ready for mainnet, it's why they did not go for fork on mainnet yet. Currently, node/wallet/dbsync have Vasil ready versions already


text:
Problems with HLS with some versions of Plutus Apps: INFO hie-bios: error: cannot lock ref 'refs/remotes/origin/599'
I need some help with this problem.
With some version of Plutus Apps, HLS and VCode works perfect.
But with some specific versions, like this one:
commit cbc2df9e5d47d60505c28f321d75187d9ea85b07 (HEAD)

When HLS server starts, it throw and error with git from the Plutus Apps:
2022-11-09 17:18:26.921893854 [ThreadId 13] INFO hls:   Started LSP server in 0.00s
Couldn't load cradle (CradleNone)
2022-11-09 17:18:26.926139924 [ThreadId 13] INFO hls:   Registering ide configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri 8157433327350195780 "file:///home/manuelpadilla/source/copyRepos/RATS-DAO/rats-dao-devs-staking-plutus-v2"], clientSettings = hashed Nothing}
2022-11-09 17:18:26.948609165 [ThreadId 69] INFO hls:   Consulting the cradle for "src/Validators/StakePlusV2/OffChain/EndPoints.hs"
2022-11-09 17:18:27.688350926 [ThreadId 111] INFO hie-bios: error: cannot lock ref 'refs/remotes/origin/599': 'refs/remotes/origin/599/marconi-cli-list-index' exists; cannot create 'refs/remotes/origin/599'
2022-11-09 17:18:27.689133924 [ThreadId 111] INFO hie-bios: From https://github.com/input-output-hk/plutus-apps
2022-11-09 17:18:27.68928638 [ThreadId 111] INFO hie-bios:   ! [new branch]          599        -> origin/599  (unable to update local ref)

Every else works fine, and I can build my project without problems.
But HLS is very helpful for coding and I appreciated a lot if I can use it.
This is a version of Plutus Apps that I can use reference scripts and Inline Datums.
I don't have this any of this issues with some previous versions neither.
Thank you so much!

Im editing this with something that fix that problem for me. I deleted the cache of hie-bios with:
cd $HOME/.cache/
sudo rm -R  hie-bios

Check more solutions here:
https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html


text:
Exodus and Eternl extensions in chrome and brave are incompatible?
Im developing some dApp with a wallet connector using the extensions in chrome and brave.
Everything was working fine until I installed Exodus extension.
Something in creating a conflict here.
Look pictures attached:
1- This is my wallet connector before enabling Exodus extension:

2- Now, look the icons when I enable Exodus:

The Eternl icon disappears and also the functionality of Eternl wallet.
If I press that button it will open the Exodus wallet.
I checked in the windows.cardano object and I also found the problem there:
3- This is before enabling Exodus:

4- This is with Exodus wallet extension enabled:

You can see that the Eternl object is overwriting with the same content that the exodus object and only the name eternal is left.
Any idea? It is a bug? From who? Eternl? Exodus?

This is definitely a bug. I would lean toward it being firmly rooted on Exodus, but could be the fault of both Eternl and Exodus. The problem seems to be with variable scope. They both seem to obfuscate their front end code, which ends up making variables like A = N('icon'). If those variables are not scoped properly, other things will override them. For example, if both extension make use of A, one of them could have their functionality changed by the other. Theoretically, Exodus could simply grab window.cardano.eternl.icon and set it, but that would seem malicious and really offer no benefit. I would report the bug to both, as I can confirm that what you're seeing is happening to me as well.