Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize Wormhole Docs #970

Merged
merged 6 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div id="termynal" data-termynal>
<span data-ty>warn | GlobalStorage: You are starting a relayer without a namespace, which could cause issues if you run multiple relayers using the same Redis instance</span>
<span data-ty>info | main: Running as both executor and listener</span>
<span data-ty>debug | executorHarness: Finished gathering worker infos.</span>
<span data-ty>info | Fantom Testnet-0-worker: Spawned</span>
<span data-ty>info | Moonbase Alpha-0-worker: Spawned</span>
<span data-ty>info | listenerHarness: Initializing spy listener...</span>
<span data-ty>info | spyEventSource: Initializing spy listener for plugin SimpleGeneralMessagePlugin...</span>
<span data-ty>debug | missedVaaFetching: Grouping emitter keys from plugins...</span>
<span data-ty>debug | listenerHarness: End of listener harness run function</span>
<span data-ty>warn | koa deprecated Support for generators will be removed in v3. See the documentation for examples of how to convert old middleware https://github.com/koajs/koa/blob/master/docs/migration.md node_modules/relayer-engine/relayer-engine/lib/index.js:138:9</span>
<span data-ty>info | spyEventSource: SimpleGeneralMessagePlugin subscribing to spy with raw filters: [{"chainId":2,"emitterAddress":"0xfB7327Fe26aD52b693E38232E5D97F4892623075"},{"chainId":5,"emitterAddress":"0xfB7327Fe26aD52b693E38232E5D97F4892623075"},{"chainId":6,"emitterAddress":"0xfB7327Fe26aD52b693E38232E5D97F4892623075"},{"chainId":16,"emitterAddress":"0x428097dCddCB00Ab65e63AB9bc56Bb48d106ECBE"},{"chainId":10,"emitterAddress":"0x5017Fd40aeA8Ab94693bE41b3bE4e90F45860bA4"}]</span>
<span data-ty>debug | spyEventSource: SimpleGeneralMessagePlugin using transformed filters: [{"emitterFilter":{"chainId":2,"emitterAddress":"000000000000000000000000fb7327fe26ad52b693e38232e5d97f4892623075"}},{"emitterFilter":{"chainId":5,"emitterAddress":"000000000000000000000000fb7327fe26ad52b693e38232e5d97f4892623075"}},{"emitterFilter":{"chainId":6,"emitterAddress":"000000000000000000000000fb7327fe26ad52b693e38232e5d97f4892623075"}},{"emitterFilter":{"chainId":16,"emitterAddress":"000000000000000000000000428097dcddcb00ab65e63ab9bc56bb48d106ecbe"}},{"emitterFilter":{"chainId":10,"emitterAddress":"0000000000000000000000005017fd40aea8ab94693be41b3be4e90f45860ba4"}}]</span>
<span data-ty>debug | missedVaaFetching: Starting nextVaaFetchingWorker...</span>
<span data-ty>debug | missedVaaFetching: Pessimistically fetching next vaa for all emitters registered by plugins</span>
<span data-ty>info | spyEventSource: connected to spy service, listening for transfer signed VAAs</span>
<span data-ty>info | MetricsServer: Prometheus metrics running on port 3001</span>
<span data-ty>info | ApiServer: Api running on port 3000</span>
<span data-ty>debug | missedVaaFetching: nextVaaFetchingWorker loop completed, sleeping 300000000 ms...</span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div id="termynal" data-termynal>
<span data-ty>debug | spyEventSource: 7iWtnE4whSBtCxmUA87FUQkCLhy92gHW/qIg6/vTMNM=</span>
<span data-ty>debug | spyEventSource: 10</span>
<span data-ty>info | missedVaafetching: Fetching missed vas for 10: 0000000000000000000000001fd6d0beaf150526a6e48dbde8484a73a280a45, from 1 to 2</span>
<span data-ty>debug | SimpleGeneralMessagePlugin: VAA hash: 7iWtnE4whSBtCmUA87FUQkCLhy92gHW/qIg6/VTMNM=</span>
<span data-ty>info | leventHarness: Received workflow data from plugin SimpleGeneralMessagePlugin, adding workflow.</span>
<span data-ty>debug | GlobalStorage: Updating emitter record last seen sequence.</span>
<span data-ty>debug | GlobalStorage: Found emitterRecord</span>
<span data-ty>debug | executorHarness: New workflow found</span>
<span data-ty>info | executorHarness: Starting workflow.</span>
<span data-ty>info | SimpleGeneralMessagePlugin: Workflow 10/0000000000000000000000001d6d0beaf150526a648dbde8484a73a280a45/2/ee25 a received.</span>
<span data-ty>info | SimpleGeneralMessagePlugin: Parsed VAA. seq: 2</span>
<span data-ty>info | SimpleGeneralMessagePlugin: VAA: 0x0394c0edf cca370b20622721985b577850b@eb75 sent "this is a message" to exa8add 09e4fcf1b5edc588c54bee137cb35e61f5b on chain 16.</span>
<span data-ty>debug | GlobalStorage: Updated emitter record. Key SimpleGeneralMessagePlugin:10:0000000000000000000000001d6d0beaf150 52f6a648dbde8484a73a280a45, {"lastSeenSequence":2,"time":"2023-03-14T21:38:11.780Z"}</span>
<span data-ty>info | Moonbase Alpha-0-worker: Relaying action for plugin SimpleGeneralMessagePlugin,</span>
<span data-ty>debug | executorHarness: No new workflows found.</span>
<span data-ty>info | SimpleGeneralMessagePlugin: [object Object]</span>
<span data-ty>info | Moonbase Alpha-0-worker: Action SimpleGeneralMessagePlugin completed</span>
<span data-ty>info | executorHarness: Finished executing workflow.</span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div id="termynal" data-termynal>
<span data-ty="input"><span class="file-path"></span>npm run testnet-spy</span>
<span data-ty>@wormhole-foundation/[email protected] testnet-spy</span>
<span data-ty>docker run --platform=linux/amd64 -p 7073:7073 --entrypoint /guardiand ghcr.io/wormhole-foundation/guardiand:latest spy --nodeKey /node.key --spyRPC "[::]:7073" --network /wormhole/testnet/2/1 --bootstrap /dns4/t-guardian-01.testnet.xlabs.xyz/udp/8999/quic/p2p/12D3KooWCW3LGUtkCVkHZmVSZHzL3C4WRKWfqAiJPz1NR7dT9Bxh</span>
<span data-ty>INFO wormhole-spy spy/spy.go:322 status server listening on [::]:6060</span>
<span data-ty>INFO wormhole-spy spy/spy.go:270 spy server listening {"addr": "[::]:7073"}</span>
<span data-ty>INFO wormhole-spy common/nodekey.go:16 No node key found, generating a new one... {"path": "/node.key"}</span>
<span data-ty>INFO wormhole-spy.supervisor supervisor/supervisor_processor.go:41 supervisor processor started</span>
<span data-ty>INFO wormhole-spy spy/spy.go:413 Started internal services</span>
<span data-ty>INFO wormhole-spy.root.p2p p2p/p2p.go:276 Connecting to bootstrap peers {"bootstrap_peers": "/dns4/t-guardian-01.testnet.xlabs.xyz/udp/8999/quic-v1/p2p/12D3KooWCW3LGUtkCVkHZmVSZHzL3C4WRKWfqAiJPz1NR7dT9Bxh"}</span>
<span data-ty>INFO wormhole-spy.root.p2p p2p/p2p.go:345 Subscribing pubsub topic {"topic": "/wormhole/testnet/2/1/broadcast"}</span>
<span data-ty>INFO dht/RtRefreshManager rtrefresh/rt_refresh_manager.go:322 starting refreshing cpl 0 with key CIQAAAAEGIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA (routing table size was 0)</span>
<span data-ty>INFO wormhole-spy.root.p2p p2p/p2p.go:387 Connected to bootstrap peers {"num": 1}</span>
<span data-ty>INFO wormhole-spy.root.p2p p2p/p2p.go:389 Node has been started {"peer_id": "12D3KooWJmUftCbuZH9rAF6Zzq9dhDhQ5yQrdwEVhiY8PXN3KtTG", "addrs": "[/ip4/127.0.0.1/udp/8999/quic-v1 /ip4/172.17.0.2/udp/8999/quic-v1 /ip6/::1/udp/8999/quic-v1]"}</span>
<span data-ty>2024-08-01T23:03:51.193Z INFO wormhole-spy spy/spy.go:371 Received signed VAA {"vaa": "AQAAAAABAICa9rr2B5VTAg6tcYu/5DCkzbKVC5xG2CT0EZ681BP0Mxmb9RwTvSENT7Cr1GZ8LRmXbW7W0kZVELN+hhAh5boAZqwUVgAAAAAAGuEB+u2sWFHjK5sjtflBGowrrEquPtTde4Ed0acupKpxAAAAAASqMYIBQVVXVgAAAAAACT4b8wAAJxCYq1BJcB42Joc35zEoMLG3u4ARJg=="}</span>
</div>
17 changes: 8 additions & 9 deletions builders/interoperability/protocols/wormhole.md
themacexpert marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ There are a couple of resources to get you started building cross-chain applicat

