A mobile app running on Android and iOS to manage multiple IOTA Nodes on the go! Supporting Hornet and Bee nodes.
Find out more here: https://iota-node-manager.devster-hh.de/
Try to execute the following cURL command. Make sure to replace NODE_URL and JWT_TOKEN with the correct values
curl --location --request GET 'https://NODE_URL/api/v1/peers' --header 'Authorization: Bearer JTW_TOKEN'
The following responses can be expected:
- HTTP 200, with a JSON object containing all existing peers
- HTTP 401 Not authorized - The JWT Token is not valid. Make sure it was generated correctly.
In case of 2. it could also be a problem with the reverse proxy configuration on your server. Due to security concerns when not using JWT_AUTH on your node some setup guides blocked crucial API endpoints within the reverse proxy.
Here is an example of a NGINX conf that is blocking the peer endpoint:
upstream hornet_api {
server 127.0.0.1:14265;
}
# hornet api
location ~ ^/api/v1/(info|tips|messages|treasury|transactions|milestones|outputs|addresses) {
limit_req zone=hornet_api burst=25;
default_type application/json;
auth_basic off;
proxy_pass http://hornet_api;
}
If that is the case make sure to adjust it accordingly. One simple example would be the following which is totally fine if JWT_AUTH is enabled for the node.
upstream hornet_api {
server 127.0.0.1:14265;
}
location /api/v1 {
limit_req zone=hornet_api burst=25;
default_type application/json;
auth_basic off;
proxy_pass http://hornet_api;
}
To make sure you redirect to the correct internal address verify the bindAddress in the node main config (see below one example configuration of the restApi block.
...
"restAPI": {
"jwtAuth": {
"enabled": true,
"salt": "HORNET"
},
"excludeHealthCheckFromAuth": false,
"permittedRoutes": [
"/health",
"/mqtt",
"/api/v1/info",
"/api/v1/tips",
"/api/v1/messages/:messageID",
"/api/v1/messages/:messageID/metadata",
"/api/v1/messages/:messageID/raw",
"/api/v1/messages/:messageID/children",
"/api/v1/messages",
"/api/v1/transactions/:transactionID/included-message",
"/api/v1/milestones/:milestoneIndex",
"/api/v1/milestones/:milestoneIndex/utxo-changes",
"/api/v1/outputs/:outputID",
"/api/v1/addresses/:address",
"/api/v1/addresses/:address/outputs",
"/api/v1/addresses/ed25519/:address",
"/api/v1/addresses/ed25519/:address/outputs",
"/api/v1/treasury"
],
"whitelistedAddresses": [
"127.0.0.1",
"::1"
],
"bindAddress": "0.0.0.0:14265",
"powEnabled": true,
"powWorkerCount": 1,
"limits": {
"bodyLength": "1M",
"maxResults": 1000
}
},
...
It depends on how you installed the node.
- (A) APT: run the following command
./hornet tool jwt-api
- (B) Nuriel Playbook: https://github.com/nuriel77/hornet-playbook#get-jwt-token
- (C) Swarm: Go to Hornet Configuration, select JWT in the menu and generate a new Token.
Unfortunately this requires you to temporary shutdown the node before generating it.
- Improve test coverage
- Add improved documentation
- Improve readme
- Improve CI/CD