Cascadia
  • Welcome to Cascadia
    • Brand Guidelines
    • Official Links
  • Artificial Intelligence
    • Incentives
  • Developers
    • Addresses
    • CosmWasm
      • Smart Contracts
      • Install Requirements
      • Set your Environment
      • Optimization
      • Deployment
      • Multi-Chain Contracts
        • The Actor Model
      • CW1 Subkeys Contract
        • Guide
      • CW20 Base Contract
        • Guide
      • C721 Base Contract
        • Guide
      • Upload Contract
        • Create a WASM File
      • Sign and Verify
        • Guide
    • Solidity
      • Deployment
      • Verification
        • Block Explorer
        • Hardhat
  • Directory
    • Address
    • API
    • Applications
    • Explorer
    • Faucet
    • Genesis
    • Governance
    • GRPC
    • Guide
    • Peers
    • RPC
    • Snapshot
    • State Sync
    • Website
    • Websocket
  • Governance
    • Align
      • Cooldown Period
      • Functions
    • Off-Chain
    • On-Chain
      • Voting
    • Proposals
      • On-Chain Voting via CLI
      • Proposal (Example)
    • VeTokenomics
      • Model
      • Voting Power Calculation
    • Analytics
  • Network
    • ChainID & Address Prefix
    • Configuration
    • Consensus
    • Denomination
    • Distribution
      • Block Rewards
      • Gas Fees
    • ESG
    • Faucet
    • Modules
    • Parameters
    • Peers
  • Security
    • Disclosure Policy
    • Multisignature
  • Staking
    • Claim
    • Delegate
    • Manual
    • Redelegate
    • Undelegate
  • Use Cases
    • Business Development and Marketing
    • Consumer Relationship Management
  • Node
    • Cloud Platforms
      • Amazon Web Services
      • Google Cloud Platform
    • Snapshot
    • State-Sync
    • Upgrade
      • Automated
      • Manual
  • Validators
    • System Requirements
    • Installation
    • Reference
      • Customization
  • Community
    • Discord
    • Telegram
    • Twitter
  • Legal
    • Privacy Policy
    • Terms & Conditions
Powered by GitBook
On this page
Edit on GitHub
  1. Developers
  2. CosmWasm

Set your Environment

Before you start, you have to decide where you'll run and test your contracts:

Run Your Own Node This option lets you set up and run a node locally.

Connect to the Malaga Testnet The Malaga testnet is live for quick testing, allowing you to deploy and run your contracts. To ensure it's active, check:

https://rpc.malaga-420.cosmwasm.com/status
https://faucet.malaga-420.cosmwasm.com/status

Tokens on Testnet Andalucía (uand) - Used for validators. Málaga (umlg) - Used for paying fees.

Step 1: Choose an Interaction Tool

You have two primary tools for interacting with the testnet:

wasmd: A Go client.

Node REPL: This tool is recommended for contract operations.

Step 2: Setting Up wasmd Go CLI

Initialize the configuration of the network:

source <(curl -sSL https://raw.githubusercontent.com/CosmWasm/testnets/master/malaga-420/defaults.env)

Create wallet addresses by typing:

wasmd keys add wallet
wasmd keys add wallet2

Remember to safely store your mnemonic.

Credit Tokens

If you're using a local node, you can skip this step, otherwise:

JSON=$(jq -n --arg addr $(wasmd keys show -a wallet) '{"denom":"umlg","address":$addr}') && curl -X POST --header "Content-Type: application/json" --data "$JSON" https://faucet.malaga-420.cosmwasm.com/credit

JSON=$(jq -n --arg addr $(wasmd keys show -a wallet2) '{"denom":"umlg","address":$addr}') && curl -X POST --header "Content-Type: application/json" --data "$JSON" https://faucet.malaga-420.cosmwasm.com/credit

Configure wasmd

eexport NODE="--node $RPC"
export TXFLAG="${NODE} --chain-id ${CHAIN_ID} --gas-prices 0.25${FEE_DENOM} --gas auto --gas-adjustment 1.3"

Step 3: Setting Up the CosmJS CLI Client

Prerequisites

You'll need Node.js (v12+) and npx.

Initialize CosmJS CLI

npx @cosmjs/cli@^0.28.1 --init https://raw.githubusercontent.com/InterWasm/cw-plus-helpers/main/base.ts --init https://raw.githubusercontent.com/InterWasm/cw-plus-helpers/main/cw20-base.ts

Contract Interactions

const [address, client] = await useOptions(malagaOptions).setup("password",".new.key");
client.getAccount(address);
client.getBalance(address,"umlg");
PreviousInstall RequirementsNextOptimization

Last updated 1 year ago