See the list of Wormhole contracts deployed to Moonbeam, and the networks connected to Moonbeam through Wormhole.

- **MainNet Contracts** - [Moonbeam](https://docs.wormhole.com/wormhole/blockchain-environments/evm#moonbeam){target=\_blank}
- **TestNet Contracts** - [Moonbase Alpha](https://docs.wormhole.com/wormhole/blockchain-environments/evm#testnet-contracts-moonbase-alphanet-1287){target=\_blank}
- **MainNet Contracts** - [Moonbeam](https://docs.wormhole.com/wormhole/reference/blockchain-environments/evm#moonbeam){target=\_blank}
- **TestNet Contracts** - [Moonbase Alpha](https://docs.wormhole.com/wormhole/reference/blockchain-environments/evm#testnet-contracts-moonbase-alphanet-1287){target=\_blank}

## Setting up a Specialized Relayer With the Relayer Engine {: #setting-up-a-specialized-relayer-with-the-relayer-engine }

Expand Down Expand Up @@ -117,7 +117,7 @@ Now use Remix to ensure that your two connected contracts trust each other. You
3. Also check that the contract is still **SimpleGeneralMessage**
4. Finally, take the address of the destination contract, and paste it into the **At Address** input

![At address](/images/builders/interoperability/protocols/wormhole/wormhole-4.webp)
![At address](/images/builders/interoperability/protocols/wormhole/wormhole-3.webp)

To add trusted remote addresses:

Expand All @@ -127,7 +127,7 @@ To add trusted remote addresses:

When you are on the alternate EVM TestNet, set the **sender** as the properly formatted (padded with 24 zeros) address of the contract you deployed on Moonbase Alpha. Set the **_chainId** as Moonbase Alpha’s Wormhole chain ID (16). Finally, transact and confirm in MetaMask.

![Add trusted address](/images/builders/interoperability/protocols/wormhole/wormhole-5.webp)
![Add trusted address](/images/builders/interoperability/protocols/wormhole/wormhole-4.webp)

In this section you should have sent two transactions on two chains to whitelist addresses in both contracts. Afterwards, you should be allowed to send messages between the connected contracts.

Expand Down Expand Up @@ -168,7 +168,7 @@ npm run testnet-spy

First, you should see a few logs from the startup of the Docker container. Then, a lot of logs should be spamming the console. These are all the VAAs that are going through the Wormhole TestNet, and there are a lot! Don’t worry, you won’t have to decipher any of these logs: the code can do that for you. Leave this running in the background and get another terminal instance to move on to the next step.

![Run the spy relayer](/images/builders/interoperability/protocols/wormhole/wormhole-6.webp)
--8<-- 'code/builders/interoperability/protocols/wormhole/terminal/setup-spy.md'

### Setting up the Listener Component {:setting-up-the-listener-component}

Expand Down Expand Up @@ -394,7 +394,7 @@ npm run start

You should see something similar to the logs below in the console.

![Run the relayer](/images/builders/interoperability/protocols/wormhole/wormhole-7.webp)
--8<-- 'code/builders/interoperability/protocols/wormhole/terminal/run-start.md'

### Sending a Cross-Chain Message from Moonbase with Wormhole {: #send-message-from-moonbase }

Expand All @@ -409,16 +409,15 @@ Use the Remix interface. This example is going to send a cross-chain message to
5. Put the destination chain’s Wormhole chain ID in the **destChainId** input of the **sendMessage** section
6. Once this is all done, transact the execution and confirm it in MetaMask

![Send a transaction](/images/builders/interoperability/protocols/wormhole/wormhole-8.webp)
![Send a transaction](/images/builders/interoperability/protocols/wormhole/wormhole-5.webp)

After a few seconds to a minute, cross-chain messages should be properly relayed through the relayer that you are hosting on your local machine.

![Message relay in the logs](/images/builders/interoperability/protocols/wormhole/wormhole-9.webp)
--8<-- 'code/builders/interoperability/protocols/wormhole/terminal/send.md'

## Moonbeam Routed Liquidity Integration {: #moonbeam-routed-liquidity-integration }

Wormhole will provide liquidity to parachains through the Moonbeam Routed Liquidity (MRL) program. This program allows one-click transfers of liquidity from Wormhole connected chains into parachain wallets by sending liquidity through Moonbeam networks.

[MRL](/builders/interoperability/mrl/){target=\_blank} utilizes the [GMP Precompile](/builders/ethereum/precompiles/interoperability/gmp/){target=\_blank}, whose documentation explains how cross-chain messages should be constructed to properly use the precompile.

--8<-- 'text/_disclaimers/third-party-content.md'
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading