Package Details: cardano-node 1.34.1-1

Git Clone URL: https://aur.archlinux.org/cardano-node.git (read-only, click to copy)
Package Base: cardano-node
Description: The core component that is used to participate in a Cardano decentralised blockchain.
Upstream URL: https://github.com/input-output-hk/cardano-node
Licenses: Apache
Submitter: emes
Maintainer: None
Last Packager: emes
Votes: 5
Popularity: 0.71
First Submitted: 2021-01-20 01:41 (UTC)
Last Updated: 2022-04-27 12:57 (UTC)

Latest Comments

« First ‹ Previous 1 2 3

andrej commented on 2021-04-07 01:36 (UTC) (edited on 2021-04-07 01:41 (UTC) by andrej)

A couple of other observations (gathered while experimenting with this):

  • Creating /var/lib/cardano-node/db/testnet in cardano-node.tmpfiles is troublesome, because it causes a new (mainnet) node to fail like this:
cardano-node[879002]: Shutting down..
cardano-node[879002]: NoDbMarkerAndNotEmpty "/var/lib/cardano-node/db/protocolMagicId"
cardano-node[879002]: cardano-node: Missing "/var/lib/cardano-node/db/protocolMagicId" but the folder was not empty

A removal of the directory fixes the problem. (That said, I'm not sure whether /var/lib/cardano-node/keys/testnet and /run/cardano-node/testnet should be created that way either, but they don’t cause errors, so … meh.)

  • It would be great to have something like this in the PKGBUILD:
backup=(var/lib/cardano-node/config/{main,test}net-{config,topology}.json)

Unlike the genesis files, the config and topology files may change.

The packaging documentation suggests that backup=(...) should be used primarily for files in /etc and it is (indeed) convenient to just find all .pacnew files in /etc (rather than in /var/lib) after an upgrade (to list all configuration that needs extra attention). A possible option might be to have --config and --topology in /etc/cardano-node. Or there could be a symlink-based setup of some sort, to make the ".pacnew files only appear in /etc" assumption work.

andrej commented on 2021-03-30 17:10 (UTC) (edited on 2021-04-03 07:50 (UTC) by andrej)

Also, for the record, it looks buggy, which I've reported upstream. I have no clue at this point whether it could be a packaging issue or not.

Edit: Nope, only the script that showed sync progress was buggy, not cardano-node itself.

andrej commented on 2021-03-29 21:02 (UTC) (edited on 2021-03-29 21:03 (UTC) by andrej)

@emes Sure, here's a makepkg output.

However, this is already after I installed a huge lot of Haskell stuff, all of these packages: yay -Sl | awk '$1 == "community" && $2 ~ /^haskell/ {print $2}' The errors had been different before that, suggesting that there might be (additionally) some Haskell-related dependencies missing.

emes commented on 2021-03-29 20:16 (UTC)

@lsf @andrej Could you guys please share the errors you encountered with my PKGBUILD?

andrej commented on 2021-03-29 19:59 (UTC)

@lsf Thanks a lot! The modified PKGBUILD works for me (unlike the original).

For cardano-wallet and cardano-addresses I ended up installing lots of haskell-hspec.* stuff (and other missing dependencies; after ~10 attempts I ended up just installing all of haskell.* from community) and ran cabal update a few times at random. (Heck, shouldn’t a build system be hermetic?) That ultimately made them build somehow.

But for cardano-node nothing of that^^^ worked and thus far the PKGBUILD modification has been the only feasible approach.

lsf commented on 2021-03-19 10:25 (UTC)

I've had quite a few issues building this, either in a clean chroot or regularly (either with haskell dependency resolution or during linking / building due to the whole dynamic / static build and dependency differences), so I've modified the PKGBUILD to use ghcup instead, as described at https://wiki.archlinux.org/index.php/Haskell#ghcup

I'm not saying this is the "better solution" – I know little of haskell, cabal and the whole ecosystem; it might just be an option for those having issues building it as well.

Here's a patch for the current PKGBUILD (1.25.1-2):

diff --git a/PKGBUILD b/PKGBUILD
index 3fd3238..47df75d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,12 +6,17 @@ pkgdesc='The core component that is used to participate in a Cardano decentralis
 license=('Apache')
 arch=('any')
 url='https://github.com/input-output-hk/cardano-node'
-_ghc_version="8.10.4"       # 8.10.3 fails to compile
+_ghc_version="8.10.2"       # current version used at https://docs.cardano.org/projects/cardano-node/en/latest/getting-started/install.html – might work with 8.10.4 as well
 # NOTE: The build process includes resolution, download and compilation of required libraries.
 # However, if you have corresponding haskell-* packages present in the system, the build
 # will most likely fail trying to use the installed lib.
 # This is probably configurable but I'm not experienced in Haskell. Suggestions are welcome.
-makedepends=('cabal-install-bin' 'ghc>=8.10.4')
+# NOTE: Since building for haskell is somewhat of a mess on Arch (static/dynamic builds and dependencies),
+# see https://wiki.archlinux.org/index.php/Haskell#Static_linking
+# and I could not get all issues with dependencies and linking fixed
+# in a clean chroot, I've switched to just using ghcup instead to get a completely
+# independent build environment
+makedepends=('git' 'ghcup-hs-bin')
 depends=('libsodium')
 _config_build="5367762"
 source=("https://github.com/input-output-hk/${pkgname}/archive/${pkgver}.zip"
@@ -41,13 +46,25 @@ sha256sums=("946da22e8fbbc587713c6006b70c2e02b3a26c8c173545afe6c15b8b78b25e08"
         "612025b4071734ab29e90f5cc71cff2868abe4f333d7f60c25d4b5c7f236f43c"
         "a5582d3b712330d0f37fc1488c06f4e2cb75176ffe382c74db9e6c75c3f95f9d")

-build() {
+prepare() {
   cd "${srcdir}/${pkgname}-${pkgver}"
+  # NOTE: this is used to avoid running out of space when
+  # /tmp is not large enough
+  mkdir -p ${srcdir}/ghcup_tmp
+  TMPDIR=${srcdir}/ghcup_tmp ghcup install ghc ${_ghc_version}
+  ghcup set ghc ${_ghc_version}
+  ghcup install cabal
+  export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH"
+  # NOTE: dependency resolution did not work for me (in a clean chroot)
+  # when update came after configure
+  cabal update
   cabal configure
   echo "package cardano-crypto-praos" >> ${srcdir}/${pkgname}-${pkgver}/cabal.project.local
   echo "  flags: -external-libsodium-vrf" >> ${srcdir}/${pkgname}-${pkgver}/cabal.project.local
-  cabal clean
-  cabal update
+}
+
+build() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
   cabal build all
 }