Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to handle waiting for "ready" after start? #148

Open
futurepaul opened this issue Apr 22, 2022 · 3 comments
Open

How to handle waiting for "ready" after start? #148

futurepaul opened this issue Apr 22, 2022 · 3 comments

Comments

@futurepaul
Copy link

Was trying to use nigiri in a script and the lightning faucet was failing. Turns out the problem is I was calling nigiri faucet cln 1 too quickly after start, and something wasn't actually ready yet to accomplish that.

Not sure best solution to this. Possibly an endpoint to poll for "ready" before continuing the script? Or perhaps best move is I just poll the relevant components myself and continue once I know they're ready.

@tiero
Copy link
Member

tiero commented Apr 22, 2022

we do something like the bash script below or just an quick & dirty sleep 3 should work :)

function waitForNode () {
  while true; do
    if $1 getblockchaininfo 2>&1 | grep blocks > /dev/null 2>&1; then
      break	
    fi
    sleep 1
  done  
}

@tiero
Copy link
Member

tiero commented Apr 22, 2022

But we can offer a HTTP endpoint like /ready https://github.com/vulpemventures/nigiri-chopsticks that does this for you if you prefer

@futurepaul
Copy link
Author

we'll try out your bash script technique and I'll let you know if it doesn't work, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants