<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/ContextOptions/setChainParams(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel14ContextOptionsC14setChainParamsyyAA0F10ParametersCF"
  },
  "title" : "setChainParams(_:)"
}
-->

# setChainParams(_:)

Sets the chain parameters — determines which Bitcoin network the
resulting [`Context`](/documentation/BitcoinKernel/Context) validates against.

```
func setChainParams(_ params: ChainParameters)
```

## Parameters

`params`

Chain parameters, typically constructed via
[`init(_:)`](/documentation/BitcoinKernel/ChainParameters/init(_:)) from a [`ChainType`](/documentation/BitcoinKernel/ChainType).

## Discussion

The C API copies the parameters internally, so `params` may be
deallocated after this call returns. Calling this replaces any
previously-set chain parameters on the same options object.