1.4.27 • Published 4 months ago

libcardano v1.4.27

Weekly downloads
-
License
ISC
Repository
-
Last release
4 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

6 months ago

1.4.1-7.1-browser

6 months ago

1.4.6

7 months ago

1.4.5

7 months ago

1.4.4

7 months ago

1.4.15-browser

6 months ago

1.4.20

6 months ago

1.4.22

5 months ago

1.4.21

6 months ago

1.4.24

4 months ago

1.4.23

5 months ago

1.4.26

4 months ago

1.4.13-browser

6 months ago

1.4.25

4 months ago

1.4.27

4 months ago

1.4.12-browser

6 months ago

1.4.1-7.2-browser

6 months ago

1.4.16-browser

6 months ago

1.4.14-browser

6 months ago

1.4.17-browser

6 months ago

1.4.11

6 months ago

1.4.8

7 months ago

1.4.10

6 months ago

1.4.7

7 months ago

1.4.17

6 months ago

1.4.19

6 months ago

1.4.18

6 months ago

1.4.3

8 months ago

1.2.0

10 months ago

1.4.2

9 months ago

1.4.1

9 months ago

1.4.0

9 months ago

1.3.1

9 months ago

1.2.2

9 months ago

1.3.0

9 months ago

1.2.1

10 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.0

12 months ago

1.1.2

11 months ago

0.1.0

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.0.8

1 year ago

0.1.4

12 months ago

0.1.3

12 months ago

0.0.7

1 year ago

0.1.5

12 months 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