Stargaze
  • Welcome
    • Coming from Ethereum?
    • Coming from Solana?
    • Coming from Coinbase or other exchange?
    • Coming from MANTRA?
  • Introduction
    • What is Stargaze?
    • Meet the Team
  • Core Apps
    • Launchpad
      • Minters
      • Whitelists
      • Minter and Whitelist Fees
    • Marketplace
      • Governance Parameters
    • Names
    • Live Auctions
    • Infinity Swap
      • How it works
      • Price Mechanics
      • Swap
      • Why use Infinity Swap
      • Infinity Swap Fees
      • Examples
    • DAO DAO
    • StarDEX
      • Navigating StarDEX
      • Swapping Tokens
      • Providing Liquidity
      • Pool Analytics & Metrics
      • Managing and Removing Liquidity
  • Creators
    • Launching a Collection on Stargaze
    • Collection Guidelines
    • Content Guidelines
    • Featured Projects
  • Creator Tools
    • Stargaze Studio
      • Create an NFT Collection
        • Upload Assets and Metadata
        • Configure Collection and Minting Details
        • Creating a Standard Collection
          • Upload Assets and Metadata
          • Configure Collection and Minting Details: Standard Collection
          • Whitelist and Royalty Options
        • Creating an Open/Limited Edition Collection
          • Upload Assets and Metadata
          • Configure Collection and Minting Details: OE/LE
          • Whitelist and Royalty Options
        • Creating a 1/1 Collection
          • Upload Assets and Metadata
          • Configure Collection Details: 1/1 Collection
          • Whitelist and Royalty Options
          • Adding Additional Tokens to a 1/1 Collection
        • Creating a Burn to Mint Collection
          • Upload Assets and Metadata
          • Configure Collection and Minting Details: Standard Collection
          • Whitelist and Royalty Options
      • Interact with a Collection
        • Execute Messages
        • Query Data
    • Launching an NFT project via CLI
      • 1. Setup a basic project
        • 1a. Need help?
      • 2. Configure your project
      • 3. Add assets and metadata
        • Pinata Upload
      • 4. Instantiate minter contract on testnet
      • 5. Whitelist
      • 6. Mint from your contract
      • 7. Query contract
      • 8. Testing your contract on testnet
      • 9. Launching on mainnet
        • 9a. Launching on mainnet with Keplr (optional)
    • Create a Multisig Wallet
      • Create a Multisig using Keplr
      • Create a Multisig using DAO DAO
      • Create a Multisig using CLI
    • Stargaze Studio Fees
  • Developers
    • CosmWasm Contracts
      • Contract Code IDs
      • Deploy to Testnet
      • Deploy to Mainnet
    • Stargaze API
    • Indexers
      • Constellations
      • SubQuery
    • Token Factory
    • Minting and Trading Denoms
  • Tokenomics
    • STARS Token
    • Fair Burn
    • Real Yield
    • Governance
  • Nodes & Validators
    • Getting Setup
    • Running a Full Node
    • Setting up Cosmovisor
    • Running a Validator
    • Configuring StateSync
    • Running a Relayer
    • Foundation Delegation Program
  • Extras
    • FAQ
    • Stargaze Assets
    • Ranking and Algorithms
Powered by GitBook
On this page
  • Explorers
  • Faucet
  • Endpoints
  • Building starsd binary
  • Deploying a contract
  • Deploying a contract through Stargaze Studio
  • Deploying a contract through CLI
  • Instantiating a contract
  1. Developers
  2. CosmWasm Contracts

Deploy to Testnet

PreviousContract Code IDsNextDeploy to Mainnet

Last updated 1 year ago

Explorers

Faucet

Endpoints

Building starsd binary

git clone git@github.com:public-awesome/stargaze.git
cd stargaze
make install

Deploying a contract

Stargaze testnet is permissionless and does not require a governance proposal to deploy new contracts. You may use Stargaze Studio web interface or the CLI to deploy new contracts

Deploying a contract through Stargaze Studio

1. Create a new wallet or import an existing one through the wallet extension on your browser

4. Upon successful deployment of your contract, a summary containing the code ID, transaction hash and other data will be displayed.

Deploying a contract through CLI

1. Create a stars address

starsd keys add testnet-key
- name: testnet-key
  type: local
  address: stars1e9rf2y807g32jv88j9ydpe7082rk9ck8w79xtz
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Aidseu5Pl9DYHGZpCE2CkqLckQ6KSgC5IJvLL1yc+lpo"}'
  mnemonic: ""

2. Request funds through the #faucet channel

3. Configure RPC endpoint and Chain ID

starsd config node https://rpc.elgafar-1.stargaze-apis.com:443
starsd config chain-id elgafar-1

4. Check your account has balance

starsd query bank balances [address]

5. Deploy a contract

starsd tx wasm store contract.wasm --from testnet-key --gas-prices 0.025ustars --gas-adjustment 1.7 --gas auto

After executing this transaction you will have a code id that you can use to instantiate the contract.

starsd q tx [hash] | jq 

# or use sed to return just the code_id

starsd q tx [hash] | sed -n 's/.*"key":"code_id","value":"\([^"]*\)".*/\1/p'

# or check the block explorer
https://testnet-explorer.publicawesome.dev/stargaze/tx/[hash]

Instantiating a contract

You may use the CLI to instantiate the deployed contract with the custom instantiation message the contract expects.

INSTANTIATE_MSG=$(cat <<EOF
{
  "contract_param": "something"
}
EOF
)

starsd tx wasm instantiate [code_id] $INSTANTIATE_MSG --label "StargazeContract" --admin [my-address] --from testnet-key --amount "100000000ustars" --gas-prices 0.025ustars --gas-adjustment 1.7 --gas auto

Join our and request tokens in the #faucet channel. You will need the developer role from #pick-a-role.

RPC:

LCD:

GRPC:

GRPC2 :

2. Request testnet STARS to the wallet address through the #faucet channel on Discord 3. Visit to deploy your contract on testnet

Discord
https://rpc.elgafar-1.stargaze-apis.com
https://rest.elgafar-1.stargaze-apis.com
http://grpc-1.elgafar-1.stargaze-apis.com:26660
http://grpc-2.elgafar-1.stargaze-apis.com:26660
https://studio.publicawesome.dev/contracts/upload/
Ping Wallet
Ping Explorer
Logo