Skip to content

ThunderCore Truffle Box

The box has all you need to get started with building dapps on ThunderCore.


First ensure you are in a new and empty directory. Besides, you have nodejs and yarn (optional) in your environment.

  1. Run the unbox command via npx and skip to step 3.
npx truffle unbox thundercore/thunder-box
  1. Alternatively, you can install Truffle globally and run the unbox command. Make sure you have truffle v 5.0.0 above.
npm install -g truffle # (yarn global add truffle)
truffle unbox thundercore/thunder-box
  1. Run the development console.
truffle develop
  1. Compile and migrate the smart contracts. Note inside the development console we don't preface commands with truffle.
  1. Alternatively, you can run the following instructions to compile and migrate the smart contracts.
npm run compile # (yarn comile)
npm run migrate # (yarn migrate)
  1. clean up builded contracts
npm clean # (yarn clean)
  1. lint your contract. More detail regarding the linter can be found here
npm run lint
npm run lint:fix 

Develop on Thunder Testnet and Mainnet

  1. Get the thunder tokens
    You can get Thunder tokens at:


    for testnet and mainnet, respectively.
    Remember to point Metamask's current network to thunder-mainnet ( or thunder-testnet ( after creating those two networks via Avatar -> Settings -> Networks .

  2. Setup the control of accounts for deployment Either:

    • Write your 12-word mnemonic (seed phrase) to a file named .mnemonic
    • Export your account private keys, one per line, to a file named .private-keys
    # If you use private keys
    mv .private-keys.template .private-keys
    # in .private-keys file, put your private keys
    # If you prefer mnemonic
    mv .mnemonic.template .mnemonic
    # In .mnemonic file, put your mnemonic
    dog cat apple bird ...
  3. Compile and migrate your contract for testnet and mainnet

    # Compile to testnet
    npm run compile:testnet
    # is equal to 
    truffle compile --network thunder-testnet
    # ---
    # Compile to mainnet
    npm run compile:mainnet
    # is equal to 
    truffle compile --network thunder-mainnet
    # ---
    # Migrate to testnet
    npm run migrate:testnet
    # is equal to 
    truffle migrate --network thunder-testnet
    # ---
    # Migrate to mainnet
    npm run migrate:mainnet
    # is equal to 
    truffle migrate --network thunder-mainnet