Initia (Closed Testnet)
  • Reminder
    • ⛔Confidentiality Disclaimer
  • WELCOME TO CLOSED TESTNET
    • Welcome to Closed Testnet
  • About Initia
    • What is the Initia Platform?
      • Architecture
        • Layer 1
        • Layer 2
      • Aligning Initia (coming soon!)
    • InitiaDEX
    • Enshrined Liquidity and Staking
  • Developers
    • Initiad
      • Download Initiad
      • Using Initiad
    • Get INIT token
    • Build your own Minitia
      • Simple Minitia Setup
      • Connect Minitia to L1
        • OPinit Stack
          • OPinit Module
          • OPinit Bots
        • Relayer
          • Fetching Oracle Prices
    • Virtual Machines
      • MoveVM
        • Interact with CLI
      • WasmVM
    • Contracts
      • Move Contracts
      • CosmWasm Contracts
      • EVM Contracts (Coming Soon)
    • Oracles
  • Initia Developer Tutorials
    • 1. Create account
    • 2. Send Move coin
    • 3. Interchain Message
    • 4. Create your own Move coin
    • 5. Create your own Move NFT
    • 6. Build and Publish Contracts
      • Move Module
      • CosmWasm Contract
  • Core Applications
    • Core Applications
      • Wallet
      • Initia App
      • Usernames
      • Initia Scan
  • Node Operators
    • Running Initia Node
      • Prerequisites
      • Oracle
      • Boot an Initia Node
      • Connect to Initia Network
      • Cosmovisor Guide
    • Configuring Initia Validator
  • References and Tools
    • Move Language
    • Rust Language (CosmWasm)
    • Closed Testnet Chain Information
    • Chain Parameters
    • Initia.js
    • API Docs
    • API Docs (minimove)
    • API Docs (miniwasm)
    • Whitelisted Tokens and Pairs
Powered by GitBook
On this page
  • Create fetchprice Channel
  • Update Chain Params
  1. Developers
  2. Build your own Minitia
  3. Connect Minitia to L1
  4. Relayer

Fetching Oracle Prices

Create fetchprice Channel

# create channel with clients and connections
# tooks 5 minutes (send any tx to boost)
hermes create channel \
  --a-chain $L2_CHAIN_ID \
  --b-chain $L1_CHAIN_ID \
  --a-port fetchprice \
  --b-port icqhost \
  --new-client-connection 
  
SUCCESS Channel {
    ...
}

Update Chain Params

Create message.json.

Normally the fetch price channel id is channel-1 if you followed the tutorial, else you have to change messages[2][source_channel] to proper channel id.

{
  "messages": [
    {
      "@type": "/slinky.oracle.v1.MsgAddCurrencyPairs",
      "authority": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne",
      "currency_pairs":[{"Base": "BITCOIN","Quote": "USD"}, {"Base": "ETHEREUM", "Quote": "USD"}]
    },
    {
      "@type": "/ibc.applications.fetchprice.v1.MsgUpdateParams",
      "authority": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne",
      "params": {
        "fetch_enabled": true,
        "fetch_activated": false,
        "timeout_duration": "30s"
      }
    },
    {
      "@type": "/ibc.applications.fetchprice.v1.MsgActivate",
      "authority": "init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne",
      "source_port": "fetchprice",
      "source_channel": "channel-1",
      "timeout_duration": "30s"
    }
  ]
}

Execute messages.json with validator key

minitiad tx opchild execute-messages \
    ./messages.json \
    --from operator \
    --chain-id $L2_CHAIN_ID
    --gas auto
    --gas-adjustment 1.4
    --gas-price 0.15$DENOM

Check Prices

minitiad q oracle price BITCOIN USD
PreviousRelayerNextVirtual Machines

Last updated 1 year ago