Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-chain, multi-denom support for drip #2917

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ qypy
rabby
randao
rapide
rarray
ratelimit
ratelimited
rawfile
Expand Down Expand Up @@ -1069,6 +1070,7 @@ relpath
remappings
repellendus
repr
reqs
reqwest
resizer
restaking
Expand Down Expand Up @@ -1406,6 +1408,7 @@ viem
virtualisation
vjgsyknnhmr
vmdebug
vtab
vuex
wagmi
wakey
Expand Down
4 changes: 2 additions & 2 deletions drip/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ edition = { workspace = true }
license-file = { workspace = true }
name = "drip"
repository = { workspace = true }
version = "0.1.0"
version = "0.2.0"

[dependencies]
chain-utils = { workspace = true }
Expand All @@ -24,7 +24,7 @@ unionlabs = { workspace = true }

async-graphql = "7.0.6"
async-graphql-axum = "7.0.6"
async-sqlite = "0.2.2"
async-sqlite = { version = "0.2.2", features = ["bundled", "array", "vtab"] }
axum = "0.7.5"
recaptcha-verify = "0.1.5"
subtle-encoding = { workspace = true, features = ["bech32-preview"] }
Expand Down
32 changes: 31 additions & 1 deletion drip/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Drip

Faucet for Cosmos chains: [app.union.build/faucet]
Faucet for Cosmos chains: [app.union.build/faucet]. Supports multiple chains and multiple denoms per chains.

## Example usage

Commands are ran from repo root

Tab 1, Union Devnet:

```sh
nix run .#devnet-union -L

```

Tab 2, Stargaze Devnet (optional, multi-chain demo):

```sh
nix run .#devnet-stargaze -L
```

Tab 3, Drip:

```sh
nix run .#drip -- -c ./drip/config.json
```

Tab 4, Request:

```sh
cat ./drip/example-requests/union-devnet.json | http POST localhost:8000
cat ./drip/example-requests/stargaze-devnet.json | http POST localhost:8000
```

[app.union.build/faucet]: https://app.union.build/faucet
56 changes: 43 additions & 13 deletions drip/config.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,48 @@
{
"ws_url": "ws://localhost:26657/websocket",
"grpc_url": "http://localhost:9090",
"gas_config": {
"gas_price": "1.0",
"gas_denom": "muno",
"gas_multiplier": "1.1",
"max_gas": 40000000
},
"log_format": "text",
"secret": "invalid",
"bypass_secret": "helloworld",
"signer": "0xaa820fa947beb242032a41b6dc9a8b9c37d8f5fbcda0966b1ec80335b10a7d6f",
"faucet_denom": "muno",
"log_format": "text",
"amount": 13370,
"max_request_polls": 7,
"memo": "drip drop"
"chains": [
{
"id": "union-devnet-1",
"bech32_prefix": "union",
"memo": "drip drop greetings from union faucet",
"ws_url": "ws://localhost:26657/websocket",
"grpc_url": "http://localhost:9090",
"gas_config": {
"gas_price": "1.0",
"gas_denom": "muno",
"gas_multiplier": "1.1",
"max_gas": 40000000
},
"signer": "0xaa820fa947beb242032a41b6dc9a8b9c37d8f5fbcda0966b1ec80335b10a7d6f",
"coins": [
{
"denom": "muno",
"amount": 13370
}
]
},
{
"id": "stargaze-devnet-1",
"bech32_prefix": "stars",
"memo": "drip drop greetings from union faucet on stargaze",
"ws_url": "ws://localhost:26757/websocket",
"grpc_url": "http://localhost:9190",
"gas_config": {
"gas_price": "1.0",
"gas_denom": "ustars",
"gas_multiplier": "1.1",
"max_gas": 40000000
},
"signer": "0xaa820fa947beb242032a41b6dc9a8b9c37d8f5fbcda0966b1ec80335b10a7d6f",
"coins": [
{
"denom": "ustars",
"amount": 13370
}
]
}
]
}
9 changes: 9 additions & 0 deletions drip/example-requests/stargaze-devnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"query": "mutation UnoFaucetMutation($chain_id: String!, $denom: String!, $address: String!, $captchaToken: String!) { send(chainId: $chain_id, denom: $denom, address: $address, captchaToken: $captchaToken) }",
"variables": {
"chain_id": "stargaze-devnet-1",
"denom": "ustars",
"address": "stars1yt66vjvy3dp3m2e49tffvxe7vwf6qrukkj8ax6",
"captchaToken": "helloworld"
}
}
9 changes: 9 additions & 0 deletions drip/example-requests/union-devnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"query": "mutation UnoFaucetMutation($chain_id: String!, $denom: String!, $address: String!, $captchaToken: String!) { send(chainId: $chain_id, denom: $denom, address: $address, captchaToken: $captchaToken) }",
"variables": {
"chain_id": "union-devnet-1",
"denom": "muno",
"address": "union1m87a5scxnnk83wfwapxlufzm58qe2v65985exff70z95a2yr86yq7hl08h",
"captchaToken": "helloworld"
}
}
Loading
Loading