Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@motorina0
Copy link
Collaborator

@motorina0 motorina0 commented Oct 15, 2024

Original Request: #2735

A new endpoint has been created: GET http://127.0.0.1:5000/api/v1/status
Request example:

curl --location 'http://127.0.0.1:5000/api/v1/status' \
--header 'x-api-key: 7ca987071ab847d3b7676d71ed5dc12d'

This endpoint requires the invoice key of a user.
Different responses are returned depending if the invoice key belongs to an admin user or not.

Response for regular user (non admin):

{
    "server_time": 1728985995,
    "up_time": 209,
    "version": "1.0.0rc4"
}

Response for admin:

  • when the funding source is connected:
{
    "server_time": 1728986208,
    "up_time": 47,
    "version": "1.0.0rc4",
    "funding_source": "LNbitsWallet",
    "funding_source_error": null,
    "funding_source_balance_msat": 3105756
}
  • when the funding source has an issue:
{
   "server_time": 1728986321,
   "up_time": 17,
   "version": "1.0.0rc4",
   "funding_source": "LNbitsWallet",
   "funding_source_error": "Unable to connect to https://demo.lnbits.com.",
   "funding_source_balance_msat": 0
}
  • when the connection to the funding source failed on start-up (and defaulted to VoidWallet):
{
    "server_time": 1728985819,
    "up_time": 33,
    "version": "1.0.0rc4",
    "funding_source": "VoidWallet",
    "funding_source_error": null,
    "funding_source_balance_msat": 0
}

@codecov
Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 31.57895% with 13 lines in your changes missing coverage. Please review.

Project coverage is 59.48%. Comparing base (ecc62b0) to head (c255e07).
Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
lnbits/core/views/api.py 31.57% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2736      +/-   ##
==========================================
- Coverage   59.52%   59.48%   -0.05%     
==========================================
  Files          79       79              
  Lines       11606    11624      +18     
==========================================
+ Hits         6908     6914       +6     
- Misses       4698     4710      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Opago-Pay
Copy link

Wow…. that was quick.

@motorina0 motorina0 merged commit 3b503ea into dev Oct 15, 2024
31 of 32 checks passed
@motorina0 motorina0 deleted the server_status_check branch October 15, 2024 11:53
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

Successfully merging this pull request may close these issues.

4 participants