Secretpath in itself is a trustless protocol, meaning that everyone can deploy a public gateway on their own chain. Here's how to do it:
Before you begin, make sure you have the following installed on your system:
- Git: Version control system for cloning repositories.
- Foundry: A blazing fast, portable, and modular toolkit for Ethereum application development.
- Anaconda: For creating a virtual environment (Python 3.11).
- Python 3.11 & : Required for running the relayer scripts. Python package installer.
- Access to the Sepolia Testnet: You'll need to interact with the edeXa Testnet.
-
Clone the SecretPath Repository
git clone -b Solana https://github.com/SecretSaturn/SecretPath.git
-
Navigate to the Public Gateway Directory
cd SecretPath/TNLS-Gateways/public-gateway
-
Initialize Submodules
git submodule update --init --recursive
You'll deploy the gateway contract using Foundry's forge
tool.
Replace <YOUR_PRIVATE_KEY>
with your actual private key. Keep your private key secure and do not share it.
forge script script/DeployGatewayScript.s.sol:DeployGatewayScript \
--rpc-url "https://rpc.sepolia.org" \
--broadcast \
--retries 10 \
-vvv \
--optimize \
--optimizer-runs 10000000 \
--legacy \
--private-key <YOUR_PRIVATE_KEY> \
--evm-version paris
If you encounter the following error:
Error:
Failed to send transaction
Context:
- server returned an error response: error code -32009: Gas price below configured minimum gas price
You need to adjust the gas price.
a. Estimate the Correct Gas Price
Visit the Ethereum Sepolia Testnet explorer to check recent gas prices:
https://sepolia.etherscan.io
b. Add the Gas Price Flag
Re-run the forge script with the --with-gas-price
flag:
forge script script/DeployGatewayScript.s.sol:DeployGatewayScript \
--rpc-url "https://rpc.sepolia.org" \
--broadcast \
--retries 10 \
-vvv \
--optimize \
--optimizer-runs 10000000 \
--legacy \
--private-key <YOUR_PRIVATE_KEY> \
--evm-version paris \
--with-gas-price 2gwei
Upon successful deployment, you will see two contract addresses:
- Implementation Address: The first address, representing the implementation contract.
- Gateway Address: The second address, which is the Transparent Upgradeable Proxy contract.
Note: The Gateway Admin is your wallet address (you are the owner of the contracts). The Proxy Admin is specified in the logs of the Gateway Address contract deployment. The Proxy Admin contract is exclusively used for upgrading contracts, and the Gateway Admin is the owner of this Proxy Admin contract.
cd ../../TNLS-RELAYERS
nano config.yml
Replace <YOUR_GATEWAY_ADDRESS>
with the Gateway Address obtained from the deployment step.
"11155111": #Ethereum Sepolia
active: false
type: "evm"
chain_id: "11155111"
api_endpoint: https://eth-sepolia-public.unifra.io
contract_address: "0x3879E146140b627a5C858a08e507B171D9E43139"
timeout: 1
Create a .env
file or set the following environment variables. Replace the placeholders with your actual private keys. Keep your private keys secure and do not share them.
ethereum-private-key = <YOUR_ETHEREUM_PRIVATE_KEY>
solana-private-key = <YOUR_SOLANA_PRIVATE_KEY>
secret-private-key = <YOUR_SECRET_PRIVATE_KEY>
Download and install Anaconda for your operating system:
conda create --name secretpath_env python=3.11
conda activate secretpath_env
Navigate to the relayer directory if you're not already there:
cd TNLS-RELAYERS
Install the required Python packages, make sure to not install depencencies as this may lead to dependency hell.
pip install -r requirements.txt --no-dependencies
python3 web_app.py
If you encounter an error related to lru-dict
, update it using:
pip install --upgrade lru-dict