Configuration

Bonder configuration examples

The bonder configuration will prepare the networks and assets supported by your bonder. The config is very custom to your bonder, so please read through each item carefully.

Below is an example of a USDC bonder running on Ethereum, Gnosis, Polygon, Optimism, and Arbitrum.

Configuration example

{
  "network": "mainnet",
  "chains": {
    "ethereum": {
      "rpcUrl": "https://mainnet.infura.io/v3/84842078b09946638c03157f83405213",
      "maxGasPrice": 500
    },
    "gnosis": {
      "rpcUrl": "https://rpc.gnosischain.com",
      "customSyncType": "threshold",
      "maxGasPrice": 90
    },
    "polygon": {
      "rpcUrl": "https://polygon-rpc.com",
      "customSyncType": "threshold",
      "maxGasPrice": 5000
    },
    "optimism": {
      "rpcUrl": "https://mainnet.optimism.io",
      "customSyncType": "threshold",
      "maxGasPrice": 500
    },
    "arbitrum": {
      "rpcUrl": "https://arb1.arbitrum.io/rpc",
      "customSyncType": "threshold",
      "maxGasPrice": 500
    }
  },
  "tokens": {
    "USDC": true
  },
  "routes": {
    "ethereum": {
      "polygon": true,
      "gnosis": true,
      "arbitrum": true,
      "optimism": true
    },
    "polygon": {
      "ethereum": true,
      "gnosis": true,
      "arbitrum": true,
      "optimism": true
    },
    "gnosis": {
      "ethereum": true,
      "polygon": true,
      "arbitrum": true,
      "optimism": true
    },
    "arbitrum": {
      "ethereum": true,
      "polygon": true,
      "gnosis": true,
      "optimism": true
    },
    "optimism": {
      "ethereum": true,
      "polygon": true,
      "gnosis": true,
      "arbitrum": true
    }
  },
  "db": {
    "location": "/root/.hop/db"
  },
  "logging": {
    "level": "debug"
  },
  "keystore": {
    "location": "/root/.hop/keystore.json",
    "parameterStore": "/Hop/Bonder/Keystore/Pass",
    "awsRegion": "us-east-1"
  },
  "watchers": {
    "bondTransferRoot": true,
    "bondWithdrawal": true,
    "commitTransfers": true,
    "settleBondedWithdrawals": true,
    "confirmRoots": true,
    "L1ToL2Relay": true
  },
  "commitTransfers": {
    "minThresholdAmount": {
      "USDC": {
        "polygon": {
          "ethereum": 170000,
          "gnosis": 50000,
          "optimism": 130000,
          "arbitrum": 130000
        },
        "gnosis": {
          "ethereum": 170000,
          "polygon": 130000,
          "optimism": 130000,
          "arbitrum": 130000
        },
        "optimism": {
          "ethereum": 170000,
          "polygon": 130000,
          "gnosis": 50000,
          "arbitrum": 130000
        },
        "arbitrum": {
          "ethereum": 170000,
          "polygon": 130000,
          "gnosis": 50000,
          "optimism": 130000
        }
      }
    }
  },
  "fees": {
    "USDC": {
      "ethereum": 14,
      "polygon": 14,
      "gnosis": 25,
      "optimism": 14,
      "arbitrum": 14
    }
  }
}

Properties

chains

Specify configuration options for each chain.

The RPC URL is optional and a default will be used if not specified. The redundant RPC URLs are optional. If supplied, these URLs will be utilized to confirm data on the source chain before proceeding with a transaction on the destination chain."

Note: If the selected network doesn't support a chain, it will be ignored.

"chains": {
  "<chain-slug>": {
    "rpcUrl": "<chain-rpc-url>",
    "customSyncType": "<custom-sync-type", // Not applicable if `chain-slug` is `ethereum`
    "maxGasPrice": "<max-gas-price>",
    "redundantRpcUrls": ["<chain-rpc-url>, ..."]
  },
  ...
}

Chain slug options:

tokens

Specify which tokens and their token bridges to interactive with:

"tokens": {
  "USDC": true,
  ...
}

routes

Specify which routes to bond:

"routes": {
  "ethereum": {
    "polygon": true,
    "gnosis": true,
    "arbitrum": true,
    "optimism": true
  },
  "polygon": {
    "ethereum": true,
    "gnosis": true,
    "arbitrum": true,
    "optimism": true
  },
  ...
}

The structure is source -> destination, for example:

"routes": {
  "polygon": {
    "gnosis": true
  },
  ...
}

The above example means that the bonder will bond transfers at the destination sent from polygon->gnosis.

db

Configure options for leveldb database used for caching:

logging

Configure logging levels:

keystore

Configure options for keystore:

watchers

Watchers are like services in the Hop Node.

They should all be enabled unless there's a specific reason not to enable certain watchers.

commitTransfers

The minThresholdAmount is used to determine when to commit the bundle of transfers.

The format is token: { source: { destination: amount } }

This example will commit transfers when a total of at least 20,000 MATIC are pending commit in the bundle, going either from gnosis->ethereum or polygon->ethereum, and a 10,000 threshold for the direction gnosis->polygon or polygon->gnosis.

"commitTransfers": {
  "minThresholdAmount": {
    "USDC": {
      "gnosis": {
        "ethereum": 20000,
        "polygon": 10000
      },
      "polygon": {
        "ethereum": 20000,
        "gnosis": 10000
      }
    }
  }
}

fees

Configure fee options. The fees are in basis points:

"fees": {
  "USDC": {
    "ethereum": 14,
    "polygon": 14,
    "gnosis": 25,
    "optimism": 14,
    "arbitrum": 14
  },
    ...
}

bonders

List of bonders, used for calculating total available liquidity.

The format is

"[TOKEN]": {
  "[SOURCE_CHAIN]": {
    "[DESTINATION_CHAIN]": "[BONDER_ADDRESS]"
  }
}

Full example:

  "bonders": {
    "ETH": {
      "ethereum": {
        "optimism": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "arbitrum": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "gnosis": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "polygon": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564"
      },
      "optimism": {
        "ethereum": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "arbitrum": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "gnosis": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "polygon": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564"
      },
      "arbitrum": {
        "ethereum": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "optimism": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "gnosis": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "polygon": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564"
      },
      "gnosis": {
        "ethereum": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "arbitrum": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "optimism": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "polygon": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564"
      },
      "polygon": {
        "ethereum": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "arbitrum": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "gnosis": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564",
        "optimism": "0x710bDa329b2a6224E4B44833DE30F38E7f81d564"
      }
    },
    ...
  }

blocklist

Configure a blocklist of addresses for bonder to not bond transfers.

Using local blocklist file of addresses:

"blocklist": {
  "path": "/root/.hop/blocklist.txt"
}

Using remote blocklist file of addresses:

"blocklist": {
  "path": "https://example.com/blocklist.txt"
}

Using inline list of blocklisted addresses:

"blocklist": {
  "addresses": {
    "0x123...": true,
    "0xabc...": true
  }
}

Note: The Hop Node will need to be restarted whenever updating local, remote, or inline blocklist of addresses.

OFAC list: https://www.treasury.gov/ofac/downloads/sdnlist.txt

signer

Configure options for signer:

Environment variables

Notifications

Slack

The Hop Node can post to Slack when an error occurs or when it sends transactions.

To set it up, configure the following environment variables:

More granular options for Slack channels:

Last updated