Perseverance
Upgrade 092 to 093

Upgrading 0.9.2 -> 0.9.3

0.9.2 includes the ability to specify a backup RPC node for each supported blockchain. As a result there have been some configuration file changes.

If you only use the configuration file, and not environment or command line arguments, then you can skip this section if your upgrade to 0.9.3 was successful, as the migration of the configuration file should be done automatically.

If you use environment variables or command line arguments, or there was some problem when migrating the configuration file automatically, then you will need to migrate your settings manually.

Here's how to migrate each type of settings:

Config file

Your Settings.toml file in 0.9.2 (for just the RPCs) configs would look something like this:

#... other settings
 
[eth]
# Ethereum private key file path. This file should contain a hex-encoded private key.
private_key_file = "/etc/chainflip/keys/ethereum_key_file"
ws_node_endpoint = "WSS_ENDPOINT_OF_ETHEREUM_RPC"
http_node_endpoint = "HTTPS_ENDPOINT_OF_ETHEREUM_RPC"
 
[dot]
ws_node_endpoint = "wss://rpc-pdot.chainflip.io:443"
http_node_endpoint = "https://rpc-pdot.chainflip.io:443"
 
[btc]
http_node_endpoint = "http://a108a82b574a640359e360cf66afd45d-424380952.eu-central-1.elb.amazonaws.com"
rpc_user = "flip"
rpc_password = "flip"
 
#... other settings...

For 0.9.3, you want to change the configuration file so it looks something like this:

#... other settings...
 
[eth]
# Ethereum private key file path. This file should contain a hex-encoded private key.
private_key_file = "/etc/chainflip/keys/ethereum_key_file"
 
[eth.rpc]
ws_endpoint = "WSS_ENDPOINT_OF_ETHEREUM_RPC"
http_endpoint = "HTTPS_ENDPOINT_OF_ETHEREUM_RPC"
 
# [eth.backup_rpc]
# ws_endpoint = "SECOND_WSS_ENDPOINT_OF_ETHEREUM_RPC"
# http_endpoint = "SECOND_HTTPS_ENDPOINT_OF_ETHEREUM_RPC"
 
[dot.rpc]
ws_endpoint = "wss://rpc-pdot.chainflip.io:443"
http_endpoint = "https://rpc-pdot.chainflip.io:443"
 
[btc.rpc]
http_endpoint = "http://a108a82b574a640359e360cf66afd45d-424380952.eu-central-1.elb.amazonaws.com"
basic_auth_user = "flip"
basic_auth_password = "flip"
 
# [btc.backup_rpc]
# http_endpoint = "http://second-node-424380952.eu-central-1.elb.amazonaws.com"
# basic_auth_user = "flip2"
# basic_auth_password = "flip2"
 
#... other settings...

Note the following changes:

  • eth -> eth.rpc (same for dot and btc) for the rpc endpoint configuration.
  • rpc_user and rpc_password for btc are now basic_auth_user and basic_auth_password respectively
  • The backup_rpc sections are commented out. You can uncomment them and add the backup nodes if you wish
  • ws_node_endpoint -> ws_endpoint and http_node_endpoint -> http_endpoint

Initially, we recommend not using the backup_nodes, just to ensure the migration is successful. Once you're running smoothly then we recommend adding a backup node.

For perseverance we use a Chainflip run private Polkadot network. Thus, adding a backup_node for Polkadot is not necessary.

Advanced setups

If all of your configuration is in the configuration file, there's no need to continue, you're done :)

Environment variables

The names of the environment variables have changed:

Note the __ (double underscore) in the variable names. This is necessary.

# ETH
ETH__HTTP_NODE_ENDPOINT -> ETH__RPC__HTTP_ENDPOINT
ETH__WS_NODE_ENDPOINT -> ETH__RPC__WS_ENDPOINT

# DOT
DOT__WS_NODE_ENDPOINT -> DOT__RPC__WS_ENDPOINT
DOT__HTTP_NODE_ENDPOINT -> DOT__RPC__HTTP_ENDPOINT

# BTC
BTC__HTTP_NODE_ENDPOINT -> BTC__RPC__HTTP_ENDPOINT
BTC__RPC_USER -> BTC__RPC__BASIC_AUTH_USER
BTC__RPC_PASSWORD -> BTC__RPC__BASIC_AUTH_PASSWORD

The environment variables for the backup nodes are:

# ETH
ETH__BACKUP_RPC__HTTP_ENDPOINT
ETH__BACKUP_RPC__WS_ENDPOINT
# DOT
DOT__BACKUP_RPC__WS_ENDPOINT
DOT__BACKUP_RPC__HTTP_ENDPOINT
# BTC
BTC__BACKUP_RPC__HTTP_ENDPOINT
BTC__BACKUP_RPC__BASIC_AUTH_USER
BTC__BACKUP_RPC__BASIC_AUTH_PASSWORD

Command line arguments

The command line arguments have changed like so:

# ETH
--eth.http_node_endpoint -> --eth.rpc.http_endpoint
--eth.ws_node_endpoint -> --eth.rpc.ws_endpoint
# DOT
--dot.ws_node_endpoint -> --dot.rpc.ws_endpoint
--dot.http_node_endpoint -> --dot.rpc.http_endpoint
# BTC
--btc.http_node_endpoint -> --btc.rpc.http_endpoint
--btc.rpc_user -> --btc.rpc.basic_auth_user
--btc.rpc_password -> --btc.rpc.basic_auth_password

If you would like to specify the backups via command line arguments, you can use these:

# ETH
--eth.backup_rpc.http_endpoint <ETH_BACKUP_HTTP_ENDPOINT>
--eth.backup_rpc.ws_endpoint <ETH_BACKUP_WS_ENDPOINT>
# DOT
--dot.backup_rpc.http_endpoint <DOT_BACKUP_HTTP_ENDPOINT>
--dot.backup_rpc.ws_endpoint <DOT_BACKUP_WS_ENDPOINT>
# BTC
--btc.backup_rpc.http_endpoint <BTC_BACKUP_HTTP_ENDPOINT>
--btc.backup_rpc.basic_auth_user <BTC_BACKUP_RPC_USER>
--btc.backup_rpc.basic_auth_password <BTC_BACKUP_RPC_PASSWORD>

You can use chainflip-engine --help to see all the available command line options.

;