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

# Node Setup

> Step-by-step — install the open-source node, log in with your staked wallet, attest your enclave, and start serving.

This walks you through bringing a node online end to end. Make sure you meet the [requirements](/cloud/provide/requirements) first.

The node software is **open source**: [github.com/Singularity-Layer/sgl-network-node](https://github.com/Singularity-Layer/sgl-network-node). Full command details are in the [CLI reference](/cloud/provide/cli).

<Tip>
  **Prefer to let an agent do it?** Install the **`x402-compute`** skill and ask your agent to bring the node online — it runs this whole flow (stake → install → register → attest → serve):

  ```bash theme={null}
  npx skills add https://github.com/ivaavimusic/singularity-skill --skill x402-compute
  # or: curl -fsSL https://api.x402layer.cc/skill/x402-compute/install | bash
  ```
</Tip>

## 1. Install the node CLI

Install `sgl` from the official release (see the repo README for per-platform instructions). Verify it's available:

```bash theme={null}
sgl --help
```

You also need a local inference runtime (llama-server) and a **GGUF model file** to serve, e.g.:

```bash theme={null}
# example: a small instruct model
~/models/Llama-3.2-3B-Instruct-Q4_K_M.gguf
```

## 2. Log in & register (with your staked wallet)

`sgl login` opens a browser flow to approve the node with the wallet that holds your stake. This binds the node to that wallet.

```bash theme={null}
sgl login --tee-type apple_se --models llama-3.2-3b
```

* `--tee-type` — the TEE on your machine (default `apple_se`).
* `--models` — comma-separated models you'll advertise.

<Note>Prefer no browser? `sgl init --wallet <STAKED_WALLET>` registers directly. `login` is recommended.</Note>

## 3. Attest your enclave

Produce and submit the hardware attestation. Only **attestation-verified** nodes receive jobs — and you must re-attest after any binary update.

```bash theme={null}
sgl attest
```

## 4. Start serving

For production, run as a background service so the node survives reboots, logout, crashes, and idle sleep:

```bash theme={null}
sgl service install \
  --model-path ~/models/Llama-3.2-3B-Instruct-Q4_K_M.gguf \
  --model-name llama-3.2-3b \
  --resource-percent 50
```

To test in the foreground first:

```bash theme={null}
sgl start --model-path ~/models/Llama-3.2-3B-Instruct-Q4_K_M.gguf --model-name llama-3.2-3b
```

Check it's healthy:

```bash theme={null}
sgl status            # node + hardware + orchestrator
sgl service status    # background service state
```

Your node now registers, advertises its model(s), heartbeats, and starts receiving jobs.

## 5. Maintenance

Going down on purpose? Use maintenance mode so you stop receiving **new** jobs cleanly (in-flight jobs finish; no penalty):

```bash theme={null}
sgl off-grid          # before planned downtime
sgl on-grid           # resume
```

Honest downtime is never penalized — it just means no new jobs while you're offline. Only **proven tampering** is slashable (see [Staking to operate](/cloud/provide/staking)).

## Confidentiality

Your node runs every workload **inside the TEE**, so you serve user prompts without being able to read them. Attestation enforces this — it's the basis of the network's [confidential-compute](/cloud/concepts/confidential-compute) guarantee.

## Next

* [CLI reference](/cloud/provide/cli) — every command and flag.
* [Earnings & payouts](/cloud/provide/earnings) — how you get paid.
* [Staking to operate](/cloud/provide/staking) — the bond required.
