Comments (11)
Hi, you can use the API Method "rmnodes", but the method does remove only by node Id.
I think I will write another method to remove nodes by IP and will inform you.
from nkn.ovh.
How do I use "rmnodes" to delete nodes?
ps: server2 run "rmnodes"
from nkn.ovh.
Bro,I'm sorry,I don't understand the code
Can you teach me how to use it?Thank you
from nkn.ovh.
@ppoiissbsjksms
Please use the new method: "rmnodesbyip"
Example for cURL, application/x-www-form-urlencoded (multiple $IP must be splitted by comma):
curl -X POST \
-d 'Method=rmnodesbyip' \
-d 'NodesIp=$IP' \
-d 'Hash=$HASH' \
-H "Content-Type: application/x-www-form-urlencoded" \
https://nkn.ovh/api
Example for cURL, application/json:
curl -d '{"Method":"rmnodesbyip","Value":{"Hash":"$HASH", "NodesIp":["127.0.0.1", "127.0.0.2", "127.0.0.3"]}}' -H "Content-Type: application/json" https://nkn.ovh/api
from nkn.ovh.
Bro.Thank you very much
from nkn.ovh.
@ppoiissbsjksms
np.
Also you should update to the latest version.
from nkn.ovh.
yeah,I am updating
from nkn.ovh.
I think it's better to use the node ID than the node IP
from nkn.ovh.
I think it's better to use the node ID than the node IP
Then you will need send two POST requests and handling the result by a script:
The first:
curl -X POST \
-d 'Method=getmynodes' \
-d 'Hash=$HASH' \
-H "Content-Type: application/x-www-form-urlencoded" \
https://nkn.ovh/api
After the request you have to find ID....
We got response like this:
{"Method":"getmynodes","Code":0,"Error":false,"Value":{"List":[
{"IP": "127.0.0.1", "NodeId": 1, ...... a lot of information },
{"IP": "127.0.0.2", "NodeId": 2, ...... a lot of information },
{"IP": "127.0.0.3", "NodeId": 3, ...... a lot of information},
{"IP": "127.0.0.4", "NodeId": 4, ...... a lot of information}
]}}
If you have a script who handling JSON Array["Value"]["List"], then you will can try to use that.
Otherwise it's very uncomfortable.
The second request (remove a node by id):
curl -X POST \
-d 'Method=rmnodes' \
-d 'NodesId=$ID' \
-d 'Hash=$HASH' \
-H "Content-Type: application/x-www-form-urlencoded" \
https://nkn.ovh/api
from nkn.ovh.
Can I request the ID of an unmined node?
PS:
{"Method":"getmynodes","Code":0,"Error":false,"Value":{"List":[
{"IP": "127.0.0.1", "NodeId": 1, ...... a lot of information },
{"IP": "127.0.0.2", "NodeId": 2, ...... a lot of information },
{"IP": "127.0.0.3", "NodeId": 3, ...... a lot of information},
{"IP": "127.0.0.4", "NodeId": 4, ...... a lot of information}
]}}
So I can always replace them
from nkn.ovh.
You should parse the array manually.
I cannot write a function for each of your filtering.
API is created for programmers, it will not be difficult to parse the array manually.
https://github.com/bytestostring/nkn.ovh/blob/v1.1/API.md
from nkn.ovh.
Related Issues (17)
- about add nodes multiple HOT 2
- add chinaese HOT 3
- There is a problem with sorting names HOT 2
- Failed to add node using CURL HOT 6
- Use the API to get the ID of a node that is not working HOT 1
- running the app issue HOT 3
- DB size recomendations HOT 3
- Invalid NodeState problem HOT 11
- Add rmnodebyname or updatenodebyname method support HOT 2
- NKN 2.1.8 Error: Cannot decode json of the node response (getneighbor)
- Problems in operation HOT 2
- Reporting error HOT 3
- MariaDB unexpected EOF HOT 3
- y
- Using curl to add a node HOT 4
- run from arm problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nkn.ovh.