Code Monkey home page Code Monkey logo

bhawana15 / voting_dapp Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 10.37 MB

Web based Online Voting and Campaigning Portal with an AI Chatbot

CSS 41.51% HTML 17.16% JavaScript 14.77% Jupyter Notebook 6.17% SCSS 19.57% Solidity 0.83%
blockchain ethereum-contract decentralized-applications solidity solidity-contracts solidity-dapps deep-learning deep-neural-networks chat-bot ai-chatbot python python-chatbot php sql xampp mysql backend html css bootstrap4

voting_dapp's Introduction

Your_First_Decentralized_Application

This is the code for "A Guide to Building Your First Decentralized Application" by Siraj Raval on Youtube

Overview

This is the code for this video on Youtube by Siraj Raval. It's a guide on how to build your first decentralized application.

Dependencies

Install missing dependencies with npm.

> git clone [email protected]:llSourcell/Your_First_Decentralized_Application.git
> cd Your_First_Decentralized_Application
> npm install 

Usage

After all dependancies are installed, run the testrpc service with:

node_modules/ethereumjs-testrpc/build/cli.node.js

Run the following commands to open the node console then deploy your contract to the test chain

siraj:~/hello_world_voting$ node
> Web3 = require('web3')
> web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
> code = fs.readFileSync('Voting.sol').toString()
> solc = require('solc')
> compiledCode = solc.compile(code)
> abiDefinition = JSON.parse(compiledCode.contracts[':Voting'].interface)
> VotingContract = web3.eth.contract(abiDefinition)
> byteCode = compiledCode.contracts[':Voting'].bytecode
> deployedContract = VotingContract.new(['Rama','Nick','Jose'],{data: byteCode, from: web3.eth.accounts[0], gas: 4700000})
> deployedContract.address
> contractInstance = VotingContract.at(deployedContract.address)

Interact with the contract via the html page attached, just open it in your browser. See this tutorial for more details.

voting_dapp's People

Contributors

bhawana15 avatar

Stargazers

 avatar  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.