Skip to content

Instantly share code, notes, and snippets.

@ssledz
Last active March 6, 2023 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssledz/976d4221c3fc16df1d60e128a620de7b to your computer and use it in GitHub Desktop.
Save ssledz/976d4221c3fc16df1d60e128a620de7b to your computer and use it in GitHub Desktop.
cardano-transaction-lib how to

Resources

Build a lib

nix version

nix --version
nix (Nix) 2.14.1

nix config

cat ~/.config/nix/nix.conf
experimental-features = nix-command flakes
substituters        = https://cache.iog.io https://cache.nixos.org/ https://public-plutonomicon.cachix.org
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= public-plutonomicon.cachix.org-1:3AKJMhCLn32gri1drGuaZmFrmnue+KkKrhhubQk/CWc=
git clone https://github.com/Plutonomicon/cardano-transaction-lib.git
cd cardano-transaction-lib
git checkout -b v4-demo origin/v4-demo
nix build
error: flake 'git+file:///home/ssledz/git/cardano-transaction-lib' does not provide attribute 'packages.x86_64-linux.default' or 'defaultPackage.x86_64-linux'

Findings

  • In order to set up a new project a new version of nix is required (nix-2.14.1 is working, nix-2.4 is not working)

Start a brand new project from scratch

prerequisites

curl -L https://nixos.org/nix/install | sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install v18.14.2
nvm install-latest-npm
 npm install -g spago
npm install -g purescript@0.14.5
  • set up a new project from template
mkdir ctl-demo-project
cd ctl-demo-project
nix flake init -t github:Plutonomicon/cardano-transaction-lib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment