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 -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 ""  # 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 "" --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.