diff --git a/stack-orchestrator/stacks/lotus-node/README.md b/stack-orchestrator/stacks/lotus-node/README.md index 7c99455..0fb78fe 100644 --- a/stack-orchestrator/stacks/lotus-node/README.md +++ b/stack-orchestrator/stacks/lotus-node/README.md @@ -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 ``` - -```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 - +- 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: - +```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 +```