Skip to content

SUI Setup

Palden Sherpa edited this page Aug 21, 2024 · 7 revisions

Given that all the contracts are deployed, follow the instructions below in sequence:

  1. Add the configuration file.
  2. Import the keystore or create a new one.
  3. Finally, start the relayer.

Chain Configuration

A sample config file for SUI can be found here. Some important points to consider in the configuration are as follows:

  1. In the xcall-package-ids field, if the xcall package has been upgraded, you will also need to include the old package ID in this list. The order of package IDs should be in descending order, from the latest to the oldest.
  2. Dapp configuration is needed only for the relayer that functions as an executor. For the relayer that is not intended to act as an executor, the configuration for dapps is not required.
  3. The start-tx-digest is the digest from which the relayer starts querying for events. If you need to start the relayer from a specific tx-digest, this field is useful. However, if you want the relayer to start querying events from the last saved tx-digest in the database, this field must be left empty.
  4. The address field represents the relayer's wallet address. This address needs to be set as an admin in the connection module of the SUI xcall package.

The configuration for SUI can either be added manually by editing the config file directly or by using the following command:

  • centralized-relay chains add --file <path_to_config_file.json> <chain_name>

Keystore Setup

Keystore setup can be done in two ways: import from the existing private key or create a new one.

Import keystore from existing private key.

This can be done using the following command:

  • centralized-relay keystore import --chain <nid> --keystore <path_to_sui_private_key_file> --password <password>. The private key file should contain the base64 encoded private key enclosed in square brackets as [<base64-private-key>]. Password is not required in the SUI keystore but must still be provided in the command because the flag is required. In the production setup, it is recommended to delete the private key file from the machine after the import is successful.

Create a new keystore.

A new keystore can be created using the following command:

  • centralized-relay keystore new --chain <nid> --password <password>. This command creates a new SUI keypair; encrypts the private key using KMS and stores it in the keystore directory of the relayer. And returns the address of the new SUI keystore created in the relayer. Password is not required in the SUI keystore but must still be provided in the command because the flag is required. The address field in the relayer config file should be updated with this returned address. Also, this newly created address needs to be set as an admin in the connection module of the SUI xcall package.
Clone this wiki locally