This guide will help you quickly set up your development environment and start building on Neutron. You’ll learn how to set up dependencies, run a local environment, and deploy your first smart contract.
New to Neutron development? We recommend starting with our Onboarding Tutorial Series which provides a comprehensive, step-by-step introduction to building on Neutron.

Environment Setup

1

Install Required Dependencies

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
rustup default stable
rustup target add wasm32-unknown-unknown

# Install Go
wget https://go.dev/dl/go1.23.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.23.1.linux-amd64.tar.gz
echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> ~/.bashrc
source ~/.bashrc

# Verify installations
rustc --version
go version
Make sure to adjust the Go version and paths based on your operating system if needed.
2

Clone and Build Neutron

# Clone the Neutron repository
git clone https://github.com/neutron-org/neutron.git
cd neutron

# Build the neutrond binary
make install

# Verify installation
neutrond version

Cosmopark Development Environment

Cosmopark provides a complete local development environment with interconnected Neutron and Gaia nodes, IBC relayers, and everything you need to start developing cross-chain applications.
1

Clone Required Repositories

# Create a workspace directory
mkdir neutron-dev && cd neutron-dev

# Clone repositories in the same parent directory
git clone -b main https://github.com/neutron-org/neutron.git
git clone https://github.com/neutron-org/neutron-integration-tests.git
git clone https://github.com/neutron-org/neutron-query-relayer.git
git clone https://github.com/cosmos/gaia.git

# Checkout specific Gaia version
cd gaia
git checkout v23.1.1
cd ..
2

Build Docker Images

cd neutron-integration-tests/setup
make build-all

# Download Neutron DAO contracts
npx @neutron-org/get-artifacts neutron-dao -b main -d contracts
3

Start Cosmopark

# Start the local development environment
make start-cosmopark

# View logs
docker-compose logs -f
The first time you run Cosmopark, it will take a few minutes to set up all the components.
4

Use Predefined Accounts

Cosmopark creates several test accounts with tokens for both Neutron and Gaia chains:
# Neutron Accounts
- neutron1m9l358xunhhwds0568za49mzhvuxx9ux8xafx2 (demowallet1)
- neutron10h9stc5v6ntgeygf5xf945njqq5h32r5r2HWFc (demowallet2)

# Gaia Accounts
- cosmos10h9stc5v6ntgeygf5xf945njqq5h32r54ef7kt (demowallet2)
- cosmos1m9l358xunhhwds0568za49mzhvuxx9uxre5tgh (demowallet1)
The mnemonics for these accounts are available in the Cosmopark documentation.
For a comprehensive guide to setting up your development environment with Cosmopark, check out our Cosmopark Tutorial.

Create and Deploy a CosmWasm Smart Contract

1

Initialize a New CosmWasm Project

# Generate a new CosmWasm project using the template
cargo generate --git https://github.com/CosmWasm/cw-template.git --name my-neutron-contract
cd my-neutron-contract
2

Build Your Contract

# Compile the contract to Wasm
cargo wasm

# Optimize the Wasm binary (requires Docker)
docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/rust-optimizer:0.12.13
This will produce an optimized Wasm file in the artifacts directory.
3

Deploy to Cosmopark

With Cosmopark running, you can deploy your contract to the local Neutron network:
# Store the contract on Neutron
neutrond tx wasm store artifacts/my_neutron_contract.wasm \
  --from demowallet1 \
  --chain-id neutron-testing-1 \
  --gas auto \
  --gas-adjustment 1.3 \
  --node http://localhost:26657 \
  --yes

# Get the code ID
neutrond query wasm list-code --node http://localhost:26657

# Instantiate the contract (replace CODE_ID with the actual code ID)
neutrond tx wasm instantiate CODE_ID '{"count": 0}' \
  --from demowallet1 \
  --label "my first contract" \
  --chain-id neutron-testing-1 \
  --gas auto \
  --gas-adjustment 1.3 \
  --node http://localhost:26657 \
  --yes
4

Interact with Your Contract

# Query the contract state
neutrond query wasm contract-state smart CONTRACT_ADDRESS '{"get_count": {}}' \
  --node http://localhost:26657

# Execute a contract function
neutrond tx wasm execute CONTRACT_ADDRESS '{"increment": {}}' \
  --from demowallet1 \
  --chain-id neutron-testing-1 \
  --gas auto \
  --gas-adjustment 1.3 \
  --node http://localhost:26657 \
  --yes
Replace CONTRACT_ADDRESS with your actual contract address.

Interchain Development with Neutron

One of Neutron’s most powerful features is the ability to query and interact with other blockchains. Here’s a quick example using Interchain Queries (ICQ):
// In your contract's execute function
pub fn execute_icq_query(
    deps: DepsMut,
    env: Env,
    connection_id: String,
) -> Result<Response, ContractError> {
    // Create an ICQ request to query account balance on Cosmos Hub
    let icq_msg = NeutronMsg::RegisterInterchainQuery {
        query_type: QueryType::KV {
            connection_id,
            keys: vec![Key {
                path: "bank/balances/cosmos1m9l358xunhhwds0568za49mzhvuxx9uxre5tgh".to_string(),
                key: Binary::from(b"denom_key"),
            }],
        },
        transactions_filter: TransactionsFilterType::None,
        update_period: 10,
    };

    // Return the message in the response
    Ok(Response::new()
        .add_message(icq_msg)
        .add_attribute("action", "register_icq"))
}

Development Tools

Structured Learning Path

What’s Next?

Need help? Join our Discord server and check out the #developers channel for support from the Neutron team and community.