<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/Context/init(options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel7ContextC7optionsAcA0C7OptionsCSg_tKcfc"
  },
  "title" : "init(options:)"
}
-->

# init(options:)

Creates a new kernel context.

```
init(options: ContextOptions? = nil) throws
```

## Parameters

`options`

Configuration options. Pass `nil` (the default)
for a mainnet context with no callbacks — suitable for quick
experiments but not for any real use where you need to know about
new tips, validation failures, or log output.

## Discussion> Throws: ``doc://BitcoinKernel/documentation/BitcoinKernel/KernelError/contextCreationFailed`` if the C API returns
> null. The kernel does not expose a reason; re-run under kernel
> logging (see ``doc://BitcoinKernel/documentation/BitcoinKernel/LoggingConnection``) to see what went wrong.