> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stablenet.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect to StableNet

> Set up your wallet and development environment for StableNet Testnet.

> Set up your wallet and configure your RPC environment for StableNet Testnet in under 5 minutes.

<Info>
  StableNet is currently in testnet. Network details may change before mainnet launch.
</Info>

## Network details

|                      | Value                                                            |
| -------------------- | ---------------------------------------------------------------- |
| **Chain ID**         | `8283`                                                           |
| **RPC endpoint**     | `https://api.test.stablenet.network`                             |
| **Explorer**         | [explorer.stablenet.network](https://explorer.stablenet.network) |
| **Faucet**           | [faucet.stablenet.network](https://faucet.stablenet.network)     |
| **Native gas token** | WKRC (KRW-pegged, 18 decimals)                                   |
| **Minimum gas tip**  | 27,600 Gwei                                                      |

## Add to MetaMask

Run this in your browser console to add StableNet Testnet to MetaMask automatically:

```javascript theme={null}
await window.ethereum.request({
  method: "wallet_addEthereumChain",
  params: [{
    chainId: "0x205B",
    chainName: "StableNet Testnet",
    nativeCurrency: { name: "WKRC", symbol: "WKRC", decimals: 18 },
    rpcUrls: ["https://api.test.stablenet.network"],
    blockExplorerUrls: ["https://explorer.stablenet.network"],
  }],
});
```

Or add manually: **MetaMask → Settings → Networks → Add network manually** and enter the values from the table above.

## Get testnet WKRC

Visit [faucet.stablenet.network](https://faucet.stablenet.network), enter your wallet address, and receive testnet WKRC. The faucet sends enough to cover many transactions.

## Verify your connection

Confirm the RPC endpoint is live:

```shell theme={null}
curl -X POST https://api.test.stablenet.network \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'
```

```text theme={null}
{"jsonrpc":"2.0","id":1,"result":"0x132d3"}
```

A hex block number in the `result` field means you're connected. Then confirm your WKRC balance on the [Explorer](https://explorer.stablenet.network).

## Configure for development

Add the RPC URL to your project environment:

```ini theme={null}
# .env
STABLENET_RPC_URL="https://api.test.stablenet.network"
STABLENET_CHAIN_ID=8283
```

<Tip>
  Never commit your `.env` file to version control. Add `.env` to `.gitignore`.
</Tip>

**ethers.js**

```typescript theme={null}
import { ethers } from "ethers";

const provider = new ethers.JsonRpcProvider(
  "https://api.test.stablenet.network"
);
const blockNumber = await provider.getBlockNumber();
```

**viem**

```typescript theme={null}
import { createPublicClient, http } from "viem";
import { defineChain } from "viem";

const stablenet = defineChain({
  id: 8283,
  name: "StableNet Testnet",
  nativeCurrency: { name: "WKRC", symbol: "WKRC", decimals: 18 },
  rpcUrls: { default: { http: ["https://api.test.stablenet.network"] } },
  blockExplorers: {
    default: { name: "Explorer", url: "https://explorer.stablenet.network" },
  },
});

const client = createPublicClient({ chain: stablenet, transport: http() });
```

**Foundry**

```ini theme={null}
# foundry.toml
[profile.default]
eth_rpc_url = "https://api.test.stablenet.network"
```

## Next steps

<CardGroup cols={2}>
  <Card title="Send Your First Transaction" href="/en/v0.3/build/quickstart/send-your-first-tx">
    Send WKRC and interact with the network.
  </Card>

  <Card title="Deploy a Contract" href="/en/v0.3/build/tutorials/deploy-with-foundry">
    Deploy a Solidity contract using Foundry.
  </Card>
</CardGroup>
