wurahara / Lab5-truffle

A sample project for DApp development and management using truffle.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lab5-truffle

A sample project for DApp development and management using truffle.

Designed for COMP4142, Department of Computing, PolyU.

Preface

This project demonstrates how to develop and manage decentralized applications using truffle.

Dependency

truffle:                      ^5.11.5
dotenv:                       ^16.3.1
@openzeppelin/contracts:      ^5.0.0
@truffle/hdwallet-provider:   ^2.1.15

Deployment

  • Run the image to initiate a container:

    $ docker run -d --rm --name truffle \
        -it crumblejon/smart-contract-truffle

    This will pull the image crumblejon/smart-contract-truffle from Docker Hub and run it in Docker.

  • Configure your API key and private key by:

    $ docker exec truffle \
        npm run secret \
        <your_API_key> <your_private_key>
    

    You can get an API key from Infura, and find your private key from the MetaMask extension.

Execution

  • Test the smart contract and deployment scripts:

    $ docker exec truffle \
        npm run test
  • Compile the smart contracts:

    $ docker exec truffle \
        npm run build
  • Migerate (deploy) contracts to Sepolia network:

    $ docker exec truffle \
        npm run deploy

License

This repository is released under MIT license. Copyright © Jon.

About

A sample project for DApp development and management using truffle.

License:MIT License


Languages

Language:JavaScript 87.1%Language:Solidity 9.3%Language:Dockerfile 3.6%