LND api not working as anticipated

on

|

views

and

comments


I’m working an lnd node and when utilizing command line i will pay an bill, however once I do it by way of my api I get two outcomes once I print the request, one saying failure_reason_none and one failure_reason_no_route, so it appears api is sending 2 funds makes an attempt on the identical time however I do not know why that’s occurring. The error being returned from the API: requests.exceptions.JSONDecodeError: Further knowledge: line 2 column 1 (char 827)

My view.py:

class Ship(APIView):
    def put up(self, request):
        url = f"https:myurl.com:8080/v2/router/ship"
        TLS_PATH = "tls.cert"
        print(TLS_PATH)
        macaroon = join.encoded_hex
        headers = {"Grpc-Metadata-macaroon": macaroon}
        knowledge = {
            "payment_request": request.knowledge["payment_request"],
            "timeout_seconds": request.knowledge["timeout_seconds"],
        }
        r = requests.put up(
            url, headers=headers, stream=True, knowledge=json.dumps(knowledge), confirm=TLS_PATH
        )
        if r.status_code == 200:
            knowledge = r.json()
            return Response(knowledge, standing=standing.HTTP_200_OK)
        return Response({"error": "Request failed"}, standing=r.status_code)

my urls.py

urls.py
urlpatterns = [
    path("admin/", admin.site.urls),
    path("v1/", include("API.urls")),
    path("v2/", include("API.urls")),
]
urls.py
    path("router/ship", Ship.as_view()),

and that i despatched this request from postman on http://127.0.0.1:8000/v2/router/ship:

{
"payment_request":"<payment_req_from_phoenix_wallet>",
"timeout_seconds":6,
"outgoing_chan_ids":["856173212061597696"]
}

Thanks upfront for the assistance.

Share this
Tags

Must-read

Self-driving taxis are coming to London – ought to we be anxious? | Jack Stilgoe

At the top of the nineteenth century, the world’s main cities had an issue. The streets had been flooded with manure, the unintended...

US regulators open inquiry into Waymo self-driving automobile that struck youngster in California | Expertise

The US’s federal transportation regulator stated Thursday it had opened an investigation after a Waymo self-driving car struck a toddler close to an...

US robotaxis bear coaching for London’s quirks earlier than deliberate rollout this yr | London

American robotaxis as a consequence of be unleashed on London’s streets earlier than the tip of the yr have been quietly present process...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here