-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request #13 from solana-developers/refactor-and-ad…
- Loading branch information
1 parent
3daa4f9
commit e159247
Showing
16 changed files
with
7,161 additions
and
13,811 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,4 @@ next-env.d.ts | |
|
||
# database files | ||
walletData.json | ||
ipData.json | ||
.env | ||
test-ledger | ||
ipData.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1 @@ | ||
# Solana Devnet Faucet with rate limiting | ||
|
||
This is the code for the [Solana Devnet Faucet](https://faucet.solana.com/) | ||
|
||
## Run tests | ||
|
||
``` | ||
npm run test | ||
``` | ||
|
||
Or to run a single test, for example: | ||
|
||
``` | ||
npx jest -t 'is a PDA' | ||
``` | ||
|
||
## Run locally for development | ||
|
||
You'll need an `.env` file with: | ||
|
||
``` | ||
FAUCET_KEYPAIR=[numbers...] | ||
POSTGRES_STRING="some string" | ||
``` | ||
|
||
And then run: | ||
|
||
``` | ||
npm run dev | ||
``` | ||
|
||
## Deploy | ||
|
||
Deploying is done automatically as soon as the code is committed onto master via Vercel. | ||
|
||
Vercel also needs these details: | ||
|
||
``` | ||
RPC_URL: "string" | ||
CLOUDFLARE_SECRET: "string" | ||
``` | ||
Solana Devnet Faucet with rate limiting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,6 @@ | ||
import { type ClassValue, clsx } from "clsx"; | ||
import { NextApiRequest } from "next"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
export function cn(...inputs: ClassValue[]) { | ||
return twMerge(clsx(inputs)); | ||
} | ||
|
||
export const getHeaderValues = (req: NextApiRequest, headerName: string) => { | ||
// Annoyingly, req.headers["x-forwarded-for"] can be a string or an array of strings | ||
// Let's just make it an array of strings | ||
let valueOrValues = req.headers[headerName] || []; | ||
if (Array.isArray(valueOrValues)) { | ||
return valueOrValues; | ||
} | ||
return [valueOrValues]; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.