1.4.27 • Published 7 months ago

libcardano v1.4.27

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

Cardano Node JS

Components:

1.Interceptor

It intercepts connection between two cardano-nodes. The communication is logged with decoded protocol messages.

example:

##
## [[ Node1 ]] ----->>  [127.0.0.1:3001  [[Interceptor]]] ----->> [172.31.0.15:3002  [[Node 2]]]
##
yarn interceptor 0.0.0.0:3001 172.31.0.15:3002

2.Client

Attempts connection to remote node and

  • maintain connection with it with periodic ping
  • log all the communication to/from the server

example:

yarn client preview-node.world.dev.cardano.org:30002

3. Using As a Library

3.1 Following a node for latest transactions.

import { createInMemoryClientWithPeer } from "libcardano/helper";
import { parseRawBlockBody } from "libcardano/cardano/ledger-serialization/transaction";
import * as process from "process";

const blockchain = createInMemoryClientWithPeer(process.argv[2] || "sanchonet-node.play.dev.cardano.org:3001", {
  networkMagic: parseInt(process.argv[3]) || 4,
  startPoint: "Latest",
});

blockchain.on("extendBlock", (block) => {
  const transactions = parseRawBlockBody(block.body);
  console.log(
    "RollForward :", block.headerHash.toString("hex"),
    "blockNo:", block.blockNo,
    "slotNo:",  block.slotNo,
    "txCount:", transactions.length
  );
});

blockchain.pipeline("rollback", ([[slot, headerHash], blockNo], _currentTip, cb) => {
  console.log("Rollback    :", headerHash.toString("hex"), "blockNo:", blockNo, "slotNo:", slot);
  setImmediate(cb);
});
1.4.1-7.3-browser

8 months ago

1.4.1-7.1-browser

8 months ago

1.4.6

10 months ago

1.4.5

10 months ago

1.4.4

10 months ago

1.4.15-browser

9 months ago

1.4.20

8 months ago

1.4.22

8 months ago

1.4.21

8 months ago

1.4.24

7 months ago

1.4.23

8 months ago

1.4.26

7 months ago

1.4.13-browser

9 months ago

1.4.25

7 months ago

1.4.27

7 months ago

1.4.12-browser

9 months ago

1.4.1-7.2-browser

8 months ago

1.4.16-browser

9 months ago

1.4.14-browser

9 months ago

1.4.17-browser

8 months ago

1.4.11

9 months ago

1.4.8

10 months ago

1.4.10

9 months ago

1.4.7

10 months ago

1.4.17

8 months ago

1.4.19

8 months ago

1.4.18

8 months ago

1.4.3

11 months ago

1.2.0

1 year ago

1.4.2

11 months ago

1.4.1

12 months ago

1.4.0

12 months ago

1.3.1

1 year ago

1.2.2

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

1.1.2

1 year ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.0.8

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.0.7

1 year ago

0.1.5

1 year ago

0.0.5

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.4

1 year ago

0.0.1

1 year ago