KardiaChain Docs
  • Introduction
  • Technology
    • Consensus
    • Kardia Virtual Machine (KVM)
    • Kardia Smart Contract Markup Language
    • Peer to Peer (P2P)
    • Onchain AI
    • NF3 Chip
  • For Users
    • KardiaChain Proposer Validator Selection Process
    • Staking
      • Validators
      • Delegators
      • Disciplines and Rewards
        • Disciplines
        • Rewards
    • Transaction Fee
    • Wallets
      • MetaMask Compatible
      • KardiaChain Mobile App Wallet
      • [Deprecated] KardiaChain Web Wallet
        • [Deprecated] KardiaChain Wallet Extension
  • For Developers
    • Tutorials
      • Platform
        • Running KardiaChain node
        • Private KardiaChain Network
        • KAI Integration for Exchanges
      • Smart contract development
        • Dev environment
          • Solidity
          • IDE and tools
            • Remix
            • Hardhat
            • Truffle
        • Contract verification
      • KRC20 Tokens
        • Deploying KRC20 Token
        • KRC20 token verification
      • KRC721 Tokens
        • Deploy KRC721 tokens
      • Building DApp
        • Frontend
        • Data indexing service
    • SDK
      • Web3
      • [Deprecated] KardiaChain JS SDK
      • [Deprecated] KardiaChain Golang SDK
    • RPC
      • JSON RPC API
    • KardiaID Service
      • KardiaID Service Design
      • KardiaID Service API
  • Archived Docs
    • Golang SDK
    • Network
    • KVM
    • System requirement
    • Deployment
      • Configuration
      • Local
      • Public testnet
      • Mainnet
    • KSML
    • Staking Overview
      • Delegation period
      • Consensus
      • Delegator
        • What is a delegator ?
        • Choose validator
        • Directive of delegator
        • Risk
      • Proposer selection procedure
      • Staking rewards and distributions
        • Block reward distributed
        • Fee distributed
      • Slashing and Jail
      • Rewards mechanism
      • Validator
        • What is a validator ?
        • The different states a validator
        • The responsibility of validator
        • The incentive run a validator
        • To become validator
    • KardiaChain Metamask (extension) Wallet
Powered by GitBook
On this page

Was this helpful?

  1. For Developers
  2. Tutorials
  3. Smart contract development
  4. Dev environment
  5. IDE and tools

Truffle

PreviousHardhatNextContract verification

Last updated 3 years ago

Was this helpful?

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 .

Configuration for KardiaChain

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

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
        },
      }
    }
  },
};
here