Giter Club home page Giter Club logo

easy-coin-edited's Introduction

A simple blockchain node in Typescript developed for teaching

  1. Install dependencies using npm install pkg.json
  2. Compile using tsc
  3. Run using node index.js to connect with full network on port 18018. Run using bootstrap.js if you want to run on server-only mode on port 18020

If you ever want to clear all objects and blocks stored in the database, run node clear_databases.js.

Check the file constants.ts for different protocol parameters, including which miner to use (Typescript/C++), number of threads, name of the node, etc. Please change myName and minerName so that different nodes using this implementation can be distinguished.

To mine using the C++ miner (which is much faster), do the following:

  1. Clone the repository and init the submodules:
    git clone --recurse-submodules https://github.com/ssrivatsan97/easycoin

  2. Install cmake to build, you will need a C++ compiler like gcc clang:
    brew install cmake

  3. Create a build directory and run cmake to compile the C++ miner code:
    mkdir marabu_miner/build
    cd marabu_miner/build
    cmake ..
    make (If the above doesn't work on Ubuntu, try running make from the marabu_miner directory instead of from marabu_miner/build and then move the executables HashRateThread and MinerStandalone into marabu_miner/build.)

  4. After compiling the C++ miner, change minerType in constants.ts to "cpp". Check that cppMinerPath points to the correct path for MinerStandalone. Then compile using tsc and run index.js as usual.

  5. You can also check the hash rate of the C++ miner by running ./HashRateThread from within the directory marabu_miner/build.

Many thanks to marabu-miner-test for the C++ implementation!

easy-coin-edited's People

Contributors

ssrivatsan97 avatar

Watchers

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