Code Monkey home page Code Monkey logo

pow-chain's Introduction

Proof of Work Chain

This is an example Proof of Work Chain with a client/server application.

Server

First you'll want to start the server. You'll want to install all the dependencies with npm i from the root directory in the terminal.

Once you've installed the dependencies you can run the server with node index or nodemon index (the latter of which will restart the server if you make any changes!). This currently starts your server at port 3032 by default.

Client

To start the client application you'll need to install parceljs.

Once you have done that you can navigate to the /client folder in a terminal and run parcel index.html which will start your client at port 1234 by default.

Utilities

There are some /scripts/ which you can use as utilities for your Proof of Work chain. Inside the scripts folder you'll find a few files:

  • generate.js - This will generate you a new public/private keypair node generate
  • getBalance.js - This will get the balance of a public key passed in from the command line: i.e. node getBalance --address 049a1bad614bcd85b5f5c36703ebe94adbfef7af163b39a9dd3ddbc4f286820031dfcb3cd9b3d2fcbaec56ff95b0178b75d042968462fbfe3d604e02357125ded5
  • startMining.js - This will start the miner on the server node startMining
  • stopMining.js - This will stop the miner on the server node stopMining

pow-chain's People

Contributors

dan-nolan 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.