# Step 3: Initialize and Build the Züs components

### Initialize the Sharder and Miner directories

1. Navigate to 0chain directory

```
cd 0chain
```

2\. Run the `init.setup.sh` script located in the `docker.local/bin` directory using the command

```
./docker.local/bin/init.setup.sh
```

After running the script you will see the sharder and miner directories populated in `docker.local` folder.

3\. Lets verify whether the directories exist by navigating to `docker.local` folder and running

```
ls docker.local/
```

The output should be similar to this:

```
Makefile    build.benchmarks  build.sc_unit_test     build.unit_test  miner2  miner6    sharder2
benchmarks  build.genkeys     build.sharder          config           miner3  miner7    sharder3
bin         build.magicBlock  build.swagger          docker-clean     miner4  miner8    sharder4
build.base  build.miner       build.test.multisigsc  miner1           miner5  sharder1  sql_script
```

### Build the miner and sharder containers

\
1\. Navigate to 0chain directory

```
cd 0chain
```

2\. First build the base containers using the script.(This may take few minutes)

```
./docker.local/bin/build.base.sh
```

Screenshot after successful build:

<figure><img src="/files/m3uQ9pdqmMzi6aJQeJJB" alt=""><figcaption><p>Base Build</p></figcaption></figure>

3. Build mocks from the Makefile in the repo, from 0chain directory run:

```
 make build-mocks 
```

**Note:** Mocks have to be built once in the beginning. Building mocks require mockery and brew which can be installed from [**here**](/guides/setup-a-blockchain/additional-tips-and-troubleshooting-for-mac.md#install-homebrew-and-mockery-on-mac-and-linux) **.**

4. For building the sharder containers use the following command :

```
./docker.local/bin/build.sharders.sh
```

Screenshot of successful sharder build:

<figure><img src="/files/cFX9xctNTPoCwkXjTZZK" alt=""><figcaption><p>Sharder Build</p></figcaption></figure>

5. Build the miner containers using

```
./docker.local/bin/build.miners.sh
```

Screenshot of a successful miner build:

<figure><img src="/files/YEFWlRqld794vrQkeUZG" alt=""><figcaption><p>Miner Build</p></figcaption></figure>

### Initialize the blobber directories

1. Navigate to blobber directory

```
cd blobber
```

2\.  Inside blobber directory, run the commands below .The first command makes the shell script executable and while the next ones execute the shell script to create blobber directories.

```
chmod +x ./docker.local/bin/blobber.init.setup.sh
./docker.local/bin/blobber.init.setup.sh
```

**NOTE**: For Mac :

```
chmod +x ./docker.local/bin/blobber.init.setup-mac.sh
./docker.local/bin/blobber.init.setup-mac.sh
```

After running the script you will see the blobber directories populated in `docker.local` folder

3\. Let's verify whether the directories exist by navigating to `docker.local` folder and running

```
ls docker.local/
```

The output should be like this:

```
   b0docker-compose.yml  blobber4            Dockerfile
   bin                   blobber5            IntegrationTestsBlobberDockerfile
   blobber1              blobber6            keys_config
   blobber2              docker-clean        p0docker-compose.yml
   blobber3              docker-compose.yml  ValidatorDockerfilecd blobber/config
```

4. Navigate to the config directory using

```
cd blobber/config
```

Use the nano editor to edit the `block`\_`worker` field for both files :

```
nano 0chain_blobber.yaml
```

and

```
nano 0chain_validator.yaml
```

**Note : Change the default value of `block_worker` field with the following:** [**http://198.18.0.98:9091/**](http://198.18.0.98:9091/) **for the local chain.**

### Build the blobber containers

1. Go back to `blobber` directory

```
cd blobber
```

2\. Now run the following scripts located in the `docker.local/bin` directory.

```
./docker.local/bin/build.base.sh
./docker.local/bin/build.blobber.sh
./docker.local/bin/build.validator.sh
```

Screenshot after a successful blobber build:

<figure><img src="/files/BHX26jMel75jqOs47cen" alt=""><figcaption><p>Blobber Build</p></figcaption></figure>

**Note:** The blobber scripts defined above works fine for Linux and Intel Mac **.**&#x49;f you want to run blobber and validator on Apple Silicon Mac(M1 or M2) follow the guide [here](https://github.com/0chain/blobber/blob/staging/dev.local/README.md). In case you are still facing issues with blobbers on M1 or M2 mac check [Troubleshooting Guide for Blobbers Setup (Mac M1 or M2)](/guides/setup-a-blockchain/additional-tips-and-troubleshooting-for-mac.md#troubleshooting-guide-for-blobbers-setup-mac-m1-or-m2)[.](/guides/setup-a-blockchain/additional-tips-and-troubleshooting-for-mac.md#troubleshooting-guide-for-blobbers-setup-mac-m1-or-m2)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-old.zus.network/guides/setup-a-blockchain/step-3-initialize-and-build-the-0chain-components.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
