open-index/open-npm huggingface dataset:
npm package: @lightci/downloadr
Description: Downloadr is a tool to download files from the internet.
Latest version: 1.2.0

# Downloadr

[![](https://img.shields.io/npm/v/@lightci/downloadr)](https://www.npmjs.com/package/@lightci/downloadr)
[![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Downloadr is an http download manager that downloads files in parallel chunks and streams them to the file system.

## Installation

```bash
npm install @lightci/downloadr
```

## Basic Usage

```ts
import { Downloadr } from '@lightci/downloadr';

const downloadr = new Downloadr({
  url: 'https://example.com/file.zip',
  output: 'file.zip',
});

downloadr.on(DownloadrEvents.DOWNLOAD_START, () => {
  console.log('Download started');
});

downloadr.on(DownloadrEvents.DOWNLOAD_COMPLETE, () => {
  console.log('Download completed');
});

downloadr.on(DownloadrEvents.CHUNK_DOWNLOAD_PROGRESS, (chunk) => {
  console.log(`Downloaded chunk ${chunk.start} of ${chunk.end}`);
});

await downloadr.download();
```

## Options

| Option          | Type     | Default     | Description                                   |
| --------------- | -------- | ----------- | --------------------------------------------- |
| `url`           | `string` | `undefined` | **Required** The url of the file to download. |
| `output`        | `string` | `undefined` | **Required** The path to save the file to.    |
| `chunkCount`    | `number` | `3`         | The number of concurrent chunks to download.  |
| `highWaterMark` | `number` | `64 * 1024` | The size of the write buffer in bytes.        |

## Events

| Event                   | Description                          |
| ----------------------- | ------------------------------------ |
| DOWNLOAD_START          | Emitted when the download starts.    |
| DOWNLOAD_COMPLETE       | Emitted when the download completes. |
| CHUNK_DOWNLOAD_PROGRESS | Emitted when a chunk is downloaded.  |
| CHUNK_DOWNLOADED        | Emitted when a chunk is downloaded.  |
| CHUNK_DOWNLOAD_FAILED   | Emitted when a chunk download fails. |
| DOWNLOAD_FAILED         | Emitted when the download fails.     |

## Why Downloadr?

Downloadr is designed to download large files. It downloads files in parallel chunks and streams them to the file system. It uses the default HighWaterMark for the read and write streams to flush the buffer to the file system while maintaining a low memory footprint.

It does this by creating the file and writing to byte offsets based on the chunk size. This allows it to download large files without using too much memory, and without the need to download the entire file before starting to save it to the file system. It also ensures that you do not need to re-assemble the file on the file system, as the file is written in a contiguous manner.

## License

[MIT](https://opensource.org/licenses/MIT)
npm package: @lightcity/anycli
Description: AnyCLI: agent-friendly search/install for CLI tools.
Latest version: 0.0.3

# anycli

`anycli` is an agent-friendly CLI for discovering and installing command-line tools by **slug**.

## Install

```bash
npm i -g @lightcity/anycli
```

## Usage

```bash
anycli search <slug> --json
anycli install <slug> --json
anycli install <slug> --yes --json
```

For full docs, see the AnyCLI website `/docs`.
npm package: @lightclients/kevlar
Description: Light client-based RPC Proxy for PoS Ethereum
Author: Shresth Agrawal
Latest version: 0.4.2

# Kevlar

[![Join the chat at https://discord.gg/ePV3prSPGW](https://img.shields.io/badge/chat-on%20discord-blue.svg)](https://discord.gg/ePV3prSPGW)
![KevlarArchitecture](./kevlar-architecture.png)

Kevlar is a CLI tool to run a light client-based RPC Proxy for PoS Ethereum. Kevlar can be used to make your Metamask or any RPC-based wallet completely trustless! Kevlar first syncs to the latest header of the beacon chain and then starts an RPC server. This local RPC server can be added to MetaMask or any other RPC-based wallet. Every RPC call made by the wallet is now verified using Merkle Inclusion proofs to the latest block header. Currently Kevlar supports two kinds of sync methods: the **Light Sync** based on the light client sync protocol specified by the Ethereum Specification and the **Optimistic Sync** (which is 100x faster than Light Sync) based on construction from the research paper [Proofs of Proof of Stake in Sublinear Complexity](https://arxiv.org/abs/2209.08673).

### Start the RPC Proxy

```bash
npm i -g @lightclients/kevlar
kevlar
```

The RPC is now available at `http://localhost:8546`. Add this local network to MetaMask.

```bash
kevlar --help
Options:
      --help        Show help                                          [boolean]
      --version     Show version number                                [boolean]
  -n, --network     chain id to start the proxy on (1, 11155111)        [choices: 1, 11155111]
  -c, --client      type of the client          [choices: "light", "optimistic"]
  -o, --provers     comma separated prover urls
  -u, --rpc         rpc url to proxy
  -p, --port        port to start the proxy                             [number]
  -a, --beacon-api  beacon chain api URL
```

### Build Locally

Clone the repo and perform the following commands

```bash
yarn install
yarn build
```

### Run Server

```bash
cp .env.example .env
yarn start
```

### Deploy Server to Heroku

```bash
bash src/provers/light-optimistic/deploy-heroku.sh <heroku-app-name>
```

### Deploy to Docker

```bash
docker run -p 8546:8546 --name kevlar shresthagrawal/kevlar
curl -X POST --header "Content-type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:8546/
```
npm package: @lightclients/patronum
Description: Patronum: Ethereum RPC proxy that verifies RPC responses against given trusted block hashes
Author: Shresth Agrawal
Latest version: 0.3.2

# Patronum

Ethereum RPC proxy that verifies RPC responses against given trusted block hashes. Currently, most of the DAPPs and Wallets interact with Ethereum over RPC. Patronum can be used as a building block to build light clients that retrofit into the existing Ethereum infrastructure. This library mainly takes advantage of the `eth_getProof` RPC to perform merkle inclusion proofs for RPC call verification.

<div style='border-radius: 512px; width: 512px; height: 512px; overflow: hidden; margin: auto;'>
    <a title="frostnova, CC BY 2.0 &lt;https://creativecommons.org/licenses/by/2.0&gt;, via Wikimedia Commons" href="https://commons.wikimedia.org/wiki/File:Patronus.jpg"><img width="512" alt="Patronus" src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Patronus.jpg/512px-Patronus.jpg"></a> 
</div>

#### Start RPC Provider

```ts
import { VerifyingProvider, startServer } from 'patronum';

const provider = await VerifyingProvider.create(
  trustlessRPCURL,
  trustedBlockNumber,
  trustedBlockHash,
);
await startServer(provider, PORT);
```

#### Use VerifyingProvider

```ts
import { VerifyingProvider } from 'patronum';

const provider = await VerifyingProvider.create(
  trustlessRPCURL,
  trustedBlockNumber,
  trustedBlockHash,
);

console.log(await provider.getBalance(address, blockTag));

console.log(await provider.call(tx));
```

**The RPC URL provided to VerifyingProvider should support `eth_getProof` and `eth_createAccessList`. Infura doesn't support `eth_createAccessList`.**