-
Notifications
You must be signed in to change notification settings - Fork 9
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
Martinh/cctp tutorial #71
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! Left some comments that sort of attempt to make the steps throughout the guide a little bit more concise and also a recommendation to try out different formats to see if maybe using a different format will improve readability. I'll leave that to you to test out and see what works best 🙂
Co-authored-by: Erin Shaben <[email protected]>
…oundation/wormhole-docs into martinh/cctp-tutorial merged with remote commit
Co-authored-by: Erin Shaben <[email protected]>
…oundation/wormhole-docs into martinh/cctp-tutorial merged remote commit
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
Co-authored-by: Erin Shaben <[email protected]>
…oundation/wormhole-docs into martinh/cctp-tutorial merged with remote commits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I have not tested the actual code. @ilariae would you mind reviewing and testing this please?
Before you begin, ensure you have the following: | ||
|
||
- [Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm){target=\_blank} installed on your machine | ||
- [USDC tokens](https://faucet.circle.com/){target=\_blank} on supported chains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add the specific testnet chains that this tutorial uses here. So they know what tokens to get to follow along with the tutorial
" - USDC tokens{target=_blank} on supported chains. This tutorial uses X"
|
||
Before initiating a cross-chain transfer, you must set up the chain context and signers for both the source and destination chains. | ||
|
||
1. **Initialize the Wormhole SDK** - initialize the `wormhole` function for the `Testnet` environment, and we specify the platforms (EVM and Solana) we want to support. This allows us to interact with both EVM-compatible chains like Avalanche and non-EVM chains like Solana if needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. **Initialize the Wormhole SDK** - initialize the `wormhole` function for the `Testnet` environment, and we specify the platforms (EVM and Solana) we want to support. This allows us to interact with both EVM-compatible chains like Avalanche and non-EVM chains like Solana if needed | |
1. **Initialize the Wormhole SDK** - initialize the `wormhole` function for the `Testnet` environment and specify the platforms (EVM and Solana) to support. This allows us to interact with both EVM-compatible chains like Avalanche and non-EVM chains like Solana if needed |
!!! note | ||
You can replace `'Testnet'` with `'Mainnet'` if you want to perform transfers on MainNet. | ||
|
||
2. **Set up source and destination chains** - we specify the source chain (Avalanche) and the destination chain (Solana) using the `getChain` method. This allows us to define where to send the USDC and where to receive them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. **Set up source and destination chains** - we specify the source chain (Avalanche) and the destination chain (Solana) using the `getChain` method. This allows us to define where to send the USDC and where to receive them | |
2. **Set up source and destination chains** - specify the source chain (Avalanche) and the destination chain (Solana) using the `getChain` method. This allows us to define where to send the USDC and where to receive them |
1. **Initialize the Wormhole SDK** - initialize the `wormhole` function for the `Testnet` environment, and we specify the platforms (EVM and Solana) we want to support. This allows us to interact with both EVM-compatible chains like Avalanche and non-EVM chains like Solana if needed | ||
|
||
```typescript | ||
--8<-- "code/tutorials/messaging/cctp/cctp-sdk-2.ts:10:11" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--8<-- "code/tutorials/messaging/cctp/cctp-sdk-2.ts:10:11" | |
--8<-- "code/tutorials/messaging/cctp/cctp-sdk-2.ts:11:11" |
This seems a little weird as the function is never closed with a matching })
, so I think it should just be the one line
--8<-- "code/tutorials/messaging/cctp/cctp-sdk-2.ts:14:15" | ||
``` | ||
|
||
3. **Configure the signers** - the `getSigner` function retrieves the signers responsible for signing transactions on the respective chains. This ensures that transactions are correctly authorized on both the source and destination chains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. **Configure the signers** - the `getSigner` function retrieves the signers responsible for signing transactions on the respective chains. This ensures that transactions are correctly authorized on both the source and destination chains | |
3. **Configure the signers** - use the `getSigner` function to retrieve the signers responsible for signing transactions on the respective chains. This ensures that transactions are correctly authorized on both the source and destination chains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please actually go through the rest of guide and make these steps like action items? Instead of saying this does this, it should be like do this to achieve this
|
||
You will need to provide the below requirements to complete the partial transfer: | ||
|
||
- **Transaction ID (`txid`)** - the transaction hash from the source chain where the transfer was initiated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this variable should be txId
|
||
You can find the full code for the manual USDC transfer script below: | ||
|
||
???- tip "`partial-transfer.ts`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the code admonition instead for all these expandable elements that show the whole file
In a manual USDC transfer, you perform each step of the cross-chain transfer process individually. This approach allows for greater control and flexibility over how the transfer is executed, which can be helpful in scenarios where you need to customize certain aspects of the transfer, such as gas management, specific chain selection, or signing transactions manually. | ||
|
||
Manual transfers give developers more control over each step, making them useful for custom setups, testing, or when automation isn't available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a manual USDC transfer, you perform each step of the cross-chain transfer process individually. This approach allows for greater control and flexibility over how the transfer is executed, which can be helpful in scenarios where you need to customize certain aspects of the transfer, such as gas management, specific chain selection, or signing transactions manually. | |
Manual transfers give developers more control over each step, making them useful for custom setups, testing, or when automation isn't available. | |
In a manual USDC transfer, you perform each step of the cross-chain transfer process individually. This approach allows for greater control and flexibility over how the transfer is executed, which can be helpful in scenarios where you need to customize certain aspects of the transfer, such as gas management, specific chain selection, or signing transactions manually. |
I felt like that line was a bit repetitive of the previous para
|
||
Manual transfers give developers more control over each step, making them useful for custom setups, testing, or when automation isn't available. | ||
|
||
This section will guide you through performing a manual USDC transfer across chains using the Wormhole SDK and Circle’s Cross-Chain Transfer Protocol (CCTP). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section will guide you through performing a manual USDC transfer across chains using the Wormhole SDK and Circle’s Cross-Chain Transfer Protocol (CCTP). | |
This section will guide you through performing a manual USDC transfer across chains using the Wormhole SDK and Circle’s CCTP. |
|
||
## Conclusion | ||
|
||
In this tutorial, you’ve gained hands-on experience with Circle’s Cross-Chain Transfer Protocol (CCTP) and the Wormhole SDK. You’ve learned to perform manual and automatic USDC transfers across multiple chains and recover partial transfers if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this tutorial, you’ve gained hands-on experience with Circle’s Cross-Chain Transfer Protocol (CCTP) and the Wormhole SDK. You’ve learned to perform manual and automatic USDC transfers across multiple chains and recover partial transfers if needed. | |
In this tutorial, you’ve gained hands-on experience with Circle’s CCTP and the Wormhole SDK. You’ve learned to perform manual and automatic USDC transfers across multiple chains and recover partial transfers if needed. |
No need to keep spelling out CCTP after doing it the first time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can you please add a card to the index page for the Tutorials > Messaging section? Just noticed this was missing. I created a ticket in Jira and assigned it to you to add the other missing one for the token transfers tutorial
Description
CCTP tutorial page.
Checklist
wormhole-mkdocs
repo