Akhil Kumar P
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Relayer IBC Testing ## Faucet Server Setup To test IBC commands, you need to start a server first. Once after starting chain, enable faucet relayer server in same server. While setting up the server, ensure that ports :8000 (faucet) and :26657 (gaiad) are open and accessable. Run below commands in same system where your are running server: ```bash # Write chain config into a json file $ echo "{\"key\":\"$RLYKEY\",\"chain-id\":\"$CHAINID\",\"rpc-addr\":\"$NODE_RPC\",\"account-prefix\":\"$ACCOUNT_PREFIX\",\"gas-adjustment\":1.5,\"gas-prices\":\"0.025$DENOM\",\"trusting-period\":\"3306h\"}" > $CHAINID.json # Above, # $RLYKEY represents key name of chain # $CHAINID represents chain-id # $NODE_RPC represents rpc-address of node # $ACCOUNT_PREFIX represents account address prefix # $DENOM represents denom of chain # NOTE: you will want to save the content from this JSON file # install the relayer $ export RELAYER=$GOPATH/src/github.com/cosmos/relayer $ mkdir -p $(dirname $RELAYER) && git clone git@github.com:cosmos/relayer $RELAYER && cd $RELAYER $ make install # Now its time to configure relayer and start faucet server $ cd $ rly config init # Add chain to relayer using json created above $ rly chains add -f $CHAINID.json $ rly keys add $CHAINID $RLYKEY # Setup the faucet service definition rly dev faucet $USER $HOME $CHAINID $RLYKEY 100000$DENOM > faucet.service # Example for above command: $ rly dev faucet vitwit /home/vitwit ibc-0 testkey 100000000stake sudo mv faucet.service /etc/systemd/system/faucet.service sudo systemctl daemon-reload sudo systemctl start faucet # Faucet server _should_ be ready to go! # Be sure you have the text from ~/$CHAINID.json for the next step ``` ## Relayer Setup Once you have your server (you could deploy the relayer on a different machine as above server) ```bash # install the relayer export RELAYER=$GOPATH/src/github.com/cosmos/relayer mkdir -p $(dirname $RELAYER) && git clone git@github.com:cosmos/relayer $RELAYER && cd $RELAYER make install # then to configure your local relayer to talk to your remote chain # get the json from $CHAINID.json on your server rly cfg init rly ch add -f {{chain_id}}.json # create a local rly key for the chain rly keys add {{chain_id}} testkey # configure the chain to use that key by default rly ch edit {{chain_id}} key testkey # initialize the light client for {{chain_id}} rly light init {{chain_id}} -f # request funds from the faucet to test it rly tst request {{chain_id}} testkey # you should see a balance for the rly key now rly q bal {{chain_id}} ``` Note that most of these instructions would also work directly on the server on which you deployed your chain on (not recommended though). ## Creating a connection Once you have your chain configured on your relayer, follow these steps to send tokens between the chains: ```bash # Add destination chain # do it either individually... rly ch a -f destination-chain.json # or add multiple chains in folder at once rly chains add-dir ~/<chains-folder>/ # ensure the light clients are created locally... rly light init {{src_chain_id}} -f rly l i {{dst_chain_id}} -f # ensure each chain has its appropriate key... rly keys add {{src_chain_id}} rly k a {{dst_chain_id}} # ensure you have funds on both chains... # this adds tokens to your addresses from each chain's faucet rly testnets request {{src_chain_id}} rly tst req {{dst_chain_id}} # either manually add a path by following the prompts... rly paths add {{src_chain_id}} {{dst_chain_id}} {{path_name}} # or run below two commands with replacing json values with your chain values $ echo "{\"src\":{\"chain-id\":\"{{src_chain_id}}\",\"port-id\":\"transfer\",\"order\":\"unordered\",\"version\":\"ics20-1\"},\"dst\":{\"chain-id\":\"{{dst_chain_id}}\",\"port-id\":\"transfer\",\"order\":\"unordered\",\"version\":\"ics20-1\"},\"strategy\":{\"type\":\"naive\"}}" > {{path_name}}.json $ rly pth add {{src_chain_id}} {{dst_chain_id}} {{path_name}} -f {{path_name}}.json # create connections and channels to the path rly tx link {{path_name}} # then send some funds back and forth! rly q bal {{src_chain_id}} rly q bal {{dst_chain_id}} rly tx transfer {{src_chain_id}} {{dst_chain_id}} {{amount}} $(rly ch addr {{dst_chain_id}}) # check balance again rly q bal {{src_chain_id}} rly q bal {{dst_chain_id # relay packets to complete tokens transfer rly tx relay-packets {{path_name}} rly q bal {{src_chain_id}} rly q bal {{dst_chain_id}} ``` ## Test relayer between regen-devnet-4 and aplikigo-1 Here, we will consider `regen-devnet-4` chain as source chain and `aplikigo-1` chain as destination chain. ```bash # init relayer config rly config init # Write regen-devnet-4 and aplikigo chains config to separate json files. # Note: Please change gas-prices value based on your rpc-node $ echo "{\"key\":\"testkey\",\"chain-id\":\"regen-devnet-4\",\"rpc-addr\":\"http://18.220.101.192:26657\",\"account-prefix\":\"regen:\",\"gas-adjustment\":1.5,\"gas-prices\":\"0.025uregen\",\"trusting-period\":\"336h\"}" > regen-devnet-4.json $ echo "{\"key\":\"testkey\",\"chain-id\":\"aplikigo-1\",\"rpc-addr\":\"http://public-rpc1.regen.vitwit.com:26657\",\"account-prefix\":\"regen:\",\"gas-adjustment\":1.5,\"gas-prices\":\"0.025utree\",\"trusting-period\":\"336h\"}" > aplikigo-1.json # Add above both chains to relayer # do it either individually... rly ch a -f regen-devnet-4.json rly ch a -f aplikigo-1.json # or add multiple chains at once by copying both json files into one folder rly chains add-dir ~/<chains-folder>/ # export source and destination chain-ids to variables export SRC=regen-devnet-4 export DST=aplikigo-1 export PTH=demo-path # ensure the light clients are created locally... rly light init $SRC -f rly l i $DST -f # ensure each chain has its appropriate key... # either add key by below command rly keys add $SRC rly keys add $DST # or restore key using mnemonic rly keys restore $SRC testkey "{{mnemonic-words}}" rly keys restore $DST testkey "{{mnemonic-words}}" # show key will return address of chain's default key i.e., testkey rly keys show $SRC rly keys show $DST # ensure you have funds on both chains... rly query bal $SRC rly query bal $DST # if there is no balance found, then request chain faucet for tokens to chain's addresses. # Next, Add path between chains # either manually add a path by following the prompts... rly paths add $SRC $DST $PTH # or run below two commands $ echo "{\"src\":{\"chain-id\":\"$SRC\",\"port-id\":\"transfer\",\"order\":\"unordered\",\"version\":\"ics20-1\"},\"dst\":{\"chain-id\":\"$DST\",\"port-id\":\"transfer\",\"order\":\"unordered\",\"version\":\"ics20-1\"},\"strategy\":{\"type\":\"naive\"}}" > $PTH.json $ rly pth add $SRC $DST $PTH -f $PTH.json # create connections and channels to the path rly tx link $PTH # then send some funds back and forth! rly q bal $SRC rly q bal $DST rly tx transfer $SRC $DST {{amount}} $(rly ch addr $DST) # check balance again rly q bal $SRC rly q bal {{dst_chain_id # relay packets to complete tokens transfer rly tx relay-packets $PTH -d rly q bal $SRC rly q bal $DST # You can send back ibc tokens from dst to src again rly tx transfer $DST $SRC {{amount}} $(rly ch addr $SRC)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully