Building Cardano Wallet from source for Cardano Node 8.1.1 Compatibility

Viper Science
Viper Staking
Published in
2 min readJul 2, 2023

--

After upgrading the Viper Stake Pool nodes to cardano-node version 8.1.1, we noticed that our cardano-wallet instance started reporting errors about connecting with the node. The inability of the wallet to sync from the node ultimately broke our automated system for distributing rewards amongst pool owners. The compatibility fixes are present in the master branch of the cardano-wallet repository (pull request), but are not yet available as part of an official release. In a hurry to fix our system, we decided to build the wallet from the latest source. The details of our “adventure” are outlined below.

Prior to building the cardano-wallet, the Haskell build tools are required. Note that our build environment is Ubuntu 20.04.6 LTS.

# Install the Haskell build tools
sudo apt update
sudo apt install build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

The new commits bump the cardano-wallet GHC version to 9.2.8.

The Haskell build tools installed by GHCUP

Before building cardano-wallet, the libsodium and Secp256k1 libraries are required on the system. The instructions to build from source are shown below.

mkdir libs && cd libs

git clone https://github.com/input-output-hk/libsodium
cd libsodium
git checkout dbb48cc
./autogen.sh
./configure
make
sudo make install

sudo apt install libsodium-dev

cd ../libs

git clone https://github.com/bitcoin-core/secp256k1
cd secp256k1
git checkout ac83be33
./autogen.sh
./configure --enable-module-schnorrsig --enable-experimental
make
sudo make install

cd .. && rm -r libs

Now you should be able to clone the source code and build.

git clone https://github.com/cardano-foundation/cardano-wallet.git
cd cardano-wallet
cabal build cardano-wallet:exe:cardano-wallet -frelease

The build produced errors but after some investigation it was discovered that the errors were due to deprecation warnings, which can be disabled with compiler flags.

cabal build cardano-wallet:exe:cardano-wallet -frelease--ghc-options=-Wwarn

In general it is a good idea to build with warnings as errors and I’m sure the team will fix the deprecation warnings before cutting an actual release. This is just normal difficulties when building a development branch.

The newly built cardano-wallet executable is located in

dist-newstyle/build/x86_64-linux/ghc-9.2.8/cardano-wallet-2023.4.14/x/cardano-wallet/build/cardano-wallet

References

The cardano-wallet build instructions are helpful but at the time of writing were out of date.

--

--

Viper Science
Viper Staking

Viper Science develops open source cryptocurrency tools and services. The team also operates high performance ADA stake pools on the Cardano blockchain.