v2.4

Upgrading from v2.3 to v2.4 is fairly straightforward if you follow the instructions. Even though we try to ensure backward compatibility (BC) as much as possible, sometimes it is not possible or very complicated to avoid it and still create a good solution to a problem.

Upgrading a complex software project always comes at the risk of breaking something, so make sure you have a backup.

Notes

After upgrading you should check whether your application still works as expected and no plugins are broken. See the following notes on which changes to consider when upgrading from one version to another.

Upgrade Steps

Information

Be sure to complete all of the following steps before you continue to upgrade with the ark update command to the latest version.

Step 1. Add core-state Package

  1. Open ~/.config/ark-core/mainnet/plugins.js
  2. Locate the @arkecosystem/core-database-postgres entry.
  3. Add this package addition line before it (see below):
1"@arkecosystem/core-state": {}, // Add this line before it
  1. Save the changes. Your configuration file should look like this:
1module.exports = {
2 "@arkecosystem/core-event-emitter": {},
3 "@arkecosystem/core-logger-pino": {},
4 "@arkecosystem/core-state": {},
5 "@arkecosystem/core-database-postgres": {},
6 ...
7 ...
8 ...
9}

Step 2. Add core-wallet-api Package

Warning

It’s especially important to register this plugin as this is what the Desktop and Mobile wallet will use to communicate with nodes.

  1. Open ~/.config/ark-core/mainnet/plugins.js
  2. Locate the @arkecosystem/core-blockchain entry.
  3. Add this package addition line after it (see below):
1"@arkecosystem/core-wallet-api": {}, // Add this line after it
  1. Save the changes. Your configuration file should look like this:
1module.exports = {
2 ...
3 ...
4 "@arkecosystem/core-blockchain": {},
5 "@arkecosystem/core-wallet-api": {},
6 ...
7 ...
8}
  1. If you are using default firewall don’t forget to open port 4040 to make core-wallet-api accessible to wallets.
1sudo ufw allow 4040/tcp

You can check your ufw rules by running sudo ufw status

Step 3. Update core-p2p Configuration

  1. Open ~/.config/ark-core/mainnet/plugins.js

  2. Locate the @arkecosystem/core-p2p entry and replace the block like shown below.

    Old

1module.exports = {
2 ...
3 "@arkecosystem/core-p2p": {
4 host: process.env.CORE_P2P_HOST || "0.0.0.0",
5 port: process.env.CORE_P2P_PORT || 4001,
6 },
7 ...
8}

New

1module.exports = {
2 ...
3 "@arkecosystem/core-p2p": {
4 server: {
5 port: process.env.CORE_P2P_PORT || 4001,
6 },
7 },
8 ...
9}
  1. If you have a whitelist property in the core-p2p entry, make sure to remove this too. Starting with v2.4 this property will filter out any peers that don’t match the whitelist.
  2. Save the changes.

Step 4. Update core-forger Configuration

  1. Open ~/.config/ark-core/mainnet/plugins.js

  2. Locate the @arkecosystem/core-forger entry and replace the block like shown below.

    Old

1module.exports = {
2 ...
3 "@arkecosystem/core-forger": {
4 hosts: [`http://127.0.0.1:${process.env.CORE_P2P_PORT || 4001}`],
5 },
6 ...
7}

New

1module.exports = {
2 ...
3 "@arkecosystem/core-forger": {
4 hosts: [
5 {
6 hostname: "127.0.0.1",
7 port: process.env.CORE_P2P_PORT || 4001,
8 },
9 ],
10 },
11 ...
12}
  1. Save the changes.

Step 5. Update core-json-rpc to core-exchange-json-rpc

This only applies if you have the JSON-RPC registered in your plugins.js file, otherwise skip this section.

1sed -i 's/CORE_JSONRPC/CORE_EXCHANGE_JSON_RPC/g' ~/.config/ark-core/mainnet/.env
2sed -i 's/CORE_JSON_RPC/CORE_EXCHANGE_JSON_RPC/g' ~/.config/ark-core/mainnet/.env
3sed -i 's/CORE_JSONRPC/CORE_EXCHANGE_JSON_RPC/g' ~/.config/ark-core/mainnet/plugins.js
4sed -i 's/CORE_JSON_RPC/CORE_EXCHANGE_JSON_RPC/g' ~/.config/ark-core/mainnet/plugins.js
5sed -i 's/core-json-rpc/core-exchange-json-rpc/g' ~/.config/ark-core/mainnet/plugins.js

Step 6. Running the Update Command via the ark CLI

Do not run any of the mentioned commands with sudo unless explicitly stated.

Make sure that Step 1 , Step 2 , Step 3 , Step 4 and Step 5 were successfully completed before running the ark update command via the cli.

To update to v2.4 run the following command:

1ark update

Developer Related Information

This section addresses developers and lists notable changes during this version upgrade. For more details make sure you checkout the CHANGELOG document. The following breaking changes where introduced in v2.4:

1. Fee Statistics Removed from node/configuration Endpoint

The fee statistic are no longer included in the response of the node/configuration endpoint. They can be retrieved through a new dedicated endpoint instead, node/fees. More information on that endpoint can be found here .

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.

Last updated 3 years ago
Edit Page
Share: