diff --git a/docs/pages/developers/evm/dispatching.mdx b/docs/pages/developers/evm/dispatching.mdx
index 447f31de6..8c3960fa6 100644
--- a/docs/pages/developers/evm/dispatching.mdx
+++ b/docs/pages/developers/evm/dispatching.mdx
@@ -9,7 +9,7 @@ A POST request is simply a cross-chain message to be executed by some `IIsmpModu
A post request is created using the `DispatchPost` struct
```solidity showLineNumbers
-// An object for dispatching post requests to the IsmpDispatcher
+// An object for dispatching post requests
struct DispatchPost {
// Use the StateMachine library to create this
bytes dest;
@@ -19,14 +19,15 @@ struct DispatchPost {
bytes body;
// timeout for this request in seconds
uint64 timeout;
- // The amount put up to be paid to the relayer, this is in $DAI and charged to tx.origin
+ // The amount put up to be paid to the relayer,
+ // this is in DAI and charged to msg.sender
uint256 fee;
// who pays for this request?
address payer;
}
```
-### Dispatch Parameters:
+### Dispatch Parameters
- `dest`: Destination chain, for this you'll use the `StateMachine` library eg `StateMachine.evm(1)` for Ethereum Mainnet.
@@ -38,7 +39,8 @@ struct DispatchPost {
- `body`: Serialized byte representation of the message (to be decoded by the receiving contract).
-- `timeout`: Relative time in seconds for message validity. Messages exceeding this timeout cannot be processed on the destination and require user action (timeout message) to revert changes.
+- `timeout`: Time in seconds for message validity eg 3600 for a timeout of 1 hour, or 0 for no timeout. ie Messages will never expire. If the timeout is set to a non-zero value, messages that have exceeded this timeout will be rejected on the destination and require user action
+ (timeout message) to revert changes.
- `fee`: Optional relayer fees, this can also be set to zero if the application developers prefer to self-relay.
@@ -71,7 +73,7 @@ Dispatching a POST response, going by it's name is, well, a response to a previo
A post response dispatch has the following fields:
```solidity showLineNumbers
-// An object for dispatching post responses to the IsmpDispatcher
+// An object for dispatching post responses
struct DispatchPostResponse {
// The request that initiated this response
PostRequest request;
@@ -79,14 +81,15 @@ struct DispatchPostResponse {
bytes response;
// timeout for this response in seconds
uint64 timeout;
- // the amount put up to be paid to the relayer, this is in $DAI and charged to tx.origin
+ // The amount put up to be paid to the relayer,
+ // this is in DAI and charged to msg.sender
uint256 fee;
// who pays for this request?
address payer;
}
```
-### Dispatch Parameters:
+### Dispatch Parameters
- `request`: The request object that was previously received.
@@ -96,7 +99,7 @@ struct DispatchPostResponse {
-- `timeout`: Relative time in seconds for message validity. Messages exceeding this timeout cannot be processed on the destination and require user action
+- `timeout`: Time in seconds for message validity eg 3600 for a timeout of 1 hour, or 0 for no timeout. ie Messages will never expire. If the timeout is set to a non-zero value, messages that have exceeded this timeout will be rejected on the destination and require user action
(timeout message) to revert changes.
@@ -136,7 +139,7 @@ When dispatching get requests,
you specify the storage keys you need to read and the block height at which you need to read these storage entries.
```solidity
-// An object for dispatching get requests to the IsmpDispatcher
+// An object for dispatching get requests
struct DispatchGet {
// bytes representation of the destination state machine
bytes dest;
@@ -153,7 +156,7 @@ struct DispatchGet {
}
```
-### Dispatch Parameters:
+### Dispatch Parameters
- `dest`: The chain whose database should be read (e.g., `StateMachine.evm(1)` for Ethereum Mainnet).
@@ -167,8 +170,8 @@ struct DispatchGet {
-- `timeout`: Relative time in seconds for message validity. Responses exceeding this timeout cannot be processed on the source and require user action (timeout
- message) to revert changes.
+- `timeout`: Time in seconds for message validity eg 3600 for a timeout of 1 hour, or 0 for no timeout. ie Messages will never expire. If the timeout is set to a non-zero value, messages that have exceeded this timeout will be rejected on the destination and require user action
+ (timeout message) to revert changes.
diff --git a/docs/pages/developers/evm/receiving.mdx b/docs/pages/developers/evm/receiving.mdx
index 3dea5071f..83379d8d7 100644
--- a/docs/pages/developers/evm/receiving.mdx
+++ b/docs/pages/developers/evm/receiving.mdx
@@ -4,10 +4,9 @@ To receive ISMP messages a contract must implement the [`IIsmpModule`](https://g
The required methods for the [`IIsmpModule`](https://github.com/polytope-labs/ismp-solidity/blob/main/interfaces/IIsmpModule.sol#L42) is described in detail below:
-
## `onAccept`
-This is the callback method for new POST requests that have been verified by Hyperbridge. After the `IHandler` verifies the neccessary proofs of this request, they are passed on to the host, which in turn calls the `onAccept` method for the intended modules. The arguments provided `IncomingPostRequest` holds both the request object itself and the account that initally called the Handler contract, this may be either a 3rd party relayer or a user who is self-relaying.
+This is the callback method for new POST requests that have been verified by Hyperbridge. After the `IHandler` verifies the necessary proofs of this request, they are passed on to the host, which in turn calls the `onAccept` method for the intended modules. The arguments provided `IncomingPostRequest` holds both the request object itself and the account that initally called the Handler contract, this may be either a 3rd party relayer or a user who is self-relaying.
`IIsmpModule`'s should ensure that is method is only callable by the `host` or risk critical vulnerabilies from unauthorized calls to this method by malicious actors. A modifier `onlyHost` is provided as part of the `BaseIsmpModule` for this.
@@ -15,11 +14,11 @@ This is the callback method for new POST requests that have been verified by Hyp
In the event that some initially dispatched request was unable to be delivered. Whether as a result of insufficient fees provided to the relayers, Or a revert during request execution on the destination chain. Then Hyperbridge allows this request to gracefully timeout, and this timeout can be reported back to the sending module on the source chain.
-This callback is provided as a way to execute some logic in the event that some request times out. This can be seen as a *catch* block in a try/catch for cross-chain messages. Typically you'll want to revert any state changes that were made prior to dispatching the request.
+This callback is provided as a way to execute some logic in the event that some request times out. This can be seen as a _catch_ block in a try/catch for cross-chain messages. Typically you'll want to revert any state changes that were made prior to dispatching the request.
## `onPostResponse`
-This is the callback method for new POST responses that have been verified by Hyperbridge. After the `IHandler` verifies the neccessary proofs of this response, they are passed on to the host, which in turn calls the `onPostResponse` method for the intended modules. The arguments provided `IncomingPostResponse` holds both the resopnse object itself and the account that initally called the Handler contract, this may be either a 3rd party relayer or a user who is self-relaying.
+This is the callback method for new POST responses that have been verified by Hyperbridge. After the `IHandler` verifies the necessary proofs of this response, they are passed on to the host, which in turn calls the `onPostResponse` method for the intended modules. The arguments provided `IncomingPostResponse` holds both the resopnse object itself and the account that initally called the Handler contract, this may be either a 3rd party relayer or a user who is self-relaying.
`IIsmpModule`'s should ensure that is method is only callable by the `host` or risk critical vulnerabilies from unauthorized calls to this method by malicious actors. A modifier `onlyHost` is provided as part of the `BaseIsmpModule` for this.
@@ -27,11 +26,11 @@ This is the callback method for new POST responses that have been verified by Hy
In the event that some initially dispatched response was unable to be delivered. Whether as a result of insufficient fees provided to the relayers, Or a revert during response execution on the destination chain. Then Hyperbridge allows this response to gracefully timeout, and this timeout can be reported back to the sending module on the source chain.
-This callback is provided as a way to execute some logic in the event that some response times out. This can be seen as a *catch* block in a try/catch for cross-chain messages. Typically you'll want to revert any state changes that were made prior to dispatching the response.
+This callback is provided as a way to execute some logic in the event that some response times out. This can be seen as a _catch_ block in a try/catch for cross-chain messages. Typically you'll want to revert any state changes that were made prior to dispatching the response.
## `onGetResponse`
-This is the callback method for new GET responses that have been verified by Hyperbridge. After the `IHandler` verifies the neccessary proofs of this response, they are passed on to the host, which in turn calls the `onGetResponse` method for the intended modules. The arguments provided `IncomingGetResponse` holds both the resopnse object itself and the account that initally called the Handler contract, this may be either a 3rd party relayer or a user who is self-relaying.
+This is the callback method for new GET responses that have been verified by Hyperbridge. After the `IHandler` verifies the necessary proofs of this response, they are passed on to the host, which in turn calls the `onGetResponse` method for the intended modules. The arguments provided `IncomingGetResponse` holds both the resopnse object itself and the account that initally called the Handler contract, this may be either a 3rd party relayer or a user who is self-relaying.
`IIsmpModule`'s should ensure that is method is only callable by the `host` or risk critical vulnerabilies from unauthorized calls to this method by malicious actors. A modifier `onlyHost` is provided as part of the `BaseIsmpModule` for this.
@@ -39,8 +38,7 @@ This is the callback method for new GET responses that have been verified by Hyp
In the event that some GET request is unable to be processed. Likely as a result of insufficient fees provided. Then Hyperbridge allows this request to gracefully timeout, and this timeout can be reported back to the sending module on the source chain.
-This callback is provided as a way to execute some logic in the event that some request times out. This can be seen as a *catch* block in a try/catch for cross-chain messages. Typically you'll want to revert any state changes that were made prior to dispatching the request.
-
+This callback is provided as a way to execute some logic in the event that some request times out. This can be seen as a _catch_ block in a try/catch for cross-chain messages. Typically you'll want to revert any state changes that were made prior to dispatching the request.
## Example `IIsmpModule`
@@ -90,43 +88,66 @@ contract Example is BaseIsmpModule {
return IDispatcher(host).dispatch{value: msg.value}(post);
}
- function onAccept(IncomingPostRequest memory incoming) external override onlyHost {
+ function onAccept(IncomingPostRequest memory incoming)
+ external
+ override
+ onlyHost
+ {
// decode request body
- // Check that decoded value can be executed successfully
- // Make state changes
+ // make any necessary state changes
emit PostReceived();
}
- function onPostRequestTimeout(PostRequest memory request) external override onlyHost {
- // revert any state changes made when post request was dispatched
+ function onPostRequestTimeout(PostRequest memory request)
+ external
+ override
+ onlyHost
+ {
+ // revert any state changes made
+ // when post request was dispatched
emit PostTimeoutReceived();
}
- function onPostResponse(IncomingPostResponse memory) external override onlyHost {
+ function onPostResponse(IncomingPostResponse memory)
+ external
+ override
+ onlyHost
+ {
// decode response
- // Check that decoded value can be executed successfully
- // Make state changes
+ // make any necessary state changes
emit PostResponseReceived();
}
- function onPostResponseTimeout(PostResponse memory) external override onlyHost {
- // revert any state changes made when post response was dispatched
+ function onPostResponseTimeout(PostResponse memory)
+ external
+ override
+ onlyHost
+ {
+ // revert any state changes made
+ // when post response was dispatched
emit PostResponseTimeoutReceived();
}
- function onGetResponse(IncomingGetResponse memory) external override onlyHost {
+ function onGetResponse(IncomingGetResponse memory)
+ external
+ override
+ onlyHost
+ {
emit GetResponseReceived();
}
- function onGetTimeout(GetRequest memory) external override onlyHost {
- // revert any state changes made when get request was dispatched
+ function onGetTimeout(GetRequest memory)
+ external
+ override
+ onlyHost
+ {
+ // revert any state changes
+ // made when get request was dispatched
emit GetTimeoutReceived();
}
}
```
-
## Security Considerations
-* Limit the caller of these functions to the `IIsmpHost` contract only. This prevents unauthorized messages from being executed.
-
+- Limit the caller of these functions to the `IIsmpHost` contract only. This prevents unauthorized messages from being executed.
diff --git a/docs/pages/developers/explore/index.mdx b/docs/pages/developers/explore/index.mdx
index fc7b68bc6..2bc44ce19 100644
--- a/docs/pages/developers/explore/index.mdx
+++ b/docs/pages/developers/explore/index.mdx
@@ -9,5 +9,5 @@ Hyperbridge brings together advanced cryptographic and mechanistic protocols to
The protocol is facilitated by:
- - A permissionless set of relayers who transmit cross-chain messages authenticated by cryptographic proofs.
- - Hyperbridge Nexus, a blockchain that serves a crypto-economic coprocessor for aggregating interoperability proofs.
+ - A permissionless set of relayers that transmit cross-chain messages authenticated by cryptographic proofs.
+ - Hyperbridge Nexus, a blockchain that serves as a crypto-economic coprocessor for aggregating interoperability proofs.
diff --git a/docs/pages/developers/network/node.mdx b/docs/pages/developers/network/node.mdx
index 260a42cd4..2732b9f41 100644
--- a/docs/pages/developers/network/node.mdx
+++ b/docs/pages/developers/network/node.mdx
@@ -102,7 +102,8 @@ rustup component add rust-src
Download a local copy of the repo and checkout the latest release tag
```bash
-export LATEST_TAG=hyperbridge-v0.5.0
+# fetch the latest tag from docker hub
+LATEST_TAG=$(curl -s https://hub.docker.com/v2/repositories/polytopelabs/hyperbridge/tags\?page_size\=1\&page\=2 | jq -r '.results[0].name')
git clone https://github.com/polytope-labs/hyperbridge.git
cd ./hyperbridge
git checkout ${LATEST_TAG}
@@ -162,28 +163,6 @@ hyperbridge \
--sync=fast-unsafe
```
-### Kusama
-
-Hyperbridge is live on Kusama with a chainId of `messier` and ParaId of `3340`. We do not recommend joining the kusama network at this time.
-
-```bash
-export PUBLIC_IP_ADDRESS=
-hyperbridge \
- --base-path=$HOME/.hyperbridge \
- --pruning=archive \
- --name="Your node name here" \
- --rpc-cors=all \
- --rpc-port=9944 \
- --unsafe-rpc-external \
- --rpc-methods=unsafe \
- --chain=messier \
- --no-mdns \
- --listen-addr=/ip4/0.0.0.0/tcp/30333 \
- --listen-addr=/ip6/::/tcp/30333 \
- --public-addr=/ip4/$PUBLIC_IP_ADDRESS/tcp/30333 \
- --out-peers=32
-```
-
### Polkadot
Hyperbridge is also live on Polkadot with a chainId of `nexus` and ParaId of `3367`.
diff --git a/docs/pages/developers/network/relayer.mdx b/docs/pages/developers/network/relayer.mdx
index 17cda3e94..54922645f 100644
--- a/docs/pages/developers/network/relayer.mdx
+++ b/docs/pages/developers/network/relayer.mdx
@@ -5,7 +5,7 @@ description: Running the Hyperbridge relayer
# Running a Relayer
-The Hyperbridge relayer (tesseract) can be obtained through a variety of ways. For now only release artifacts for x86 linux environments are officially distributed. You can also build the relayer from source if you prefer.
+The Hyperbridge relayer (tesseract) can be obtained through a variety of ways. For now only release artifacts for x86 linux environments are officially distributed. You can also build the relayer from source if you prefer.
## Prebuilt binaries
@@ -84,13 +84,14 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
### Clone the repo
-Download a local copy of the repo and checkout the latest release tag
+Download a local copy of the repo and checkout the latest release version.
```bash
-export LATEST_TAG=tesseract-v0.3.3
+# fetch the latest tag from docker hub
+LATEST_TAG=$(curl -s https://hub.docker.com/v2/repositories/polytopelabs/tesseract/tags\?page_size\=1\&page\=2 | jq -r '.results[0].name')
git clone https://github.com/polytope-labs/hyperbridge.git
cd ./hyperbridge
-git checkout ${LATEST_TAG}
+git checkout tesseract-${LATEST_TAG}
```
### Build the tesseract relayer
@@ -102,7 +103,9 @@ cargo build --release -p tesseract
The Tesseract relayer will now be available at `target/release/tesseract`, You can move the binary to your `$PATH` so you can run it directly.
-Update your path to include `${HOME}/.local/bin`. If you are using Bash, run the following. Alternatively, replace `${HOME}/.bashrc` with `${HOME}/.zshrc` if using Zsh. Replace `source` with `.` if necessary.
+Update your path to include `${HOME}/.local/bin`. If you are using Bash, run the
+following. Alternatively, replace `${HOME}/.bashrc` with `${HOME}/.zshrc` if
+using Zsh. Replace `source` with `.` if necessary.
```bash
# add .local/bin to path if it doesn't exist
@@ -146,7 +149,7 @@ At the minimum, the hyperbridge relayer should be run on a machine with at least
A community member has graciously provided their ansible playbook for running the hyperbridge relayer. You can find it here:
- - [schmiatz/hyperbridge-relayer](https://github.com/schmiatz/hyperbridge-relayer)
+- [schmiatz/hyperbridge-relayer](https://github.com/schmiatz/hyperbridge-relayer)
## Configuration
@@ -188,7 +191,7 @@ delivery_endpoints = [
[ethereum]
# configuration type can be either "evm" or "substrate"
type = "evm"
-# State machine identifier for the this evm chain.
+# State machine identifier for this evm chain.
# Must be specified as:
# - "EVM-{chainId}"
@@ -314,91 +317,91 @@ tesseract --config=$HOME/config.toml --db=$HOME/tesseract.db accumulate-fees --w
The relayer also runs background tasks for automatic fee accumulation and withdrawals. Whenever a batch of messages is successfully delivered, the fee accumulation task receives the delivery receipts and starts the process of accumulating the fees on hyperbridge. This process happens concurrently for all successfully delivered message batches. For redundancy, the delivery receipts are stored in the database prior to accumulation so they can be retried manually if any error is encountered.
-Withdrawing fees from hyperbridge is triggered at fixed intervals based on the configured
-`withdrawal_frequency` and `minimum_withdrawal_amount`. Feel free to the adjust these
-values as desired. The task will only make a withdrawal attempt if your balance on
-hyperbridge is greater than or equal to the configured `minimum_withdrawal_amount`.
-Any failed withdrawal attempts will be retried each time the withdrawal task is triggered.
-The manual processes described in the previous sections can be used as fallbacks
-when errors are encountered by their automated conterparts.
+Withdrawing fees from hyperbridge is triggered at fixed intervals based on the
+configured `withdrawal_frequency` and `minimum_withdrawal_amount`. Feel free to
+the adjust these values as desired. The task will only make a withdrawal attempt
+if your balance on hyperbridge is greater than or equal to the configured
+`minimum_withdrawal_amount`. Any failed withdrawal attempts will be retried each
+time the withdrawal task is triggered. The manual processes described in the
+previous sections can be used as fallbacks when errors are encountered by their
+automated conterparts.
## Relayer Errors
-List of commonly seen errors with their explanation and tips on how to fix them.
+List of commonly seen errors with their explanation and tips on how to fix them.
-```manpage
+```
ERROR tesseract_messaging: Failed to submit transaction to Evm(42161): Middleware error: (code: -32000, message: insufficient funds for gas * price + value: address have 0 want 323200000000000, data: None
```
-```manpage
+```
ERROR tesseract_evm::provider: Debug trace frame not found!
```
-```manpage
+```
ERROR tesseract_messaging: Error while handling POLKADOT-3367 on Evm(8453): Invalid name: please ensure the contract and method you're calling exist! failed to decode empty bytes. if you're using jsonrpc this is likely due to jsonrpc returning `0x` in case contract or method don't exist
```
-```manpage
+```
ERROR tesseract: Messaging task Evm(56)->Polkadot(3367) encountered an error: StreamError("Error encountered while querying state_machine_update_time Middleware error: (code: -32000, message: header not found, data: None)")
```
-```manpage
+```
ERROR tesseract_messaging: Failed to submit transaction to Polkadot(3367): Failed to submit unsigned extrinsic
```
-```manpage
+```
ERROR tesseract_messaging: Error while handling POLKADOT-3367 on Evm(56): Middleware error: (code: -32601, message: The method debug_traceCall does not exist/is not available, data: None)
```
-```manpage
+```
ERROR tesseract: Error waiting for challenge period in Evm(56) - Polkadot(3367) update stream
```
-```manpage
+```
ERROR tesseract_messaging: Failed to submit transaction to Evm(10): Transaction reverted
```
-```manpage
+```
ERROR tesseract_messaging: Error while handling POLKADOT-3367 on Evm(100): Middleware error: (code: -32053, message: API key is not allowed to access method, data: None)
```
-```manpage
+```
ERROR tesseract: Messaging task Evm(56)->Polkadot(3367) encountered an error: StreamError("Error fetching latest block height on Evm(56) JsonRpcClientError(MiddlewareError(Middleware((code: -32603, message: request failed or timed out, data: None))))")
```
-```manpage
+```
ERROR tesseract_evm::provider: Error while querying events in range 43812202..43812204 from Evm(56): Middleware error: (code: -32603, message: request failed or timed out, data: None)
```
-```manpage
+```
ERROR tesseract_evm::provider: Error while querying events in range 43816145..43816147 from Evm(56): Middleware error: (code: -32603, message: internal server error, data: None)
```
-```manpage
+```
ERROR tesseract: Messaging task Evm(56)->Polkadot(3367) encountered an error: StreamError("Error encountered while querying state_machine_update_time Invalid name: please ensure the contract and method you're calling exist! failed to decode empty bytes. if you're using jsonrpc this is likely due to jsonrpc returning `0x` in case contract or method don't exist")
```
-```manpage
+```
ERROR tesseract_messaging: Error while handling POLKADOT-3367 on Evm(1): Middleware error: Deserialization Error: response must be either a success/error or notification object at line 1 column 237. Response: {"jsonrpc":"2.0","id":31327,"result":null,"error":{"code":-32000,"message":"tracing failed: insufficient funds for gas * price + value: address have 411893340457544628 want 525945389500000000"}}
```
-```manpage
+```
ERROR tesseract_messaging: Error accummulating some fees, receipts have been stored in the db, you can try again manually
```
-```manpage
+```
ERROR tesseract: Messaging task Evm(56)->Polkadot(3367) encountered an error: StreamError("Error fetching latest block height on Evm(56) JsonRpcClientError(MiddlewareError(Middleware(Deserialization Error: expected value at line 1 column 1. Response: \r\n504 Gateway Time-out\r\n\r\n
504 Gateway Time-out
\r\n\r\n\r\n)))")
```
-```manpage
+```
ERROR tesseract_evm::provider: Error while querying events in range 43876757..43876796 from Evm(56): Middleware error: Deserialization Error: expected value at line 1 column 1. Response:
```
-```manpage
+```
ERROR tesseract_messaging: Error while handling EVM-56 on Polkadot(3367): Middleware error: (code: -32000, message: missing trie node baf71a6410ba54b32b02056415efe6b22060c20aff9c399d9b6308d0a88c3d09 (path ) state 0xbaf71a6410ba54b32b02056415efe6b22060c20aff9c399d9b6308d0a88c3d09 is not available, data: None)
```
-```manpage
+```
ERROR tesseract::cli: Disconnected from telemetry with: Text(
```
-
diff --git a/docs/pages/developers/polkadot/getting-started.mdx b/docs/pages/developers/polkadot/getting-started.mdx
new file mode 100644
index 000000000..3d62375c2
--- /dev/null
+++ b/docs/pages/developers/polkadot/getting-started.mdx
@@ -0,0 +1,83 @@
+---
+title: Getting Started
+description: Hyperbridge is built on a cross-chain interoperability protocol referred to as the [Interoperable State Machine Protocol](/protocol/ismp). This protocol implementation lives in the [Hyperbridge Monorepo](https://github.com/polytope-labs/hyperbridge/tree/main/modules/ismp).
+---
+
+# ISMP SDK
+
+Hyperbridge is built on a cross-chain interoperability protocol referred to as the [Interoperable State Machine Protocol](/protocol/ismp). This protocol implementation lives in the [Hyperbridge Monorepo](https://github.com/polytope-labs/hyperbridge/tree/main/modules/ismp). Polkadot-SDK based chains whether parachains or solochains can be connected to Hyperbridge and consequently all of Hyperbridge's connected networks through the ISMP protocol.
+
+The connection between Hyperbridge and Polkadot-SDK chains is mediated by a few modules that we will introduce below.
+
+## Pallet ISMP
+
+This is the core module of the Interoperable state machine protocol for Polkadot-SDK chains. It exposes APIs and calls that allow the runtime to send and receive ISMP messages respectively. You can add it to your runtime like so
+
+```
+cargo add pallet-ismp
+```
+
+### Pallet ISMP Runtime API
+
+This ISMP runtime API exposes necessary storage items to the client subsystems, specifically in this case the RPC subsystem. But you can also build custom client subsytems that leverage this runtime API. You can add it to your runtime like so
+
+```
+cargo add pallet-ismp-runtime-api
+```
+
+### Pallet ISMP RPC
+
+The Pallet ISMP RPC module exposes the necessary RPC APIs that are required by the [tesseract relayer](/developers/network/relayer) and other alternative relayer implementations. This is required for any kind of offchain relayer process. You can add it to your runtime like so
+
+```
+cargo add pallet-ismp-rpc
+```
+
+## Parachain Consensus Client
+
+For parachain runtimes that want to connect to Hyperbridge, They will do so by means of the parachain consensus client. Which is leverages the relay chain as the source of truth for finalized sibling parachain state commitments. You can add it to your runtime like so
+
+```
+cargo add pallet-ismp-rpc
+```
+
+
+### Parachain Inherent
+
+The parachain inherent greatly simplifies the infrastructure required for parachains to exchange messages with Hyperbridge by turning collators into consensus relayers. Specifically this inherent will automatically include sibling parachain headers and their proofs into every block keeping the parachain up to date with the latest finalized state of Hyperbridge and any other sibling parachain that is configured. Without this, a seperate consensus relayer will need to be run offchain. You can add it to your runtime like so
+
+```
+cargo add ismp-parachain-inherent
+```
+
+### Parachain Runtime API
+
+The Parachain inherent provider requires some runtime APIs to access which parachains are configured by the runtime to be included in the inherent.ou can add it to your runtime like so
+
+```
+cargo add ismp-parachain-runtime-api
+```
+
+## GRANDPA Consensus Client
+
+Solochains that want to connect to Hyperbridge will do so by means of the GRANDPA consensus client. This consensus client is capable of verifying GRANDPA consensus proofs of standalone chains as well as relay chains. You can add it to your runtime like so
+
+```
+cargo add ismp-grandpa
+```
+
+## Pallet Hyperbridge
+
+The Pallet Hyperbridge provides an implementation of the `IsmpDispatcher` which collects the Hyperbridge protocol fees, as well as an `IsmpModule` for processing cross-chain messages from Hyperbridge. These cross-chain messages may either be withdrawal requests may be for either relayer fees, or protocol fees. The IsmpModule may also receive cross-chain messages from Hyperbridge to adjust it's protocol fees as decided by governance. This module is optional and is only needed if Polkadot-SDK chains opt to pay Hyperbridge protocol fees onchain, they may also do so offchain by running their own relayers and paying Hyperbridge it's native token when they relay messages to Hyperbridge. You can add it to your runtime like so
+
+```
+cargo add pallet-hyperbridge
+```
+
+## Pallet Token Gateway
+
+The Pallet Token Gateway is an application-layer module that leverages Hyperbridge for token bridging. It works with any implementation of the `fungibles::*` traits so `pallet-assets` or `orml-tokens`. Allowing runtimes to send and receive assets from any of Hyperbridge's connected chains even EVM ones. You can add it to your runtime like so
+
+```
+cargo add pallet-token-gateway
+```
diff --git a/docs/pages/developers/polkadot/ismp-parachain-inherent.mdx b/docs/pages/developers/polkadot/ismp-parachain-inherent.mdx
new file mode 100644
index 000000000..af0d8ad5f
--- /dev/null
+++ b/docs/pages/developers/polkadot/ismp-parachain-inherent.mdx
@@ -0,0 +1,59 @@
+
+# ISMP Parachain Inherent Provider
+
+
+This module leverages the [`ProvideInherent`](https://docs.rs/frame-support/latest/frame_support/inherent/trait.ProvideInherent.html) functionality to submit consensus update messages. This approach offers a significant advantage:
+
+ - **Eliminating Off-chain Consensus Relayer** : By utilizing inherent messages for receiving consensus messages about finalized parachain block headers, the need for a separate off-chain consensus relayer is eliminated.
+ - **Simplified Architecture** : This reduces the overall system complexity by removing an external component (the off-chain consensus relayer).
+ - **Improved Efficiency** : Inherents are a built-in mechanism within the polkadot-sdk, allowing the collator to act as the consensus relayer.
+
+The inherent provider module needs to be added to the collator's client subsystems as shown in the code below
+
+```rust showLineNumbers
+fn start_consensus(
+ client: Arc,
+ backend: Arc,
+ block_import: ParachainBlockImport,
+ prometheus_registry: Option<&Registry>,
+ telemetry: Option,
+ task_manager: &TaskManager,
+ relay_chain_interface: Arc,
+ transaction_pool: Arc>,
+ sync_oracle: Arc>,
+ keystore: KeystorePtr,
+ relay_chain_slot_duration: Duration,
+ para_id: ParaId,
+ collator_key: CollatorPair,
+ overseer_handle: OverseerHandle,
+ announce_block: Arc>) + Send + Sync>,
+) {
+ // .. omitted calls
+
+ let (client_clone, relay_chain_interface_clone) =
+ (client.clone(), relay_chain_interface.clone());
+ let params = lookahead::Params {
+ create_inherent_data_providers: move |parent, ()| {
+ let client = client_clone.clone();
+ let relay_chain_interface = relay_chain_interface_clone.clone();
+ async move {
+ let inherent = ismp_parachain_inherent::ConsensusInherentProvider::create(
+ parent,
+ client,
+ relay_chain_interface,
+ ).await?;
+
+ Ok(inherent)
+ }
+ },
+ ..Default::default()
+ // omitted fields
+ };
+
+ // ..omitted calls
+}
+```
+
+## Implementation
+
+ - [ismp-parachain-inherent](https://github.com/polytope-labs/hyperbridge/blob/main/modules/ismp/clients/parachain/inherent/src/lib.rs)
diff --git a/docs/pages/developers/polkadot/ismp-parachain-runtime-api.mdx b/docs/pages/developers/polkadot/ismp-parachain-runtime-api.mdx
new file mode 100644
index 000000000..08420df2a
--- /dev/null
+++ b/docs/pages/developers/polkadot/ismp-parachain-runtime-api.mdx
@@ -0,0 +1,25 @@
+# ISMP Parachain Runtime API
+
+This is required by the `ismp-parachain-inherent`. It is used to access the whitelist of sibling parachains to produce consensus proofs for.
+
+To use this, Include the `ismp-parachain-runtime-api` implementation in your `impl_runtime_apis` section.
+
+```rust showLineNumbers [runtime.rs]
+use ismp_parachain_runtime_api::IsmpParachainApi;
+
+impl_runtime_apis! {
+ impl IsmpParachainApi for Runtime {
+ fn para_ids() -> Vec {
+ ismp_parachain::Pallet::::para_ids()
+ }
+
+ fn current_relay_chain_state() -> RelayChainState {
+ ismp_parachain::Pallet::::current_relay_chain_state()
+ }
+ }
+}
+```
+
+## Implementation
+
+ - [ismp-parachain-runtime-api](https://github.com/polytope-labs/hyperbridge/blob/main/modules/ismp/clients/parachain/runtime-api/src/lib.rs)
\ No newline at end of file
diff --git a/docs/pages/developers/polkadot/rpc.mdx b/docs/pages/developers/polkadot/pallet-ismp-rpc.mdx
similarity index 99%
rename from docs/pages/developers/polkadot/rpc.mdx
rename to docs/pages/developers/polkadot/pallet-ismp-rpc.mdx
index e795f7e68..762f4ffb7 100644
--- a/docs/pages/developers/polkadot/rpc.mdx
+++ b/docs/pages/developers/polkadot/pallet-ismp-rpc.mdx
@@ -18,7 +18,7 @@ Query results obtained through this interface are formatted in JSON (JavaScript
For offchain components that need to read the state of pallet-ismp, an rpc client is provided, this should be added to the rpc server in the substrate node.
-```rust showLineNumbers
+```rust showLineNumbers [rpc.rs]
// RPC API Implementation for pallet-ismp
/// Full client dependencies
pub struct FullDeps {
diff --git a/docs/pages/developers/polkadot/pallet-ismp-runtime-api.mdx b/docs/pages/developers/polkadot/pallet-ismp-runtime-api.mdx
new file mode 100644
index 000000000..d6eb47693
--- /dev/null
+++ b/docs/pages/developers/polkadot/pallet-ismp-runtime-api.mdx
@@ -0,0 +1,65 @@
+# Pallet ISMP Runtime API
+
+
+The `pallet-ismp-runtime-api` provides methods that allow the rpc client read the runtime state, this methods include querying requests and responses, generating proofs, among others. The runtime api can be easily added to the runtime as follows:
+
+```rust showLineNumbers [runtime.rs]
+impl pallet_ismp_runtime_api::IsmpRuntimeApi::Hash> for Runtime {
+ fn host_state_machine() -> StateMachine {
+ ::HostStateMachine::get()
+ }
+
+ fn challenge_period(state_machine_id: StateMachineId) -> Option {
+ pallet_ismp::Pallet::::challenge_period(state_machine_id)
+ }
+
+ /// Generate a proof for the provided leaf indices
+ fn generate_proof(
+ keys: ProofKeys
+ ) -> Result<(Vec, Proof<::Hash>), sp_mmr_primitives::Error> {
+ pallet_ismp::Pallet::::generate_proof(keys)
+ }
+
+ /// Fetch all ISMP events in the block, should only be called from runtime-api.
+ fn block_events() -> Vec<::ismp::events::Event> {
+ pallet_ismp::Pallet::::block_events()
+ }
+
+ /// Fetch all ISMP events and their extrinsic metadata, should only be called from runtime-api.
+ fn block_events_with_metadata() -> Vec<(::ismp::events::Event, Option)> {
+ pallet_ismp::Pallet::::block_events_with_metadata()
+ }
+
+ /// Return the scale encoded consensus state
+ fn consensus_state(id: ConsensusClientId) -> Option> {
+ pallet_ismp::Pallet::::consensus_states(id)
+ }
+
+ /// Return the timestamp this client was last updated in seconds
+ fn state_machine_update_time(height: StateMachineHeight) -> Option {
+ pallet_ismp::Pallet::::state_machine_update_time(height)
+ }
+
+ /// Return the latest height of the state machine
+ fn latest_state_machine_height(id: StateMachineId) -> Option {
+ pallet_ismp::Pallet::::latest_state_machine_height(id)
+ }
+
+
+ /// Get actual requests
+ fn requests(commitments: Vec) -> Vec {
+ pallet_ismp::Pallet::::requests(commitments)
+ }
+
+ /// Get actual requests
+ fn responses(commitments: Vec) -> Vec {
+ pallet_ismp::Pallet::::responses(commitments)
+ }
+ }
+```
+
+
+
+## Implementation
+
+ - [pallet-ismp-runtime-api](https://github.com/polytope-labs/hyperbridge/blob/main/modules/ismp/pallets/runtime-api/src/lib.rs)
\ No newline at end of file
diff --git a/docs/pages/developers/polkadot/integration.mdx b/docs/pages/developers/polkadot/pallet-ismp.mdx
similarity index 53%
rename from docs/pages/developers/polkadot/integration.mdx
rename to docs/pages/developers/polkadot/pallet-ismp.mdx
index d8bee0d88..52b4d8136 100644
--- a/docs/pages/developers/polkadot/integration.mdx
+++ b/docs/pages/developers/polkadot/pallet-ismp.mdx
@@ -2,151 +2,22 @@
This is the implementation of ISMP for substrate chains. It is the foundational component that allows communication over ISMP. It correctly composes the various ISMP components in the runtime.
-## Pallet Config
-
-The Pallet has the following Config trait
-
-```rust showLineNumbers
-#[pallet::config]
-pub trait Config: frame_system::Config {
- /// The overarching event type.
- type RuntimeEvent: From> + IsType<::RuntimeEvent>;
-
- /// Admin origin for privileged actions such as adding new consensus clients as well as
- /// modifying existing consensus clients (eg. challenge period, unbonding period)
- type AdminOrigin: EnsureOrigin;
-
- /// Timestamp interface [`UnixTime`] for querying the current timestamp. This is used within
- /// the various ISMP sub-protocols.
- type TimestampProvider: UnixTime;
-
- /// The balance of an account.
- type Balance: Parameter
- + Member
- + AtLeast32BitUnsigned
- + Codec
- + Default
- + Copy
- + MaybeSerializeDeserialize
- + Debug
- + MaxEncodedLen
- + TypeInfo
- + FixedPointOperand;
-
- /// The currency that is offered to relayers as payment for request delivery
- /// and execution. This should ideally be a stablecoin of some kind to guarantee
- /// predictable and stable revenue for relayers.
- ///
- /// This can also be used with pallet-assets through the
- /// [ItemOf](frame_support::traits::tokens::fungible::ItemOf) implementation
- type Currency: Mutate;
-
- /// The state machine identifier for the host chain. This is the identifier that will be
- /// used to accept requests that are addressed to this state machine. Remote chains
- /// will also use this identifier to accept requests originating from this state
- /// machine.
- type HostStateMachine: Get;
-
- /// The coprocessor is a state machine which proxies requests on our behalf. The coprocessor
- /// does this by performing the costly consensus and state proof verification needed to
- /// verify requests/responses that are addressed to this host state machine.
- ///
- /// The ISMP framework permits the coprocessor to aggregate messages from potentially
- /// multiple state machines. Finally producing much cheaper proofs of consensus and state
- /// needed to verify the legitimacy of the messages.
- type Coprocessor: Get