Skip to content

Commit

Permalink
fill config variables that differ in environments from env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
fnuecke-holoride committed Oct 6, 2023
1 parent a39e221 commit c31fcd7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bridge/cmd/bridge/config/config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Eth]
Chain = "Ethereum"
NetworkAddress = "https://sepolia.infura.io/v3/fb44167f83e740898c90737b6ec456d8" # a network address
MultisigContractAddress = "0xe40E20514A67fB2E00213C8567070f690a03De3D" # the eth address for the bridge contract
NetworkAddress = "$ETH_NETWORK_ADDRESS" # a network address
MultisigContractAddress = "$ETH_CONTRACT_ADDRESS" # the eth address for the bridge contract
SafeContractAddress = "0xC1056955eE4E81689Da6474F43284CfcF3a45317"
PrivateKeyFile = "./wallets/ethereum/account-0.sk" # the path to the file containing the relayer eth private key
GasLimitBase = 350000
Expand All @@ -22,8 +22,8 @@
GasPriceSelector = "SafeGasPrice" # selector used to provide the gas price

[MultiversX]
NetworkAddress = "https://devnet-gateway.multiversx.com" # the network address
MultisigContractAddress = "erd1qqqqqqqqqqqqqpgqqquj96vuwnnwj2xarsrtdvdmazg7r3zu0z9qwa6jdk" # the multiversx address for the bridge contract
NetworkAddress = "$MVX_NETWORK_ADDRESS" # the network address
MultisigContractAddress = "$MVX_CONTRACT_ADDRESS" # the multiversx address for the bridge contract
PrivateKeyFile = "./wallets/multiversx/account-0.pem" # the path to the pem file containing the relayer multiversx wallet
IntervalToResendTxsInSeconds = 60 # the time in seconds between nonce reads
MaxRetriesOnQuorumReached = 3
Expand Down Expand Up @@ -155,7 +155,7 @@

[BatchValidator]
Enabled = false
URL = "https://devnet-bridge-api.multiversx.com/validateBatch" # batch validator URL.
URL = "$MVX_VALIDATOR_ADDRESS" # batch validator URL.
RequestTimeInSeconds = 2 # maximum timeout (in seconds) for the batch validation request

[PeersRatingConfig]
Expand Down
49 changes: 49 additions & 0 deletions bridge/cmd/bridge/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,61 @@

echo "Writing keys to file system..."

if [ -z "$ETHER_KEY" ]
then
echo "\$ETHER_KEY is empty"
exit 1
fi
mkdir -p ./wallets/ethereum
echo "$ETHER_KEY" > ./wallets/ethereum/account-0.sk

if [ -z "$MULTIVERSEX_KEY" ]
then
echo "\$MULTIVERSEX_KEY is empty"
exit 1
fi
mkdir -p ./wallets/multiversx
echo "$MULTIVERSEX_KEY" > ./wallets/multiversx/account-0.pem


echo "Injecting configuration values..."

if [ -z "$ETH_NETWORK_ADDRESS" ]
then
echo "\$ETH_NETWORK_ADDRESS is empty"
exit 1
fi
sed -i -e "s/\$ETH_NETWORK_ADDRESS/$ETH_NETWORK_ADDRESS/g" ./config/config.toml

if [ -z "$ETH_CONTRACT_ADDRESS" ]
then
echo "\$ETH_CONTRACT_ADDRESS is empty"
exit 1
fi
sed -i -e "s/\$ETH_CONTRACT_ADDRESS/$ETH_CONTRACT_ADDRESS/g" ./config/config.toml

if [ -z "$MVX_NETWORK_ADDRESS" ]
then
echo "\$MVX_NETWORK_ADDRESS is empty"
exit 1
fi
sed -i -e "s/\$MVX_NETWORK_ADDRESS/$MVX_NETWORK_ADDRESS/g" ./config/config.toml

if [ -z "$MVX_CONTRACT_ADDRESS" ]
then
echo "\$MVX_CONTRACT_ADDRESS is empty"
exit 1
fi
sed -i -e "s/\$MVX_CONTRACT_ADDRESS/$MVX_CONTRACT_ADDRESS/g" ./config/config.toml

if [ -z "$MVX_VALIDATOR_ADDRESS" ]
then
echo "\$MVX_VALIDATOR_ADDRESS is empty"
exit 1
fi
sed -i -e "s/\$MVX_VALIDATOR_ADDRESS/$MVX_VALIDATOR_ADDRESS/g" ./config/config.toml


echo "Starting bridge..."

./bridge

0 comments on commit c31fcd7

Please sign in to comment.