Skip to content

Commit 669a14f

Browse files
cratelynconorsch
authored andcommitted
readme: 📜 add serve-rpc instructions
1 parent 7533969 commit 669a14f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

+42
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,48 @@ We perform these updates on best-effort basis, so it's OK if the updates lag som
6363
Ideally we'd automate the process (https://github.com/penumbra-zone/galileo/issues/17),
6464
but until then, we'll perform it manually, say, every other testnet.
6565

66+
## 🔭 Running as a gRPC service
67+
68+
Galileo can be run as a gRPC service, using the `serve-rpc` command. This endpoint supports
69+
reflection, and automatic HTTPS.
70+
71+
```sh
72+
# As galileo, run the RPC service, over plaintext on `localhost:8080`.
73+
cargo run --release -- serve-rpc --account-count=1 1penumbra
74+
```
75+
76+
`grpcurl` can be used to inspect what RPCs are available:
77+
78+
```sh
79+
; grpcurl -plaintext localhost:8080 list
80+
```
81+
82+
A request that the faucet send funds to your address can be made using `grpcurl`, like so:
83+
84+
```sh
85+
# Run `pcli` to acquire a wallet address.
86+
; ADDRESS=$(PCLI_UNLEASH_DANGER=1 pcli view address)
87+
88+
# Call the RPC over plaintext, providing the address:
89+
; grpcurl -plaintext -d @ localhost:8080 galileo.faucet.v1.FaucetService.SendFunds <<EOM
90+
{
91+
"address": {
92+
"alt_bech32m": "$ADDRESS"
93+
}
94+
}
95+
EOM
96+
```
97+
98+
Alternatively, Rust programs use the facilities in `galileo::proto` to construct a client that can
99+
send requests to the faucet service.
100+
101+
Use `--grpc-auto-https` to configure an HTTPS domain, provisioning certificates via LetsEncrypt.
102+
When configuring TLS certificates, it may be wise to use the `--acme-staging` option, to prevent
103+
being rate-limited by the LetsEncrypt API.
104+
105+
**NOTE:** be careful not to expose this RPC on the public internet without proper
106+
authentication.
107+
66108
## Re-deploying after a testnet release
67109
When we deploy a new testnet, we must bounce Galileo to keep the faucet working.
68110
The steps are:

0 commit comments

Comments
 (0)