Code Monkey home page Code Monkey logo

node-proof-of-authority's Introduction

You can help the author become a full-time open-source maintainer by sponsoring him on GitHub.


@faustbrian/node-proof-of-authority

npm version

Installation

pnpm install @faustbrian/node-proof-of-authority

Usage

import { IValidator, mine, round, validator } from "@faustbrian/node-proof-of-authority";

const validators: IValidator[] = [
  validator(
    "02062f6f6d2aabafd745e6b01f4aa788a012c4ce7131312026bdb6eb4e74a464d2",
    100,
  ),
  validator(
    "020aac4ec02d47d306b394b79d3351c56c1253cd67fe2c1a38ceba59b896d584d1",
    99,
  ),
  validator(
    "0212a11582a28f178b906edbf8e8c447ce1ba86041ee731e595ae4d39ef034c2ad",
    95,
  ),
  validator(
    "0215789ac26155b7a338708f595b97c453e08918d0630c896cbd31d83fe2ad1c33",
    76,
  ),
  validator(
    "021b0f58eca7f123428a8647ffe0644a9454c510f066d3864c27d8c7ad8f5a8aa4",
    54,
  ),
];

const validatorsByRound: round({
  limit: 5,
  round: 1,
  validators,
});

mine({
  height: 1,
  slot: 1,
  validator: validators[4],
  validators: validatorsByRound,
}); // Will return a new SHA256 hash.

mine({
  height: 2,
  slot: 2,
  validator: validators[1],
  validators: validatorsByRound,
}); // Error because someone else was expected to mine.

License

This is an open-sourced software licensed under the AGPL-3.0-or-later.

node-proof-of-authority's People

Contributors

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