You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd into the cloned sygma-relayer folder, and then run the following command, which will start the dockerized setup:
make example
:::note Be aware
The make example will require several GB's of space on your machine while it is running. You can follow this documentation to prune unused containers, networks, images, and volumes after you are done with the example in full.
:::
3) Clone the Sygma SDK repository
Next, clone the Sygma SDK repository into a directory of your choice, and then cd into that folder:
git clone [email protected]:sygmaprotocol/sygma-sdk.git
cd sygma-sdk/
4) Build the SDK
If you haven't already done so, install dependencies with:
yarn install
And build the SDK by running:
yarn build
4) Run the EVM-to-Substrate token transfer example
cd into the evm-to-substrate-fungible-transfer example inside the /sygma-sdk/examples folder
Update RPC Urls and transfer parameters in the example with local configuration
run:
yarn run transfer
This will start a local ERC-20 transfer of the ERC20LRTest token using the local Sygma setup. It will use ethers together with the sygma-sdk to create a transfer from the EVM1 network to the Substrate network.
5) Run the Substrate-to-EVM token transfer example
To demonstrate the exact same transfer in the other direction, you can use the example substrate-to-evm-fungible-transfer and follow similar steps of the previous example.
Similarly, this will use @polkadot/api together with the sygma-sdk to create an ERC20LRTest transfer from the Substrate network to the EVM1 network.
:::note
To easily verify the bridging transactions, we have added console logs that will print out the transaction hashes and token balances. Additionally, you can verify the Substrate transactions (called extrinsics in the Dotsama ecosystem) by connecting to the locally hosted node using Polkadot.js. This will give you access to the Polkadot.js block explorer. From here, you can paste in the Substrate transaction hashes to verify the chain state.
:::
Make changes to onchain Sygma setup
Once you start the local setup, it is possible to configure the Sygma EVM contracts or Sygma Substrate pallets, since all node RPC endpoints are exposed and you can interact with them as with any regular node.
Local Sygma Setup
The local setup contains preconfigured resources including:
EVM1
andEVM2
respectivelySubstrate
More details can be found in the local configuration.
To interact with the local setup using the Sygma SDK, set
SYGMA_ENV
environment variable aslocal
.Running the local setup example
We will be running the example provided inside the Sygma SDK repository.
1) Clone the Sygma Relayer repository
First, clone the Sygma relayer repository into a directory of your choice:
2) Start local setup
cd
into the cloned sygma-relayer folder, and then run the following command, which will start the dockerized setup::::note Be aware
The
make example
will require several GB's of space on your machine while it is running. You can follow this documentation to prune unused containers, networks, images, and volumes after you are done with the example in full.:::
3) Clone the Sygma SDK repository
Next, clone the Sygma SDK repository into a directory of your choice, and then
cd
into that folder:4) Build the SDK
If you haven't already done so, install dependencies with:
And build the SDK by running:
4) Run the EVM-to-Substrate token transfer example
cd
into theevm-to-substrate-fungible-transfer
example inside the/sygma-sdk/examples
folderUpdate RPC Urls and transfer parameters in the example with local configuration
run:
This will start a local ERC-20 transfer of the
ERC20LRTest
token using the local Sygma setup. It will useethers
together with the sygma-sdk to create a transfer from theEVM1
network to theSubstrate
network.5) Run the Substrate-to-EVM token transfer example
To demonstrate the exact same transfer in the other direction, you can use the example
substrate-to-evm-fungible-transfer
and follow similar steps of the previous example.Similarly, this will use
@polkadot/api
together with the sygma-sdk to create anERC20LRTest
transfer from theSubstrate
network to theEVM1
network.:::note
To easily verify the bridging transactions, we have added console logs that will print out the transaction hashes and token balances. Additionally, you can verify the Substrate transactions (called
extrinsics
in the Dotsama ecosystem) by connecting to the locally hosted node using Polkadot.js. This will give you access to the Polkadot.js block explorer. From here, you can paste in the Substrate transaction hashes to verify the chain state.:::
Make changes to onchain Sygma setup
Once you start the local setup, it is possible to configure the Sygma EVM contracts or Sygma Substrate pallets, since all node RPC endpoints are exposed and you can interact with them as with any regular node.
The text was updated successfully, but these errors were encountered: