open-index/open-npm huggingface dataset:
npm package: @stellarbeat/fbas_analyzer_nodejs
Description: nodejs module wrapper of awesome https://github.com/wiberlin/fbas_analyzer tool.
Author: pieterjan84
Latest version: 0.9.0

# fbas_analyzer_nodejs

Uses https://neon-bindings.com/ to create a nodejs module around the awesome https://github.com/wiberlin/fbas_analyzer tool.

Uses https://travis-ci.org/ to build binaries for linux & mac os (https://neon-bindings.com/docs/publishing)

## build release
`yarn install`

## build dev
`neon build`

## cleanup
`neon clean`
Cleans up native folder. 

## run tests
`yarn jest`

## upgrade fbas_analyzer rust package

Update the version in Cargo.toml
```
cd native
cargo build
```

## publish new release on npmjs

1) Commit and push the code with a new version tag. Travis will automatically build and create a new (draft) github release.
2) publish the release on github (manually)
3) run `npm publish`
npm package: @stellarbeat/js-stellar-domain
Description: Domain classes for stellarbeat. Code reuse between frontend and backend
Author: pieterjan84@github
Latest version: 4.1.2

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
# js-stellar-domain

Domain classes for stellarbeat

install dependencies
`yarn install`

build code:
`npm run build`

test code:
`npm run test`
npm package: @stellarbeat/js-stellar-node-crawler
Description: Crawl the network for nodes
Author: pieterjan84@github
Latest version: 5.1.0

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![test](https://github.com/stellarbeat/js-stellar-node-crawler/actions/workflows/test.yml/badge.svg)](https://github.com/stellarbeat/js-stellar-node-crawler/actions/workflows/test.yml)

# stellar-js-node-crawler

Crawl the Stellar Network. Identify the nodes and determine their validating
status, version, lag,....

## How does it work?

See readme in src/README.md for an overview of the functionality and
architecture.

## install

`pnpm install`

## build code

`pnpm build`: builds code in lib folder

## Usage

### Create crawler

```
let myCrawler = createCrawler({
    nodeConfig: getConfigFromEnv(),
    maxOpenConnections: 25,
    maxCrawlTime: 900000
});
```

The crawler is itself a
[node](https://github.com/stellarbeat/js-stellar-node-connector) and needs to be
configured accordingly. You can limit the number of simultaneous open
connections to not overwhelm your server and set the maxCrawlTime as a safety if
the crawler should be stuck.

### Run crawl

```
let result = await myCrawler.crawl(
			nodes, // [[ip, port], [ip, port]]
			trustedQSet, //a quorumSet the crawler uses the determine the latest closed ledger
		    latestKnownLedger //a previous detected ledger the crawler can use to ignore older externalize messages
		);
```

### example script

Check out `examples/crawl.js` for an example on how to crawl the network. You
can try it out using the bundled seed file with the following command:  
`pnpm examples:crawl seed/nodes.json`

Another example is the
[Stellarbeat backend](https://github.com/stellarbeat/js-stellarbeat-backend/blob/master/src/network/services/CrawlerService.ts)

### publish new release

Uses the [np package](https://github.com/sindresorhus/np) and semantic
versioning.

```
np
```
npm package: @stellarbeat/js-stellarbeat-shared
Description: Shared code between Stellarbeat frontend and backend
Author: pieterjan84@github
Latest version: 6.6.1

[![Known Vulnerabilities](https://snyk.io/test/github/stellarbeat/js-stellarbeat-shared/badge.svg)](https://snyk.io/test/github/stellarbeat/js-stellarbeat-shared)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
# js-stellarbeat-shared

Shared code between js-stellarbeat-frontend and js-stellarbeat-backend.

DTO classes like Node, Organization and Network are defined here and can be hydrated from the backend API responses.

Other code like the TrustGraph calculation is used in the backend to calculate and store stats for the live network, and is used in the frontend for simulation purposes.

install dependencies
`yarn install`

build code:
`npm run build`

test code:
`npm run test`
npm package: @stellarbeat/stellar-halting-analysis
Description: Run halting analysis algorithms on stellar quorums
Latest version: 1.2.0

# stellar-halting-analysis

Analyze a transitive quorum to find halting weaknesses.  Runs through all the nodes and checks for any combination of N failures which can cause your node to halt.  This is a more thorough version of the stellar-core /info endpoint's `fail-at` property, since the built-in version doesn't handle propagation of failures.

The algorithm will return an array of HaltingFailures, which have arrays of `vulnerableNodes` (the nodes which can go down and take our network with it) and `affectedNodes` (the nodes which get taken down along the way.

### usage
```ts
import { haltingAnalysis, NetworkGraphNode } from "@stellar/halting-analysis"

const nodes : NetworkGraphNode[] = await getJSON("http://stellar-core-host:11626/quorum?transitive=true&fullnodes=true"

// Search for any single node which could cause our network to halt if it goes down
const failures : HaltingFailure[] = haltingAnalysis(nodes, 1)

// Search for any combination of up to 3 nodes which could cause our node to halt if they all failed
const failures = haltingAnalysis(nodes, 3)

```

### type definitions

```ts
// Represents a failure case where a set of N nodes can take down your network
type HaltingFailure = {
  // The nodes which can go down and cause havoc
  vulnerableNodes: NetworkGraphNode[];
  // The nodes which will go down in response to the vulnerable nodes
  affectedNodes: NetworkGraphNode[];
};

// A QuorumSetGroup can be either a grouping of validators as a single
// quorum set, or a group of inner quorum sets
export type QuorumSet = {
  // Threshold, the number of validators that need to agree
  readonly t: number;
  // List of validators or subquorum sets
  readonly v: (string | QuorumSet)[];
};

export type NetworkGraphNode = {
  // How far that node is from the root node (ie. how many quorum set hops)
  // 0 means this is the node being administrated
  readonly distance: number;
  // The latest ledger sequence number that this node voted at
  readonly heard?: number;
  // The identity of the validator
  readonly node: string;
  // Quorum set.  Missing or unknown nodes will be undefined.
  readonly qset?: QuorumSet;
  // one of behind|tracking|ahead (compared to the root node) or missing|unknown (when there are no recent SCP messages for that node)
  readonly status: "behind" | "tracking" | "ahead" | "missing" | "unknown";
  // what the node is voting for
  readonly value?: string;
  // a unique ID for what the node is voting for (allows to quickly tell if nodes are voting for the same thing)
  readonly value_id?: number;
};

```