Skip to main content

Setting Environment Variables

In this section, we will cover how to setup environment variables for the Liquidity Provider Server (LPS), AWS, and other variables configurations.

LPS Environment Variables

These are the environment variables required by the liquidity provider server (LPS). The following table lists the environment variables and their descriptions and whether it's mandatory or not.

NameDescriptionExampleMandatory
LPS_STAGEThe network where LPS will be running on.One of the following: regtest, testnet, mainnetYES
PORTThe port number to run the http server of the LPS.8080YES
LOG_LEVELLevel for the application logs.One of the following: panic, fatal, error, warn, info, debug, traceYES
LOG_FILEFile to send the logs to. If not provided logs will be sent to standard output/home/lps.logNO
ENABLE_MANAGEMENT_APIWhether to enable the management API endpoints or not. To know more read the LP Management Documentation file. If not provided, the default value will be false.true or falseNO
AWS_LOCAL_ENDPOINTEndpoint for the AWS local instance (localstack). Only required if LPS is running in regtest mode.http://localhost:4444NO
WALLETType of the wallet management implementation. To know more read the wallet management section of the LP Management file.One of the following: nativeYES
SECRET_SRCSource of the secrets required for the wallet management. To know more read the secrets management section of the LP Management file.One of the following: aws envYES
MONGODB_USERUser to connect to MongoDB.rootYES
MONGODB_PASSWORDPassword to connect to MongoDB.<any password>YES
MONGODB_HOSTHost to connect to MongoDB.localhostYES
MONGODB_PORTPort to connect to MongoDB.27017YES
RSK_ENDPOINTURL to connect to the Rootstock node. Must be an http endpoint.http://rskj:4444YES
CHAIN_IDRSK chain id.33YES
LBC_ADDRAddress of the Liquidity Bridge Contract (LBC).0x8901a2Bbf639bFD21A97004BA4D7aE2BD00B8DA8YES
RSK_BRIDGE_ADDRAddress of the Rootstock bridge.0x0000000000000000000000000000000001000006YES
RSK_REQUIRED_BRIDGE_CONFIRMATIONSThe number of confirmations that need to pass before being able to register a pegin, it changes depending on the network.100YES
IRIS_ACTIVATION_HEIGHTBlock number where the iris update is activated, depends on the network.1500000YES
ERP_KEYSKeys that are used as a secondary multisig that would be allowed to spend UTXOs after a year they were created.0216c23b2ea8e4f11c3f9e22711addb1d16a93964796913830856b568cc3ea21d3,0275562901dd8faae20de0a4166362a4f82188db77dbed4ca887422ea1ec185f14,034db69f2112f4fb1bb6141bf6e2bd6631f0484d0bd95b16767902c9fe219d4a6fYES
ACCOUNT_NUMThe keystore account number to use. If not provided default value will be 0.0NO
DAO_FEE_COLLECTOR_ADDRESSAddress of the DAO fee collector.0x86B6534687A176A476C16083a373fB9Fe4FAb449YES
KEY_SECRETName of the secret of AWS secrets manager that contains the encrypted json of the liquidity provider RSK account. Only required if SECRET_SRC is aws.FlyoverTestEnv/LPS-KEYNO
PASSWORD_SECRETName of the secret of AWS secrets manager that contains the password of the encrypted json of the liquidity provider RSK account. Only required if SECRET_SRC is aws.FlyoverTestEnv/LPS-PASSWORDNO
KEYSTORE_FILEName of the file that contains the encrypted json of the liquidity provider RSK account. Only required if SECRET_SRC is aws.geth_keystore/UTC--2024-01-29T16-36-09.688642000Z--9d93929a9099be4355fc2389fbf253982f9df47cNO
KEYSTORE_PWDThe password of the encrypted json of the liquidity provider RSK account. Only required if SECRET_SRC is aws.<any password>NO
BTC_NETWORKNetwork to use when connecting to the Bitcoin node.One of the following: regtest, testnet, mainnetNO
BTC_USERNAMEUsername for the bitcoind rpc server.userYES
BTC_PASSWORDPassword for the bitcoind rpc server.passwordYES
BTC_ENDPOINTEndpoint of the bitcoind rpc server.localhost:5555YES
ALERT_SENDER_EMAILThe email that will be used to send alerts.no-reply@mail.flyover.rifcomputing.netYES
ALERT_RECIPIENT_EMAILThe email that will receive the alerts.test@iovlabs.orgYES
PROVIDER_NAMEThe liquidity provider name to be registered in the liquidity bridge contract.Default providerYES
BASE_URLURL of the LPS to register in the liquidity bridge contract.http://localhost:8080YES
PROVIDER_TYPEWhether the liquidity provider will provide for pegin, pegout or both operations.One of the following: pegin, pegout, bothYES
PEGOUT_DEPOSIT_CACHE_START_BLOCKIf provided, the LPS will upsert into the database all the pegout deposits that were done from this block to the current one.500NO
CAPTCHA_SECRET_KEYCaptcha key used in the server to validate client requests.<a captcha secret>NO
CAPTCHA_SITE_KEYCaptcha key used by the client to perform the challenge.<a captcha site key>NO
CAPTCHA_THRESHOLDThreshold from zero to one to consider requests as valid when using recaptcha v3 (right now we're using v2).0.8NO
DISABLE_CAPTCHAWhether to disable captcha validation or not. It's a boolean value.trueNO
CAPTCHA_URLURL to make the captcha verification.https://www.google.com/recaptcha/api/siteverifyNO
MANAGEMENT_AUTH_KEYAuthentication key for the Management API session. Is mandatory if the Management API is enabled. Must be a 32 bytes hex string.a2fbac02d66202e8468d2a4f1deba4fa5c2491f592e0e22e32fe1e6acac25923NO
MANAGEMENT_ENCRYPTION_KEYEncryption key for the Management API session. Is mandatory if the Management API is enabled. Must be a 32 bytes hex string.9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08NO
MANAGEMENT_TOKEN_AUTH_KEYAuthentication key for the CSRF cookies. Is mandatory if the Management API is enabled. Must be a 32 bytes hex string.c5ff177a86e82441f93e3772da700d5f6838157fa1bfdc0bb689d7f7e55e7abaNO
MANAGEMENT_USE_HTTPSWhether the session cookies generated by the Management API should use HTTPS or notfalseNO

AWS variables

You may notice that in sample-config.env there are some environment variables that are related to AWS. These variables are required to use AWS services, however, they are not listed in the table as the AWS SDK has the functionality to load them from multiple sources. For that reason, they are not accessed directly from the code and are not listed in the table above.

Other variables

You may notice that in sample-config.env there are variables that aren't in the table and don't belong to AWS. Those variables are used to run scripts or to set up the local environment, they should not be present in a productive environment for this application.

Last updated on by Owanate Amachree