Add steps to check lotus node status

This commit is contained in:
Nabarun 2024-05-23 15:17:32 +05:30
parent 0177fff7d6
commit 4ed4491e00

View File

@ -20,11 +20,6 @@ $ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node set
$ laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node build-containers
```
<!-- FOR test -->
```bash
laconic-so --stack ~/cerc/lotus-stack/stack-orchestrator/stacks/lotus-node deploy up
```
## Create a deployment
```bash
@ -40,7 +35,36 @@ $ laconic-so deployment --dir lotus-node-deployment up
## Check status
<!-- TODO -->
- Check if container is healthy
```
docker ps | grep lotus
```
NOTE: Starting node for the first time takes time (~20 mins) as it downloads latest snapshot and imports it
- Get latest block using CURL
```
curl -X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["latest", false],
"id": 1
}' \
http://localhost:1234/rpc/v1
```
- To check whether Lotus node has synced till head
```bash
laconic-so deployment --dir lotus-node-deployment exec lotus "lotus sync wait"
# lotus sync wait
# Worker: 78534; Base: 2403099; Target: 2403099 (diff: 0)
# State: message sync; Current Epoch: 2403099; Todo: 0
# Done!
```
When the lotus sync wait command shows done you are fully synced with the chain
## Clean up
@ -50,6 +74,12 @@ Stop all services running in the background:
$ laconic-so deployment --dir lotus-node-deployment down
```
Clear volumes created by this stack:
To stop all services and also delete data:
<!-- TODO -->
```bash
# Stop the docker containers
$ laconic-so deployment --dir lotus-node-deployment down --delete-volumes
# Remove deployment directory (deployment will have to be recreated for a re-run)
$ rm -r lotus-node-deployment
```