Junø
WebDiscordGithubTwitter
  • Juno
    • Intro
    • Home of CosmWasm
    • Contributors - Core Software
    • Brand Identity
    • Security Disclosures
    • Economic Overview
      • Disclaimer
      • Native Asset (JUNO)
      • Incentive structure
      • Supply API - Data
  • Developer Guides
    • CosmWasm Contracts
      • Compile a Contract
      • Deploy a Contract
      • Guide: How to Upload a Smart Contract on the Juno Chain
      • Use Cw-orchestrator to speed-up your development
      • Query A Contract
      • Send Tokens to a Contract
    • Miscellaneous
      • Conversions
      • Multi Message Transaction
      • Get & Decode Transactions
      • Get Token Prices
      • Get Account Transactions
      • IBC Transfer
      • State Export / Airdrop
    • Juno Modules
      • FeeShare
      • TokenFactory
    • API Endpoints
      • Cosmos
        • Tx
          • V1beta1
            • Simulate
            • Txs
              • Block
        • Params
          • V1beta1
            • Params
        • Bank
          • V1beta1
            • Balances
              • By denom
            • Denoms metadata
            • Params
            • Spendable balances
            • Supply
        • Upgrade
          • V1beta1
            • Applied plan
            • Current plan
            • Module versions
            • Upgraded consensus state
        • Auth
          • V1beta1
            • Accounts
            • Module accounts
            • Params
        • Staking
          • V1beta1
            • Delegations
            • Historical info
            • Params
            • Pool
            • Validators
              • Delegations
                • Unbonding delegation
              • Unbonding delegations
            • Delegators
              • Redelegations
              • Unbonding delegations
              • Validators
        • Evidence
          • V1beta1
            • Evidence
        • Mint
          • V1beta1
            • Annual provisions
            • Inflation
            • Params
        • Feegrant
          • V1beta1
            • Allowance
            • Allowances
            • Issued
        • Gov
          • V1beta1
            • Params
            • Proposals
              • Deposits
              • Tally
              • Votes
        • Distribution
          • V1beta1
            • Community pool
            • Params
            • Delegators
              • Rewards
              • Validators
              • Withdraw address
            • Validators
              • Commission
              • Outstanding rewards
              • Slashes
        • Slashing
          • V1beta1
            • Params
            • Signing infos
        • Authz
          • V1beta1
            • Grants
              • Grantee
              • Granter
        • Base
          • Tendermint
            • V1beta1
              • Blocks
                • Latest
              • Node info
              • Syncing
              • Validatorsets
                • Latest
          • Node
            • V1beta1
              • Config
      • Cosmwasm
        • Wasm
          • V1
            • Code
              • Contracts
            • Contract
              • History
              • Raw
              • Smart
              • State
            • Codes
              • Params
              • Pinned
            • Contracts
              • Creator
      • Juno
        • Feeshare
          • V1
            • Fee shares
            • Params
        • Tokenfactory
          • V1beta1
            • Denoms from creator
            • Params
            • Denoms
              • Authority metadata
      • Ibc
        • Apps
          • Router
            • V1
              • Params
      • API Specification
    • Local Interchain
      • Local Interchain Rust Example
    • Junod Local Dev Setup
    • Integrate Leap wallet
    • SubQuery Indexer
  • Governance
    • Before submitting a proposal
    • Submitting a Proposal (CLI)
      • Formatting Proposal Markdown
  • Command-Line Interface (CLI)
    • Introduction
    • Useful CLI Commands
    • Module Reference
      • bank
      • distribution
      • gov
      • keys
      • params
      • slashing
      • staking
      • status
      • tendermint
      • upgrade
      • wasm
  • Nodes & Validators
    • Junod Installation and setup
    • Setting up Cosmovisor
    • Mainnet Setup and Tooling
    • Joining Mainnet
      • Sync from Snapshot
      • Sync with state-sync
      • Mainnet Upgrades
    • Joining Testnet
    • Relaying
    • Juno Delegations Program
Powered by GitBook
On this page
  • Step-by-Step Guide to Running Rust Cosm Wasm Contracts in GitHub Workflow
  • Step 1: Set Up Your Project
  • Step 2: Organize Your Project
  • Step 3: Create an Interchange Test Folder
  • Step 4: Define Chain Configuration
  • Step 5: Use Environment Variables
  • Step 6: Configure Relayer and Server (Optional)
  • Step 7: Write Your Tests
  • Step 8: Set Up GitHub Workflow
  • Step 9: Define GitHub Workflow Actions
  • Step 10: Workflow Completion

Was this helpful?

  1. Developer Guides
  2. Local Interchain

Local Interchain Rust Example

Learn how to seamlessly integrate Rust CosmWasm contracts into your GitHub workflow. Follow our step-by-step guide to set up your project, configure chain parameters, write tests, and automate.

PreviousLocal InterchainNextJunod Local Dev Setup

Last updated 1 year ago

Was this helpful?

Step-by-Step Guide to Running Rust Cosm Wasm Contracts in GitHub Workflow

Prerequisites:

  1. Make sure you have Rust and CosmWasm contract development environment set up on your local machine.

  2. Create a GitHub repository where you want to host your Rust CosmWasm contract project.

Step 1: Set Up Your Project

  • Clone or create a new GitHub repository for your Rust CosmWasm contract project.

Step 2: Organize Your Project

  • Inside your project, create a source folder. This folder will contain your standard CosmWasm contract with messages (e.g., increment and reset).

Step 3: Create an Interchange Test Folder

  • Within your project, create an interchain-test folder. This folder will be used to set up tests for your contract.

Step 4: Define Chain Configuration

  • Determine the configuration you want for your blockchain. Define the necessary configuration settings, such as the chain parameters, and consider any startup commands required.

Step 5: Use Environment Variables

  • Abstract away some of the configuration requirements into environment variables. This allows you to specify different configurations for different chains without much hassle.

Step 6: Configure Relayer and Server (Optional)

  • If needed, configure the relayer and server settings for your project. This step may not be necessary for all users.

Step 7: Write Your Tests

  • Within the interchain-test folder, write the tests you want to perform on your CosmWasm contract. This could include instantiation, querying, and incrementing the contract's state.

Step 8: Set Up GitHub Workflow

  • In your GitHub repository, create an .github/workflows directory if it doesn't already exist.

  • Inside the .github/workflows directory, create an end-to-end.yml file. This workflow file will trigger when a pull request or push happens to specific branches.

Step 9: Define GitHub Workflow Actions

  • In the end-to-end.yml workflow file, define the following actions:

    • Download the interchain test.

    • Set up and automatically install the interchain binary.

    • Run your contract tests. You can run any tests you want, including uploading the wasm file and starting your contract on a specific port.

    • Ensure that the tests pass without errors.

Step 10: Workflow Completion

  • If all the tests have passed without any issues, the GitHub workflow will automatically kill the contract instance, exit out, and mark the entire workflow as completed.

Conclusion:

Following this step-by-step guide, you can set up and run Rust CosmWasm contracts in a GitHub workflow using the local interchain tool. This ensures that your contract works in both local and GitHub environments, providing convenience and reliability for your project development and testing.