Skip to content

Commit

Permalink
docs(faucet): add readme (#1534)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Sep 18, 2023
1 parent 24a0dd4 commit fa409e8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/twelve-monkeys-juggle.md
@@ -0,0 +1,5 @@
---
"@latticexyz/faucet": patch
---

Added README
30 changes: 30 additions & 0 deletions packages/faucet/README.md
@@ -0,0 +1,30 @@
# faucet

A minimal Typescript faucet to drip native tokens on Ethereum chains

## Usage

Install and run with:

```sh
npm install @latticexyz/faucet@next
npm faucet-server
```

or execute the package bin directly:

```sh
npx @latticexyz/faucet@next
```

## Configuration

The faucet can configured with the following environment variables:

| Variable | Description | Default |
| -------------------- | ----------------------------------------------------- | --------- |
| `HOST` | Host that the indexer server listens on | `0.0.0.0` |
| `PORT` | Port that the indexer server listens on | `3001` |
| `RPC_HTTP_URL` | HTTP URL for Ethereum RPC | |
| `FAUCET_PRIVATE_KEY` | Private key of wallet to distribute faucet funds from | |
| `DRIP_AMOUNT_ETHER` | Drip amount in ether |
4 changes: 1 addition & 3 deletions packages/faucet/bin/faucet-server.ts
Expand Up @@ -3,12 +3,10 @@ import "dotenv/config";
import { z } from "zod";
import fastify from "fastify";
import { fastifyTRPCPlugin } from "@trpc/server/adapters/fastify";
import { ClientConfig, http, parseEther, isHex, createClient } from "viem";
import { http, parseEther, isHex, createClient } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { AppRouter, createAppRouter } from "../src/createAppRouter";
import { getChainId } from "viem/actions";

// TODO: refine zod type to be either CHAIN_ID or RPC_HTTP_URL/RPC_WS_URL
const env = z
.object({
HOST: z.string().default("0.0.0.0"),
Expand Down

0 comments on commit fa409e8

Please sign in to comment.