Connector
Requirements
Prepare environment
- Generate contract bindings (to be done once or if contract change)
# assuming the mediterraneus-smart-contracts folder is located in the same root folder of mediterraneus-connector-rs
cd abigen
cargo run -- --contract ServiceBase --abi-source "../../mediterraneus-smart-contracts/artifacts/contracts/ServiceBase.sol/ServiceBase.json"
- In
connector-rs/env
folder, create a.env
file starting from.env.example
and update the values accordingly to your development enviroment.
Running the Application
- Launch IPFS desktop and start up the database by running:
docker compose --profile dev up -d
- Run the connector service:
cd connector-rs
# For local node Provider
cargo run --release -- --rpc-provider "http://127.0.0.1:8545/" --chain-id 31337
# For Shimmer Provider
cargo run --release -- --rpc-provider "https://json-rpc.evm.testnet.shimmer.network" --chain-id 1073
# For Sepolia
cargo run --release -- --rpc-provider https://sepolia.infura.io/v3/<API_KEY> --chain-id 11155111
Run everything via Docker
Beware of the configuration of the environment variables. Note: Modify .env
and postgres.env
reasonably. (ADDR
and PG.HOST
must be changed for the deployment use case).
Copy the smart contract json files to create the Rust bindings (mandatory if the smart contracts change. There is already a copy in this repo).
# assuming the mediterraneus-smart-contracts folder is located in the same root folder of mediterraneus-connector-rs
cp ../mediterraneus-smart-contracts/artifacts/contracts/ServiceBase.sol/ServiceBase.json ./smart-contracts
Commands to build the app’s container image and launch the app container:
docker compose --profile deploy up -d