Skip to content

Commit 8375baf

Browse files
author
Simon Goldberg
committed
added load balancer rpc instructions
1 parent 384f333 commit 8375baf

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

lib/xrp/README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,30 @@ pwd
126126
npx cdk deploy XRP-ha-nodes --json --outputs-file ha-nodes-deploy.json
127127
```
128128

129-
2. Give the new nodes time to initialize
129+
2. Give the new nodes time to initialize
130+
131+
3. To perform an RPC request to your load balancer, run the following command to retrieve the ALB URL:
132+
133+
```bash
134+
export XRP_RPC_ALB_URL=$(cat ha-nodes-deploy.json | jq -r '..|.alburl? | select(. != null)')
135+
echo XRP_RPC_ALB_URL=$XRP_RPC_ALB_URL
136+
```
137+
138+
Copy output from the last `echo` command with `XRP_RPC_ALB_URL=<alb_url>` and open [CloudShell tab with VPC environment](https://docs.aws.amazon.com/cloudshell/latest/userguide/creating-vpc-environment.html) to access internal IP address space. Paste `XRP_RPC_ALB_URL=<alb_url>` into the VPC CloudShell tab.
139+
140+
Then query the load balancer to retrieve the current block height:
141+
142+
```bash
143+
curl -X POST -H "Content-Type: application/json" http://$XRP_RPC_ALB_URL:6005/ -d '{
144+
"method": "ledger_current",
145+
"params": [{}]
146+
```
147+
148+
You will get a response similar to this:
149+
150+
```json
151+
{"result":{"ledger_current_index":5147300,"status":"success"}}
152+
```
130153
131154
> **NOTE:** *By default and for security reasons the load balancer is available only from within the default VPC in the region where it is deployed. It is not available from the Internet and is not open for external connections. Before opening it up please make sure you protect your RPC APIs.*
132155

0 commit comments

Comments
 (0)