1
0
Fork 0
mirror of https://github.com/romanz/electrs.git synced 2025-02-24 06:57:53 +01:00

Add health-check tool

This commit is contained in:
Roman Zeyde 2020-11-15 22:25:57 +02:00
parent e0eae37333
commit 5510740a02
No known key found for this signature in database
GPG key ID: 87CAE5FA46917CBB

15
contrib/health_check.py Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import argparse
import client
def main():
parser = argparse.ArgumentParser()
parser.add_argument("host")
parser.add_argument("port", type=int)
args = parser.parse_args()
conn = client.Client((args.host, args.port))
print(conn.call("server.version", "health_check", "1.4")["result"])
if __name__ == '__main__':
main()