Giter Club home page Giter Club logo

messaging-ethereum's Introduction

Messaging-Ethereum

A simple Ethereum based application for messaging.

Smart Contract

The inbox.sol is written in Solidity language v0.4.17 which contains the smart contract written for messaging. This is a simple application which is deployed on ganache. You can read more about smart contracts here. You can read more about the solidity language here.

Compiling the Smart Contract

To compile the smart contract we will be using solc compiler which is used to compile solidity codes. The compile code is placed in compile.js. The code is written in JavaScript.

Testing our Smart Contract

The lottery.test.js file, written in JavaScript tests our smart contracts by using multiple testcases written in it. We will be using mocha as the testing framework. Read more about mocha here.

Deploying our Smart Contract

The deploy.js file will deploy our smart contract to the Ganache network. It allows us to make calls to actual blockchain without the need of creating an actual node to communicate. Read more about ganaache here.

Steps to configure the project and to run our Smart Contract and deploy it on Rinkeby TestNet.

  1. Create a folder named Inbox in your working directory.
  2. Create a folder named contracts in Lottery and save our smart contract in this folder.
  3. Place the compile.js and deploy.js in the folder Inbox itself.
  4. Create a folder named test and save the lottery.test.js here.
  5. Install NodeJS in your computer from here. Use the recommended version.
  6. Install Git in your computer from here.
  7. Open up your cmd. Navigate to the folder Lottery in your cmd.
  8. Run the command- 'npm init' in our Lottery folder. This will create a package.json file in your directory.
  9. Install packages Truffle, Mocha, Ganache-CLI and Web3 by running the command 'npm install --save [email protected] mocha ganache-cli web3'. Truffle is a development environment, testing framework and asset pipeline for Ethereum. Mocha is a testing framework which will be required by our lottery.test.js file. Ganache provides a environment for truffle. Web3 is a collection of libraries which allows you to interact with a local or remote ethereum node.
  10. To compile our smart contract, run command 'node compile.js'.
  11. To test our smart contract, run 'npm run test'.
  12. Install MetaMask which is an extension for browsers like Chrome to easily track your transactions and accounts.
  13. Finally, deploy our contract on the Rinkeby network by running command 'node deploy.js'

messaging-ethereum's People

Contributors

thedecepticon30 avatar

Watchers

James Cloos 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.