GithubHelp home page GithubHelp logo

gupta-shrinath / bloc Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 5.24 MB

A To-do app that uses ethereum blockchain

License: MIT License

HTML 3.74% Solidity 0.37% CSS 0.62% JavaScript 95.28%
dapps-development web3js boostrap4 solidity

bloc's Introduction

BLOC

Model Prototype Version 1.1 License

  • Bloc is a to-do application that runs on your local ethereum blockchain.
  • Bloc uses smart-contracts and web3 js to talk to your local ethereum blockchain.

Dependencies

  • Bootstrap 4.5.2
  • Jquery 3.5.1
  • Web3 1.2.11
  • Solidity ^0.5.1
  • Ganache 2.4.0.1317

Install

  • Download Ganache for local ethereum blockchain.
    • Click on Quickstart Ethereum and after that note the address labeled under RPC Server (should be something like this http://127.0.0.1:7545) and make sure to copy the same address in js/getAccount.js file line 1.
  • Go to Remix IDE click on the plus icon in the file explorers located in the left panel and name the file as bloc.sol (Make sure to sure http site not https).
    • Copy the code present in bloc.sol from this repo.
    • Go to solidity compiler located in the left panel and click on compile bloc.sol. down you'll find a button with copy icon and text as ABI click on it.Paste it in js/config.js line 1

      let contractABI = COPIED TEXT;
      The copied text will be enclosed in [].

    • Go to deploy and run transaction under environment select Web3 Provider.
    • If you get the message Not possible to connect to the Web3 provider. Make sure the provider is running, a connection is open (via IPC or RPC) or that the provider plugin is properly configured. this is due to CORS policy in browsers.
    • The solution for chrome browser is go to chrome://flags/#block-insecure-private-network-requests and select disabled. Relaunch the browser. Disabling that flag does mean you're re-opening the security hole that Chrome's new behavior is meant to close.You can read more here.
    • Enter the address you copied from Ganache and paste it click on OK.
    • Now a deploy button will be visible click on it.
    • Down you'll find Deployed Contracts label now there will a copy icon button click on it
      and paste in js/config.js line 2

      let contractAddress = 'COPIED text';
      The copied text might look like this 0xF3017acEDd45526aC6153FBBCfcA8096173D245a.

  • Download VSCode for live server extension (any other server will also work)
  • Go to Extensions on the left panel search for live server and install it.
  • Open the folder containing this repo and down in the blue status bar and click on Go live.

Screenshots

Bloc App

Credits

Additional Info.

  • I subconsciously tend to write complex solution to simple problem so if you found a simpler way to a particular thing you can reach out to me on twitter and let me know.
  • I would like to thank Ankit Gupta @ankitecd for reviewing the js/app.js file.

License

Bloc App is licensed under MIT LICENSE.

bloc's People

Contributors

gupta-shrinath avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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