Package Details: cardano-node 1.26.2-3

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: emes
Last Packager: emes
Votes: 1
Popularity: 0.40
First Submitted: 2021-01-20 01:41
Last Updated: 2021-05-04 21:13

Latest Comments

1 2 Next › Last »

lsf commented on 2021-04-19 10:51

Just a quick note for anyone that still struggles with the haskell dependencies: I've put an updated PKGBUILD for 1.26.2 using ghcup up at https://gitlab.com/-/snippets/2101643 (and made it publicly visible this time around..) incorporating the recent changes from @emes as well :)

andrej commented on 2021-04-14 21:22

@emes The unit file needs an EnvironmentFile option.

...
[Service]
EnvironmentFile=-/etc/conf.d/cardano-node
ExecStart=/usr/bin/cardano-node $SOME_VAR $SOME_OTHER_VAR
...

emes commented on 2021-04-14 21:11

@andrej How to make the variables from /etc/conf.d/cardano-node visible in the service file? Just dropping the file in conf.d didn't seem to be enough.

andrej commented on 2021-04-11 22:42

Another side note: The build still doesn’t work for me and the patch introduced by @lsf works fine. (Yes, it downloads lots of stuff that may be already installed as packages, but it seems to be hermetic and reproducible.) The package-based Haskell libraries seem broken in some way. The huge lot of missing files and packages reported during the build suggest that there may be important bits (registries of some sort or actual files) missing in the Haskell setup on Arch. I don’t use Haskell, so I have no clue.

I first wiped out all the haskell-.* stuff I had installed before, just to make sure the build doesn’t depend on it in mysterious ways:

declare -i i=1
while ((i > 0)); do
  i=0
  for package in $(yay -Q | awk '/^haskell-/ {print $1}'); do
    yay -R "$package" --noconfirm && ((++i)) || :
  done
done

Then I used the patch by @lsf (adjusted for the current version):

diff --git a/PKGBUILD b/PKGBUILD
index 8cea7fd..e946591 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,10 +11,10 @@ _ghc_version="8.10.4"       # 8.10.3 fails to compile
 # 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=('git' 'cabal-install-bin' 'ghc>=8.10.4')
+makedepends=('git' 'ghcup-hs-bin')
 depends=('libsodium')
 _config_build="5367762"
-backup=("var/lib/cardano-node/config/{main,test}net-{config,topology}.json")
+backup=(var/lib/cardano-node/config/{main,test}net-{config,topology}.json)
 source=("https://github.com/input-output-hk/${pkgname}/archive/${pkgver}.zip"
         "https://hydra.iohk.io/build/${_config_build}/download/1/mainnet-config.json"
         "https://hydra.iohk.io/build/${_config_build}/download/1/mainnet-byron-genesis.json"
@@ -44,6 +44,12 @@ sha256sums=("e725f425cb7b7e581208a9b7b6989049fbaba8634475889910d92a09a14cac13"

 prepare() {
   cd "${srcdir}/${pkgname}-${pkgver}"
+  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"
+  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

That^^^ builds without issues.

andrej commented on 2021-04-11 16:40

BTW, the backup array in the PKGBUILD is currenty wrong; it must be either explicitly expanded or without double-quotes.

What you have:

backup=("var/lib/cardano-node/config/{main,test}net-{config,topology}.json")
for i in "${!backup[@]}"; do echo "backup[${i}] = ${backup[i]}"; done

What you want:

backup=(var/lib/cardano-node/config/{main,test}net-{config,topology}.json)
for i in "${!backup[@]}"; do echo "backup[${i}] = ${backup[i]}"; done

Other ways to set that^^^:

backup=('var/lib/cardano-node/config/'{main,test}'net-'{config,topology}'.json')
backup=('var/lib/cardano-node/config/mainnet-config.json'
        'var/lib/cardano-node/config/mainnet-topology.json'
        'var/lib/cardano-node/config/testnet-config.json'
        'var/lib/cardano-node/config/testnet-topology.json')

andrej commented on 2021-04-09 00:08

Yet another bit of input: It would be great to have /etc/conf.d/cardano-node (or the like) for easy command line customization without systemd drop-in files (which insist on overriding the entire command line). (This bug is an equivalent idea for openethereum, pointing at an example.)

The advantage of environment files over drop-in files is “update transparency”:

  • With drop-in files, upstream command-line updates in /usr/lib/systemd/system won’t propagate back into a drop-in file (which must override the entire command line) and there will be no obvious warning about such changes.
  • With environment variables from /etc/conf.d/..., the environment file can be in the backup=(...) array and there will be a clear indication that something has changed (a .pacnew file) each time the default file gets updated.

emes commented on 2021-04-07 11:26

Thanks for your input, people. In the latest release I dropped the testnet dirs and included the relevant service file as an example.

As for the Haskell environment, I'm not familiar with that and could only blindly check what works and what doesn't. If someone more experienced is willing to clean that up and maintain the package, I'm willing to hand it over.

lsf commented on 2021-04-07 10:37

@emes a bit late to the party.

basically I had two different kinds of error (especially when building in a clean chroot): => cabal update had to be placed earlier, otherwise it could not resolve the dependencies. => with that done, there were either some (system haskell) dependencies missing and/or even if they were there, they weren't accepted / valid. installing everything that might've helped didn't work either.

The latter issue was why I had then just switched to just using ghcup (as neither ghc-pristine nor cabal-static seemed to get me something working either).

Unfortunately I don't have the exact errors anymore.

If anyone needs it, here's a PKGBUILD for 1.26.1 using ghcup: https://gitlab.com/-/snippets/2101643

andrej commented on 2021-04-07 01:36

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

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.