Core MEV setup - Manual gateway

This section assumes that marlinctl is installed already. See here if you have not installed it.

Step 1: Generate a client identity for the gateway by running the below command and entering a passphrase when prompted

sudo marlinctl gateway polygon bor keystore create

Step 2: Set up mev-bor in the validator node.

wget http://public.artifacts.marlin.pro/projects/mev-bor/2.0.4/bor-linux_amd64 -O /path/to/local/bor

Step 3: Expose the RPC methods from mev-bor by adding the below cli flags.

--http  # Enable http rpc
--http.addr "0.0.0.0"  # Expose the RPC endpoint outside the instance so the gateway can access it
					   # IMPORTANT: Protect the RPC endpoint from external access using a firewall
                       # Especially if you are exposing the `eth` namespace, be sure to set up the firewall _prior_
                       # Only the gateway should have access to it
--http.api "mev"  # The RPC APIs used by the gateway live in the `mev` namespace, expose them
				  # Can expose other RPCs as per your requirement
--miner.recommit "700ms"  # Reduce the recommit time so blocks with bundles can be generated

Restart the bor service so all the above changes take effect.

Step 4: Create the gateway, providing the above RPC endpoint (default RPC port in bor is 8545).

sudo marlinctl gateway polygon bor create --bootstrap-addr "127.0.0.1:8002" --spamcheck-addr "rpc_ip:rpc_port" --bundle-addr "http://rpc_ip:rpc_port/"

Step 5: The gateway needs to accept connections on port 18545, ensure it is open to the internet.

That's it!

Contact us if you would like a hands-on guided walkthrough.