Configure the Bridge Client

Attention

The XRPL EVM compatible sidechain implementation is a proof of concept extension to the XRP Ledger protocol and is for development purposes only. There is no official amendment currently and it is not available on the production Mainnet. The EVM compatible sidechain bridge is connected to the XRP Ledger Devnet. Do not send transactions in Mainnet.

The client requires separate configuration files for the backend frontend. Each environment setting also requires its own configuration files.

Backend Configuration

The client backend is configured in src/config. The folder holds multiple files that configure properties related to the:

  • Server
  • Logger
  • Database (TypeORM)
  • EVM
  • XRPL
  • XUMM

These configuration files use the buildConfig() function, taking an object with the configuration properties and a second optional parameter to perform validations. Configuration properties can have a static value or an object specifying values for each environment. The following environments are available:

  • default
  • production
  • development
  • test
  • staging

Configuration values can be constants, environment variables or AWS Secrets. Environment variables are defined in a .env file in the root of the backend. AWS Secrets add an extra layer of customisation and security. To load AWS secrets, the AWS_REGION and AWS_SECRET_ID environment variables must be defined.

Warning: Never use constants for sensitive data, such as keys or secrets in production environments.

Server Options

KeyDescriptionEVN KeyAWS SecretExample
portServer port to receive requests.APP_PORT3000
secretKeySecret key used to generate JWT tokens.APP_JWT_KEY"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
enableSwaggerEnable Swagger.true
enableCorEnable CORS.true

Logger Options

KeyDescriptionEVN KeyAWS SecretExample
logLevelLog level used by the server logger."info"
logFileNameFile name to store logs."app.log"

Database (TypeORM) Options

KeyDescriptionEVN KeyAWS SecretExample
hostDatabase host.DB_HOSTDB_HOST"db"
portDatabase port.DB_PORTDB_PORT5432
usernameDatabase username.DB_USERDB_USER"db_user"
passwordDatabase password.DB_PASSWORDDB_PASSWORD"db_password"
databaseDatabase name.DB_DATABASEDB_DATABASE"db_database"

Note: This configuration also extends Nest TypeORM properties.

EVM Option

KeyDescriptionEVN KeyAWS SecretExample
serverEVM chain RPC."https://rpc-evm-sidechain.xrpl.org"

XRPL Option

KeyDescriptionEVN KeyAWS SecretExample
serverXRPL chain WebSocket."wss://sidechain-net1.devnet.rippletest.net"

XUMM Options

KeyDescriptionEVN KeyAWS SecretExample
appKeyXUMM app key.XUMM_API_KEYXUMM_API_KEY"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
appSecretXUMM app secret.XUMM_SECRET_KEYXUMM_SECRET_KEY"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"

Frontend Configuration

The frontend configuration doesn't contain sensitive data and can be modified at src/common/config. There's one JSON file for each environment:

FileDescription
config.base.jsonCommon configuration used in all environments.
config.prod.jsonConfiguration used in the production environment.
config.dev.jsonConfiguration used in the development environment.
config.test.jsonConfiguration used in the test environment.
config.staging.jsonConfiguration used in the staging environment.

Configuration Options

KeyDescriptionExample
projectNameThe name of the project."bridge-client"
publicUrlReact Router's BrowserRouter basename."/"
backendUrlBridge client backend URL.""
nativeTokenThe symbol of the blockchain's native token."XRP"
networkThe network of the chains in the bridge."Devnet"
xrpNodeUrlXRPL node WebSocket URL."wss://sidechain-net1.devnet.rippletest.net"
evmWsNodeUrlEVM node WebSocket URL."wss://ws-evm-poa-sidechain.peersyst.tech"
evmRpcUrlEVM node RPC URL."https://rpc-evm-sidechain.xrpl.org/"
xrpExplorerUrlXRPL explorer URL."https://custom.xrpl.org/sidechain-net1.devnet.rippletest.net/"
evmExplorerUrlEVM explorer URL."https://evm-sidechain.xrpl.org/"
xrpFaucetHostXRPL faucet host."sidechain-faucet.devnet.rippletest.net"
xrpChainNameXRP chain name."XRPL"
evmChainNameEVM chain name."EVM Sidechain"
evmChainEVM chain ID.1440002
evmDecimalsEVM chain decimals.18
pctCommissionPCT commission.0
minCommissionMinimum commission.1
maxCommissionMaximum commission.1
xummThe XUMM configuration options.
enableXummEnable a XUMM. Uses an auto-generated XRP faucet wallet if false.false
maxNumberDecimalsMaximum number of decimals to display in the UI.6
txValidationPollingPolling Options for awaiting transaction validations.
attestationsValidationPollingPolling Options for awaiting attestations.
transactionsRefetchIntervalThe interval to refetch transaction history in ms.10000
balanceRefetchIntervalThe interval to refetch balances in ms.5000
peersystUrlThe Peersyst web page URL."https://peersyst.com/"

Frontend XUMM Options

KeyDescriptionExample
statusIntervalThe interval to poll the client's backend for XUMM request updates in ms.3000
maxNumberOfRetriesThe maximum number of attempts to poll the client's backend for XUMM request updates.40

Polling Options

KeyDescriptionExample
delayPolling delay in ms.3000
maxIterationsThe maximum number of polling iterations.10
timeoutThe timeout of the request being polled in ms.1000