Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dfinity-block

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dfinity-block

This libary provides basic functions for creating serializing and deserializing blocks

  • 0.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NPM Package Build Status Coverage Status

js-standard-style

Synopsis

This library provides basic functions for creating serializing and deserializing blocks

Installation

npm install dfinity-block

Usage

const block = new DfinityBlock({
  version: 0,
  height: 1000,
  timestamp: 0,
  preBlockHash: new Uint8Array(20),
  stateRoot: new Uint8Array(20),
  beaconSig: new Uint8Array(32),
  preNotarySig: new Uint8Array(32),
  minterID: 0,
  minterSig: new Uint8Array(32)
})

const sk = crypto.randomBytes(32)

// sign the block as a minter and serialize the block
const signedBlock = await block.sign(sk)

// desialize the block
const block2 = await DfinityBlock.deserialize(signedBlock)

// read the height of the block
block2.height

API

./docs/

Specification

./docs/

License

(C) 2017 DFINITY STIFTUNG

All code and designs are open sourced under GPL V3.

image

Keywords

FAQs

Package last updated on 28 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc