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

# Quick Start

> Deploy a private Edge Compute function and request it by name from a laptop on a WireGuard VPN.

This guide connects a laptop to a [*Network*](https://developers.telnyx.com/docs/network/overview.md) over WireGuard, deploys a private function on the same *Network*, and requests the function by its private name.

## Requirements

* `telnyx-edge` v0.5.17 or later, authenticated with an API key
* A laptop with WireGuard installed

## Create the *Network*

```bash theme={null}
telnyx-edge network create pi-demo
```

```text theme={null}
Created network pi-demo (abd91c8d-579b-4f1f-9937-02165749de20)
```

## Create the WireGuard Interface

`telnyx-edge network regions --service cloud_vpn` lists the regions that offer WireGuard Interfaces. Create one in `ashburn-va` and wait until it is provisioned:

```bash theme={null}
telnyx-edge network interface create pi-demo --region ashburn-va --wait
```

```text theme={null}
Created WireGuard Interface pi-demo-ashburn-va (3805266d-b535-419b-ac6e-baeb4199e074) in ashburn-va, status provisioning
Waiting up to 30m0s for 3805266d-b535-419b-ac6e-baeb4199e074 to provision...
  status: provisioned

Bind a function to it in telnyx.toml:

[network.PI_DEMO]
id = "3805266d-b535-419b-ac6e-baeb4199e074"
```

The printed `id` is the WireGuard Interface UUID the function binding needs.

## Add a DNS Resolver

The DNS resolver answers the private names of functions on the *Network*. Create it in the same region and wait until it is provisioned:

```bash theme={null}
telnyx-edge network dns create pi-demo --region ashburn-va --wait
```

The command prints the resolver's address on the *Network*, `172.27.240.14`, once it is provisioned.

## Create the Function

```bash theme={null}
telnyx-edge new-func -l js -n internal-api
cd internal-api
```

Add `private = true` to the `[edge_compute]` block of `func.toml`, and add the binding the interface command printed, with `peer = false` and `ingress = true`:

```toml theme={null}
[edge_compute]
func_id = "5aca61c5-4010-4edc-8f88-554e06372194"
func_name = "internal-api"
private = true

[network.PI_DEMO]
id = "3805266d-b535-419b-ac6e-baeb4199e074"
peer = false
ingress = true
```

[Function Settings](https://developers.telnyx.com/docs/edge-compute/private-ingress/how-it-works/settings.md) explains each setting.

## Ship

```bash theme={null}
telnyx-edge ship
```

```text theme={null}
...
✅ Func 'internal-api' is now deployed! (shipped in 5m51s)

🔒 Public access is off (private = true).

🔒 Private access (from your network):
   Address:         172.27.0.2
   Host:            internal-api-5aca61c5-4.private.telnyxcompute.com
   WireGuard peer:  fddb82c9-b6d9-435a-82e8-b68fcd510827 (interface 3805266d-b535-419b-ac6e-baeb4199e074)
   Status:          active
...
```

`Host` is the function's private name. `Address` is the ingress it sits behind.

## Connect the Laptop

Add the laptop as a WireGuard peer. The command writes a ready-to-use configuration with the private key filled in:

```bash theme={null}
telnyx-edge network peer create pi-demo-ashburn-va laptop
```

```text theme={null}
Created WireGuard peer laptop (9cf08232-b50c-4d20-a94a-755f1323e410) on interface 3805266d-b535-419b-ac6e-baeb4199e074
Wrote laptop.conf (mode 0600)
Connect with: wg-quick up ./laptop.conf
```

```ini theme={null}
[Interface]
PrivateKey = ...
Address = 172.27.0.3/32
DNS = 172.27.240.14

[Peer]
PublicKey = LYqat7Pcivwc3AQfj6INfZ5PXT2n8KTLzIfnAY9/fnQ=
AllowedIPs = 172.27.0.0/24, 172.27.240.14/32
Endpoint = 64.16.243.3:5167
PersistentKeepalive = 1
```

`DNS` points the laptop at the resolver while the tunnel is up. `AllowedIPs` routes the interface subnet and the resolver through the tunnel.

Bring up the tunnel:

```bash theme={null}
sudo wg-quick up ./laptop.conf
```

## Request the Function by Name

```bash theme={null}
curl http://internal-api-5aca61c5-4.private.telnyxcompute.com/
```

```json theme={null}
{"message":"Hello from Telnyx Edge Compute!"}
```

The public URL returns `404`:

```bash theme={null}
curl https://internal-api-5aca61c5-4.telnyxcompute.com/
```

```text theme={null}
404 page not found
```

To reach the function from every device on a Tailscale network instead of one WireGuard peer per device, add a Tailscale Subnet Router: see [Tailscale](https://developers.telnyx.com/docs/edge-compute/private-ingress/how-it-works/tailscale.md).

## Clean Up

```bash theme={null}
telnyx-edge delete-func internal-api --yes
telnyx-edge network peer delete laptop
telnyx-edge network dns delete pi-demo-dns-ashburn-va
telnyx-edge network interface delete pi-demo-ashburn-va
telnyx-edge network delete pi-demo
```
