> For the complete documentation index, see [llms.txt](https://luntra.gitbook.io/luntra-infrastructure/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luntra.gitbook.io/luntra-infrastructure/smart-contract-guide-using-foundry/deployment-to-luntra-infrastructure.md).

# Deployment to Luntra Infrastructure

### **Environment Setup**

Create `.env` file:

```sh
# .env
PRIVATE_KEY=your_private_key_here
LUNTRA_RPC_URL=https://luntra.rpc.caldera.xyz/http
```

Load environment variables:

```sh
source .env
```

### Deploy Contract

#### Method 1: Using Private Key

```sh
forge script script/Counter.s.sol:CounterScript \
  --rpc-url https://luntra.rpc.caldera.xyz/http \
  --private-key $PRIVATE_KEY \
  --broadcast
```

#### Method 2: Using Environment Variable

```sh
forge script script/Counter.s.sol:CounterScript \
  --rpc-url $LUNTRA_RPC_URL \
  --private-key $PRIVATE_KEY \
  --broadcast \
  --verify
```

#### Method 3: Using Named Network

```sh
forge script script/Counter.s.sol:CounterScript \
  --rpc-url luntra \
  --private-key $PRIVATE_KEY \
  --broadcast
```

### Interactive Deployment

```sh
# Deploy with confirmation prompts
forge script script/Counter.s.sol:CounterScript \
  --rpc-url luntra \
  --private-key $PRIVATE_KEY \
  --broadcast \
  --slow
```
