Giter Site home page Giter Site logo

smartcontract-message's Introduction

smartcontract-message

Smart Contract Inbox Project README

Table of Contents

Introduction

This is a Smart Contract Inbox project built using Ethereum smart contracts and web3.js. The project allows you to send and receive messages via a simple Ethereum smart contract. It also incorporates Ganache for local testing and Infura Ethereum Sepolia Faucet as a testnet for remote testing.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js and npm installed
  • Ganache installed
  • Metamask extension installed in your browser
  • An Infura account for Ethereum testnet access
  • An Ethereum wallet (e.g., MetaMask) for transaction signing

Installation

To install and set up this project, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/Sakaow/smartcontract-message.git
  2. Change to the project directory:

    cd inbox
  3. Install project dependencies:

    npm install

Configuration

To configure the project, follow these steps:

  1. Create a .env file in the project root directory to store your secret values. You can use the provided .env.example as a template.

    cp .env.example .env
  2. Open the .env file and fill in the following values:

    • MNEMONIC: Your 12-word mnemonic phrase for your Ethereum wallet.
    • INFURA_API_KEY: Your Infura API key for connecting to the Ethereum network.

Usage

To use the Smart Contract Inbox, you can perform the following actions:

  1. Compile and deploy the smart contract to the local Ganache network:

    npm run deploy-local
  2. Deploy the smart contract to the Ropsten testnet (using Infura):

    npm run deploy-ropsten
  3. Interact with the deployed contract by sending and receiving messages:

    npm run send-message "Your message here"
    npm run get-message
  4. Explore the inbox.js script to see how to interact with the smart contract.

Testing

This project uses Mocha for testing. To run the tests, execute the following command:

npm test

Make sure you have Ganache running locally or are connected to the Ethereum testnet via Infura when running the tests.

smartcontract-message's People

Contributors

sakaow avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.