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

# Setup

ContractKit requirements, installation, and initialization.

<Warning>
  [ContractKit has been sunset](https://forum.celo.org/t/sunsetting-contractkit/5337) for external use. Please use viem or wagmi for connecting with the blockchain.

  Check out the [migration guide](/developer/contractkit/migrating-to-viem) for updating your dapp from ContractKit to viem.

  To learn more visit the [Celo forum](https://forum.celo.org/t/sunsetting-contractkit/5337).
</Warning>

***

## Installation and System Requirements

To install, run the following:

<Tabs>
  <Tab title="npn">
    ```bash theme={null}
    npm install web3@1.10 @celo/contractkit
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn add web3@1.10 @celo/contractkit
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add web3@1.10 @celo/contractkit
    ```
  </Tab>

  <Tab title="Bun">
    ```bash theme={null}
    bun add web3@1.10 @celo/contractkit
    ```
  </Tab>
</Tabs>

You will need Node.js v18.x.

## Initializing the Kit

To start working with ContractKit you need a `kit` instance and a valid net to connect with. In this example will use `alfajores` (you can read more about it [here](/build-on-celo/network-overview))

```ts theme={null}
import Web3 from "web3";
import { newKitFromWeb3 } from "@celo/contractkit";

const web3 = new Web3("https://forno.celo-sepolia.celo-testnet.org/");
const kit = newKitFromWeb3(web3);
```

Go to the [page about Forno](/tooling/nodes/forno) for details about different connection types and network endpoints.

## Initialize the Kit with your own node

If you are hosting your own node (you can follow [this guide](/infra-partners/operators/run-node) to run one) you can connect our ContractKit to it.

```js theme={null}
import Web3 from "web3";
import { newKitFromWeb3 } from "@celo/contractkit";

// define localUrl and port with the ones for your node

const web3 = new Web3(`${localUrl}:${port}`);
const kit = newKitFromWeb3(web3);
```

Same as `Web3` we support `WebSockets`, `RPC` and connecting via `IPC`.
For this last one you will have to initialize the `kit` with an instances of `Web3` that has a **valid** `IPC Provider`

```ts theme={null}
import Web3 from "web3";
import { newKitFromWeb3 } from "@celo/contractkit";

const web3Instance: Web3 = new Web3(
  new Web3.providers.IpcProvider("/Users/myuser/Library/CeloNode/geth.ipc", net)
);

const kit = newKitFromWeb3(web3Instance);
```
