Advertisement
Crypto2099

CardanoNodeUpgrade.sh

Aug 12th, 2020 (edited)
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.03 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. pkill cardano-node
  4.  
  5. # You may need to change this to ~/.local/bin depending upon your setup
  6. ex_path=~/.cabal/bin
  7.  
  8. version=$1
  9.  
  10. if [[ ! $version ]]; then
  11.   echo "You must provide a version number as an argument to the script... i.e. ./upgrade.sh 1.18.1"
  12.   exit
  13. else
  14.   echo "Upgrading cardano-node to tag $version..."
  15. fi
  16.  
  17. # You may need to change this if your cardano-node folder is not in your home directory
  18. cd ~/cardano-node
  19. git fetch --all
  20. git checkout tags/$version
  21.  
  22. mkdir -p ~/backup-bin
  23. cp $ex_path/* ~/backup-bin
  24. rm $ex_path/*
  25.  
  26. cabal clean
  27. cabal update
  28. cabal build all
  29.  
  30. cp dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-cli-$version/x/cardano-cli/build/cardano-cli/cardano-cli $ex_path
  31. cp dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-node-$version/x/cardano-node/build/cardano-node/cardano-node $ex_path
  32. cp dist-newstyle/build/x86_64-linux/ghc-8.6.5/cardano-node-$version/x/chairman/build/chairman/chairman $ex_path
  33.  
  34. echo -e "Build Complete\n"
  35.  
  36. cardano-node --version
  37. cardano-cli --version
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement