# Setup truffle

## :pencil: Truffle config

create and edit `truffle-config.js`:

{% code title="truffle-config.js" %}

```javascript
module.exports = {
  contracts_build_directory: "./src/contract_build",
  compilers: {
    solc: {
      version: '0.5.2'
    }
  },
};
```

{% endcode %}

We specified to use `solc` version `0.5.2` as the contract compiler and we set the contract build directory to `./src/contract_build` because the default build directory is `./build` which conflicts with react application build folder. Another reason is later on we'll use react to load the `Counter.json` from the build directory which must be located inside the `src` directory.

## :red\_car: Test out

You can check if it's setup correctly by running `truffle compile`

```bash
truffle compile
```

The command will success and print something like:

```bash
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
```

{% hint style="info" %}
truffle compile will check the contracts which needs compile to evm byte code. Truffle thinks everything is update to date since we're not having any smart contract in this project.
{% endhint %}


---

# 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.clv.org/portal/development-guide/tutorial/setup-truffle.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.
