strai.io
strai.ioTelegramTwitterGitHub
  • Overview
  • AI Compute Engine
  • Whitepaper
  • Getting Started
    • Install Prerequisites
      • Setting Up Dev Environment
      • Compiling a Contract
  • Deployment and Interaction
  • Claimdrop Contract
  • Incubator Program
  • Smart Contracts
  • Terms and Conditions
  • Audits
  • Staking Rewards
Powered by GitBook
On this page
  • Setting up environment variables
  • Setup wallet addresses
  • Request tokens
  1. Getting Started
  2. Install Prerequisites

Setting Up Dev Environment

You would need an environment to run contracts. You can either run your node locally or connect to an existing network.

For easy testing, the STRAI Testnet is live. You can use Testnet to deploy and run your contracts.

To verify that the network is currently active, make sure the following URLs are working for you:

  • RPC Endpoints

  • Faucet

The network has one native token set up for becoming a validator and for paying fees.

The official STRAI Chain (Testnet) Block Explorer is TBA

You can use the block explorer to explore transactions, addresses, validators and contracts.

When interacting with Testnet, you can either use wasmd which is a Go client, or the Node REPL. The Node REPL is recommended for contract operations, since JSON manipulation is not intuitive with the Shell/Go client.

Setting up environment variables

Let's configure the straichaind executable, point it to the TestNet network, create a wallet and ask for tokens from faucet:

First, create a file called straichaind-cli.env :

export CHAIN_ID="strai-testnet-1"
export TESTNET_NAME="strai-testnet"
export DENOM="uom"
export BECH32_HRP="wasm"
export WASMD_VERSION="v0.53.0"
export CONFIG_DIR=".straichaind"
export BINARY="straichaind"
export COSMJS_VERSION="v0.28.1"
export GENESIS_URL="https://<location-to-be-provided>/config/genesis.json"
export RPC="<https://rpc.testnet.straichain.io:443>"
export FAUCET="<https://faucet.testnet.straichain.io>"

# If you are using the bash terminal (usually Windows/Linux) add the following lines:
export NODE="--node $RPC"
export TXFLAG="$NODE --chain-id $CHAIN_ID --gas-prices 0.01$DENOM --gas auto --gas-adjustment 1.5"

# Otherwise, if you are using zsh terminal (usually MacOS) add the following lines instead: 
export NODE=(--node $RPC)
export TXFLAG=($NODE --chain-id $CHAIN_ID --gas-prices 0.01$DENOM --gas auto --gas-adjustment 1.5)

Save the above and then source it to set the environment variables.

source straichaind-cli.env

We'll use these environment variables later.

Setup wallet addresses

Set up wallets with addresses for storing tokens.

# add wallets for testing
straichaind keys add wallet
straichaind keys add wallet2

Running the command above will add two encrypted private keys to the straichaind keyring and display their attributes as follows:

- address: strai188xl62zf0hdscf47zyf6ajz9x4ym0v90h9whrx
  name: wallet
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AiFGNfxnlXj0Uos/3G918Pdzsq4CBg1c0RXrxRh8lCyM"}'
  type: local

**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

truth quarter rack west trouble suffer grief path patch come mushroom more improve gallery moral recipe error abandon modify drop vague holiday upset open

It is the only way to recover your account if you ever forget your password.

truth quarter rack west trouble suffer grief path patch come mushroom more improve gallery moral recipe error abandon modify drop vague holiday upset open


Request tokens

You will need some STRAI test tokens stored in your wallet address in order to interact with the network. In order to get testnet tokens please request faucets at STRAI Discord Server.

The faucet will issue tokens to one wallet address only once within a single 24 hour period, and only once for any wallet address from the one IP address within a single 24 hour period. This is to limit the faucet from being drained of tokens and to maintain the integrity of the

PreviousInstall PrerequisitesNextCompiling a Contract

Last updated 7 months ago