# Localnet

The Real Localnet, officially named REAL, is a local development environment for the Real blockchain, a decentralized Layer 1 (L1) network focused on tokenizing real-world assets (RWAs) for small and medium enterprises (SMEs). This page explains what the REAL Localnet is, its purpose, and how developers can use it to build and test applications on Real.

***

## What is the REAL Localnet?

The REAL Localnet is a private, single-node instance of the Real blockchain that runs on your local machine. Built using the Cosmos SDK, the REAL Localnet replicates the core functionality of the Real Mainnet and Testnet, including its Tendermint-based Proof-of-Stake consensus, smart contract execution via CosmWasm, and RWA tokenization features. Unlike the Mainnet or Testnet, the Localnet operates in isolation, allowing developers to experiment in a controlled environment without connecting to the live network.

### Key Features of the REAL Localnet

* **Isolated Environment:** Runs on your local machine, ensuring complete privacy and control for testing.
* **Full Functionality:** Mimics the REAL Mainnet’s features, including transaction processing, staking, and smart contract execution.
* **Fast Setup:** Quickly deploy a local blockchain for rapid development and iteration.
* **No Network Dependency:** Operates without internet access once set up, ideal for offline development or testing edge cases.

### What is the REAL Localnet Used For?

The REAL Localnet is designed primarily for developers building on the Real blockchain. It provides a sandbox environment to test and debug applications before deploying them to the REAL Testnet or Mainnet.

#### Common Use Cases

* **Smart Contract Development:** Write, compile, and deploy smart contracts using CosmWasm, then test their functionality locally. For example, you can simulate tokenizing an RWA (e.g., a piece of real estate) and verify the contract’s behavior.
* **dApp Testing:** Build and test decentralized applications (dApps) that interact with the Real blockchain, such as RWA marketplaces or DeFi protocols, without risking real $ASSET tokens.
* **Consensus and Staking Experiments:** Simulate staking $ASSET tokens, validator operations, and governance proposals to understand how Real’s Tendermint-based consensus works.
* **Protocol Development:** Test custom modules or protocol changes (e.g., new tokenization standards) before proposing them via governance on the Mainnet.
* **Debugging and Optimization:** Identify and fix issues in a controlled environment, ensuring your application is ready for the Testnet or Mainnet.

#### Benefits of Using the REAL Localnet

* **Speed:** Local execution is faster than interacting with a live network, allowing for rapid iteration.
* **Cost-Free:** No real $ASSET tokens are needed, as the Localnet uses pre-funded test accounts.
* **Control:** You can reset or modify the Localnet at any time to test different scenarios (e.g., changing block times, simulating network upgrades).
* **Safety:** Mistakes or bugs won’t affect the live network, making it a safe space for experimentation.

## Getting Started with the REAL Localnet

### Step 1: Set Up Your Environment

1. **Install Prerequisites:**
   * **Go:** Install Go (version 1.18 or later) by following the [official Go installation guide](https://golang.org/doc/install).
   * **Rust:** Install Rust for CosmWasm smart contracts by following the [Rust installation guide](https://www.rust-lang.org/tools/install).
   * **Real CLI:** Download and install the Real CLI (`reald`) from our [Downloads page](https://www.realfin.io/downloads).
2. **Clone the Real Repository:**

Clone the Real blockchain source code from our GitHub repository:

```
git clone https://github.com/realfinance/real.git
cd real
```

3. **Build the Real Daemon:**

Compile the `reald` binary:

```
make install
```

This installs `reald` to your `$GOPATH/bin` directory. Ensure `$GOPATH/bin` is in your system’s PATH.

### Step 2: Initialize the REAL Localnet

1. **Set Up a Local Node:**

Initialize a new Localnet instance with a single validator node:

```
reald init my-localnet --chain-id real-localnet-1
```

This creates a local configuration in `~/.reald` with pre-funded test accounts.

2. **Add a Genesis Account:**

Add a test account to the genesis file for funding:

```
reald keys add my-account
reald add-genesis-account $(reald keys show my-account -a) 1000000000ureal
```

This gives `my-account` 1,000,000,000 test $ASSET tokens.

3. **Create a Genesis Transaction:**

Generate a genesis transaction for the validator:

```
reald gentx my-account 1000000ureal --chain-id real-localnet-1
reald collect-gentxs
```

### Step 3: Start the REAL Localnet

1. **Launch the Localnet:**

Start your local node:

```
reald start
```

This runs the REAL Localnet on your machine, with a local RPC endpoint at `http://localhost:26657`.

2. **Verify It’s Running:**

Check the node status:

```
reald status
```

You should see the node syncing and producing blocks.

### Step 4: Interact with the REAL Localnet

1. **Deploy a Smart Contract:**

Write and deploy a smart contract using CosmWasm. Follow our [Tutorials](https://docs.realfin.io/tutorials) for a step-by-step guide. Example command to deploy a contract:

```
reald tx wasm store my_contract.wasm --from my-account --chain-id real-localnet-1 --gas auto --fees 5000ureal
```

2. **Test RWA Tokenization:**

Simulate tokenizing a test RWA by interacting with a smart contract or using a local version of the Real platform.

3. **Experiment with Staking:**

Delegate test **$ASSET** tokens to your local validator:

```
reald tx staking delegate $(reald keys show my-account -a --bech val) 500000ureal --from my-account --chain-id real-localnet-1 --gas auto --fees 5000ureal
```

### Step 5: Reset or Modify the Localnet

To reset your Localnet for a fresh start:

```
reald unsafe-reset-all
```

You can also modify the genesis file (`~/.reald/config/genesis.json`) to adjust parameters like block time or initial token supply, then restart the node.Transitioning to Testnet and MainnetOnce you’ve tested your application on the REAL Localnet, you can deploy it to the [REAL Testnet](https://docs.realfin.io/testnet) for broader testing with other users, and eventually to the [REAL Mainnet](https://docs.realfin.io/mainnet) for production use.

### Need Help?

If you have questions about setting up or using the REAL Localnet, reach out to our team:

* Email: <team@real.finance>
* X:@[RealFinOfficial](https://x.com/RealFinOfficial)
* Telegram: [t.me/RealFinanceRWA](https://t.me/RealFinanceRWA)

The REAL Localnet is your private playground for building the future of RWA tokenization. Start experimenting today!

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://realfinance.gitbook.io/docs/networks/localnet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
