# FakeReplica

Defined in: [core/src/testing/fake-replica.ts:115](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/testing/fake-replica.ts#L115)

A fake replica installed by [installFakeReplica](https://ic-reactor.b3pay.net/v3/libs/functions/installfakereplica/).

## Properties

### host

> `readonly` **host**: `string`

Defined in: [core/src/testing/fake-replica.ts:117](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/testing/fake-replica.ts#L117)

The origin the fake answers for.

***

### rootKey

> `readonly` **rootKey**: `Uint8Array`

Defined in: [core/src/testing/fake-replica.ts:123](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/testing/fake-replica.ts#L123)

The DER-encoded root key the fake signs certificates with. An agent on a
local host fetches it from the fake; pass it as `agentOptions.rootKey`
to an agent that does not fetch its root key.

***

### requests

> `readonly` **requests**: readonly [`FakeReplicaRequest`](https://ic-reactor.b3pay.net/v3/libs/interfaces/fakereplicarequest/)[]

Defined in: [core/src/testing/fake-replica.ts:125](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/testing/fake-replica.ts#L125)

Every request an agent sent to the fake, in order.

## Methods

### restore()

> **restore**(): `void`

Defined in: [core/src/testing/fake-replica.ts:133](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/core/src/testing/fake-replica.ts#L133)

Takes the fake out of `globalThis.fetch`, putting back the `fetch` it
replaced, along with any wrapper a test installed around it since.
Calling it again does nothing, and several fakes may be restored in any
order: one installed over this fake keeps its place. An agent built while
the fake was installed keeps calling it.

#### Returns

`void`