Skip to content

Commit 384f333

Browse files
author
Simon Goldberg
committed
added instructions for performing single node rpc request
1 parent 23e63ad commit 384f333

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

lib/xrp/README.md

+31
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,37 @@ npx cdk deploy XRP-single-node --json --outputs-file single-node-deploy.json
8585
- Navigate to [CloudWatch service](https://console.aws.amazon.com/cloudwatch/) (make sure you are in the region you have specified for `AWS_REGION`)
8686
- Open `Dashboards` and select dashboard that starts with `XRP-single-node` from the list of dashboards.
8787

88+
3. Once the initial synchronization is done, you should be able to access the RPC API of that node from within the same VPC. The RPC port is not exposed to the Internet. Run the following query against the private IP of the single RPC node you deployed:
89+
90+
```bash
91+
export INSTANCE_ID=$(cat single-node-deploy.json | jq -r '.["XRP-single-node"].nodeinstanceid')
92+
NODE_INTERNAL_IP=$(aws ec2 describe-instances --instance-ids $INSTANCE_ID --query 'Reservations[*].Instances[*].PrivateIpAddress' --output text)
93+
echo "NODE_INTERNAL_IP=$NODE_INTERNAL_IP"
94+
```
95+
96+
Copy output from the last `echo` command with `NODE_INTERNAL_IP=<internal_IP>` 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 `NODE_INTERNAL_IP=<internal_IP>` into the new CloudShell tab.
97+
98+
Then query the RPC API to receive the latest block height:
99+
100+
``` bash
101+
# IMPORTANT: Run from CloudShell VPC environment tab
102+
curl -X POST -H "Content-Type: application/json" http://$NODE_INTERNAL_IP:6005/ -d '{
103+
"method": "ledger_current",
104+
"params": [{}]
105+
}'
106+
```
107+
You will get a response similar to this:
108+
109+
```json
110+
{"result":{"ledger_current_index":5147254,"status":"success"}}
111+
```
112+
113+
Note: If the node is still syncing, you will receive the following response:
114+
115+
```json
116+
{"result":{"error":"noNetwork","error_code":17,"error_message":"Not synced to the network.","request":{"command":"ledger_current"},"status":"error"}}
117+
```
118+
88119
### Deploy HA Nodes
89120

90121
1. Deploy multiple HA Nodes

0 commit comments

Comments
 (0)