Skip to content

laumair/entangled-node

 
 

Repository files navigation

Entangled node

Build Status

IOTA Common native Node.js module bindings, exposing functions for Proof of Work, address generation, signature generation and bundle mining.

Usage:

const {
  powTrytesFunc,
  powBundleFunc,
  genAddressTrytesFunc,
  genAddressTritsFunc,
  genSignatureTrytesFunc,
  genSignatureTritsFunc,
  transactionHashFunc,
  bundleMiner } = require('entangled-node');

(async () => {

  // Do Proof of Work on trytes
  const pow = await powTrytesFunc("TRYTES", 14);

  // Do Proof of Work on a bundle
  const transactions = await powBundleFunc({"TRYTES1", "TRYTES2", "TRYTES3"}, "TRUNK", "BRANCH", 14);

  // Generate address trytes
  const addressTrytes = await genAddressTrytesFunc("SEED", 0, 2);

  // Generate address trits
  const addressTrits = await genAddressTritsFunc([-1, 0, ..., 1, 1], 0, 2);

  // Generate signature trytes
  const signatureTrytes = await genSignatureTrytesFunc("SEED", 0, 2, "BUNDLEHASH");

  // Generate signature trits
  const signatureTrits = await genSignatureTritsFunc([1, 0, ..., 0, -1], 0, 2, [-1, -1, ..., 1, 0]);

  // Transaction hash
  const hash = await transactionHashFunc("TRYTES");

  // Bundle miner
  const index = await bundleMiner([-6, 4, ..., 8, -9], 2, [0, -1, ..., 1, 1], 486 * 4, 1000000, 0);

})();

About

IOTA Entangled Node bindings

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • C 65.9%
  • C++ 23.2%
  • JavaScript 9.0%
  • Python 1.9%