# Truffle

A world class development environment, testing framework and asset pipeline for blockchains using the Ethereum Virtual Machine (EVM), aiming to make life as a developer easier.

More detailed documentations about Truffle can be found [here](https://trufflesuite.com/docs/truffle/index.html).

## Configuration for KardiaChain

Update your `truffle-config.js` with the following setting to start using Truffle on KardiaChain

```javascript
const HDWalletProvider = require('@truffle/hdwallet-provider');
//
// const fs = require('fs');
const mnemonic = "YOUR_SEED_PHRASE";

module.exports = {

  networks: {
    kardiachain: {
      provider: () => new HDWalletProvider(mnemonic, `https://rpc.kardiachain.io`),
      network_id: "0",        // KardiaChain network ID
      gas: 5500000,           // Default gas limit
      confirmations: 2,       // # of confs to wait between deployments. (default: 0)
      timeoutBlocks: 200,     // # of blocks before a deployment times out  (minimum/default: 50)
      skipDryRun: true        // Skip dry run before migrations?
    },
    kardiachain_testnet: {
      provider: () => new HDWalletProvider(mnemonic, `https://dev.kardiachain.io`),
      network_id: "69",       // KardiaChain Testnet network id
      gas: 5500000,           // Default gas limit
      confirmations: 2,       // # of confs to wait between deployments. (default: 0)
      timeoutBlocks: 200,     // # of blocks before a deployment times out  (minimum/default: 50)
      skipDryRun: true,       // Skip dry run before migrations? (default: false for public nets )
    }
  },

  // Configure your compilers
  compilers: {
    solc: {
      version: "0.8.12",      // Fetch exact version from solc-bin (default: truffle's version)
      settings: {             // See the solidity docs for advice about optimization and evmVersion
        optimizer: {
          enabled: false,
          runs: 200
        },
      }
    }
  },
};
```


---

# 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.kardiachain.io/docs/archived-docs/tutorials/smart-contract-development/dev-environment/ide-and-tools/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.
