v4.0 Upgrade Guide - Devnet
Warning
This is a preliminary upgrade guide that is aimed at the development network. Please do not run this on mainnet yet.
Prerequisites
Before starting the upgrade, make sure that you are on node version 16 or higher. You can check your current version by running the following command:
1node --version
If this indicates that you are below version 16.x, you will have to upgrade node first by running the following:
1sudo sed -i 's/node_.*.x/node_16.x/' /etc/apt/sources.list.d/nodesource.list \2&& sudo apt-get update && sudo apt-get install nodejs -y
This will get you on node version 16. You can check it afterwards by running node --version
again to verify the upgrade was successful.
Migrating to pnpm
With core 4.x, we are moving away from yarn
to pnpm
. pnpm is an alternative package manager, which is better suited for the monorepo structure core is making use of. As core is currently installed by yarn
, the easiest way to switch is to uninstall that core version and reinstall it through pnpm
. The below commands will do this for you. Note that this does not affect your database and you will be good to go after core has been installed through pnpm
.
1pm2 kill \ 2&& rm -f ~/.pm2/dump* \ 3&& yarn global remove @arkecosystem/core \ 4&& yarn cache clean > /dev/null 2>&1 \ 5&& sudo npm install -g npm \ 6&& sudo npm uninstall -g pm2 \ 7&& sudo apt remove yarn -y \ 8&& sed -i '/yarn global/d' ~/.bashrc \ 9&& npm config set prefix '~/.pnpm' \10&& npm config set global-bin-dir ~/.pnpm/bin \11&& export PATH=$(npm config get global-bin-dir):$PATH \12&& echo 'export PATH=$(npm config get global-bin-dir):$PATH' >> ~/.bashrc \13&& npm install -g pnpm \14&& pnpm install -g pm2 \15&& pnpm install -g @arkecosystem/core@next
After the above commands are finished, you can start core as usual by running ark relay:start
and ark forger:start
, or by running ark core:start
for the combined process.
Reporting Problems
If you happen to experience any issues, please open an issue with a detailed description of the problem, steps to reproduce it, and info about your environment.