Environment Variable Configuration
Understanding the required environment variables
The Forte Rules Engine repository includes a tracked .env
file that is used for many of the scripts available to you. You’ll need to add sensitive values to this file for the scripts to run.
Ensure you do not commit an edited .env
to your own copy of the repository.
Consider removing the .env
file from tracking and adding to .gitignore
to avoid accidentally commiting sensitive values to version control.
Seting up the Environment File
There are several variables you must set to use the scripts that help depoloy your App Manager, App Handler, Token Handlers, and more. See below to understand these variables and how to know what they should be.
RULE_PROCESSOR_DIAMOND
This is the deployed address of the main rules engine diamond. You can determine this value by picking the address listed on the supported chains page for the network your application is on.
If you’re developing locally and using a forked chain in anvil, then you’ll specify the address of the protocol on the chain you forked. For example, if you started anvil with a fork from Polygon Amoy like so:
Then you would set RULE_PROCESSOR_DIAMOND
as 0xe96ab6faa3a186b667136f8974d767a6f060fa1b
, which is indicated in the supported chains table for the Amoy network.
ETH_RPC_URL
You’ll need to provide an RPC that corresponds to the correct network. If you’re developing on a local network, this will probably be http://localhost:8545
.
CHAIN_ID
This must match the chain of the network your RPC URL is pointing at. It’s used in scripts that parse deployment directories to determine the contract address depoyed by the scripts.
GAS_NUMBER
Set the gas price needed for the desired environment. (20
is a good number to use generally)
DEPLOYMENT_OWNER
and DEPLOYMENT_OWNER_KEY
These variables indicate the public and private key of the wallet address that will deploy any contracts when running various scripts.
As you know, the private key is a sensitive value and must be treated with care. This address will be designated as the SUPER ADMIN
of your App Manager contract. You can propose a new Super admin and transfer ownership if you wish.
APP_ADMIN
and APP_ADMIN_PRIVATE_KEY
Making Env Variables Available
Before you run any scripts you should ensure the variables are available in your active terminal. You can easily do this with the command below: