I've been poking around with using the NanSwap Banano Node as an RPC due to it's ability to generate work. However, it requires a custom Auth header of {"nodes-api-key": NODES_API_KEY}.
It looks like in RPC.py, this code block exists:
headers = {}
#add auth header, if exists
if self.auth:
headers['Authorization'] = self.auth
resp = requests.post(self.rpc_url, json=payload, headers=headers)
Which allows common auth headers like Bearer and JWT Tokens.
To get the NanSwap node to work, it looks like I need to submit a request with a custom header key, not Authorization.
The nano.js code has a parameter called customHeaders which allows custom key/val pairs to be set for auth headers. It would be great to have similar functionality here. Let me know your thoughts!
Hi @stjet!
I've been poking around with using the NanSwap Banano Node as an RPC due to it's ability to generate work. However, it requires a custom Auth header of {"nodes-api-key": NODES_API_KEY}.
It looks like in RPC.py, this code block exists:
Which allows common auth headers like Bearer and JWT Tokens.
To get the NanSwap node to work, it looks like I need to submit a request with a custom header key, not Authorization.
The nano.js code has a parameter called customHeaders which allows custom key/val pairs to be set for auth headers. It would be great to have similar functionality here. Let me know your thoughts!