<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorSession/start()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A7SessionP5startyyYaKF"
  },
  "title" : "start()"
}
-->

# start()

Start the underlying Tor instance.

```
func start() async throws
```

## Discussion

In a production conformer this creates the data directory, hands
`torrc`-equivalent configuration to `tor_main_configuration_new()`,
runs `tor_run_main()` on a dedicated background thread, and resolves
once the embedded control socket is reachable — but **before** the
Tor network bootstrap has made progress. Pair with
[`waitUntilBootstrapped(timeout:)`](/documentation/Tor/TorSession/waitUntilBootstrapped(timeout:)) to block until Tor
is actually usable for relaying traffic.

Mock conformers typically resolve this immediately or fail fast
per their test scenario.

> Throws: An implementation-defined error if the instance cannot be
> started. Production conformer throws ``doc://Tor/documentation/Tor/TorError/alreadyStarted``
> if invoked while Tor is running or starting, and
> ``doc://Tor/documentation/Tor/TorError/startFailed(_:)`` if `tor_run_main()` returns an error.