Network Node
addNode
Add nodes to connect.
Params
- nodes : String - contains ip's and ports in format "ip1:port1;ip2:port2 ...". If port is not specified, use default
Result
- Returns an integer with nodes added
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"addNode","params":{"nodes":"8.8.8.8:9714;"},"id":123456}' http://localhost:8121
Response
{"result":2,"id":"123456","jsonrpc":"2.0"}
nodeStatus
Returns node status.
Params
- none
Result
- Returns a JSON Object with a "Node Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"nodeStatus","params":{},"id":123456}' http://localhost:8121
Response
{"result":{"ready":true,"ready_s":"","status_s":"Running","port":9714,"timestamp":1644158023,"version":"1.0","netprotocol":{"ver":1,"ver_a":2},"blocks":3162823,"datafolder":"/home/HyperChain","netstats":{"active":3,"clients":2,"servers":1,"servers_t":1,"total":722,"tclients":266,"tservers":456,"breceived":1420661550,"bsend":406192088,"ips":5},"nodeservers":[{"ip":"183.*.127.*","port":9714,"lastcon":1644158022,"attempts":0},{"ip":"*.166.204.*","port":9714,"lastcon":1644158019,"attempts":0}]},"id":"123456","jsonrpc":"2.0"}
getProtocolVersion
Returns node protocol version.
Params
- none
Result
- Returns a JSON Object with a "Network Protocol Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getProtocolVersion","id":123456}' http://localhost:8121
Response
{"result":{"netprotocol":{"ver":1,"ver_a":2}},"id":"123456","jsonrpc":"2.0"}
getNodeVersion
Returns application version.
Params
- none
Result
- Returns a JSON Object with application version.
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getNodeVersion","id":123456}' http://localhost:8121
Response
{"result":{"version":"1.0Wl64b"},"id":"123456","jsonrpc":"2.0"}
nodeStart
Starts the node and the server. Starts connection process.
Params
- none
Result
- Returns a Boolean
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"nodeStart","id":123456}' http://localhost:8121
Response
{"result":true,"id":"123456","jsonrpc":"2.0"}
nodeStop
Stops the node and the server. Closes all connections.
Params
- none
Result
- Returns a Boolean
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"nodeStop","id":123456}' http://localhost:8121
Response
{"result":true,"id":"123456","jsonrpc":"2.0"}
nodeSearch
Add p2p discovery node connect.
Params
- none
Result
- Returns a JSON Object with a "Node Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"nodeSearch","id":123456}' http://localhost:8121
Response
{"result":{"ready":true,"ready_s":"","status_s":"Running","port":9714,"timestamp":1644158023,"version":"1.0","netprotocol":{"ver":1,"ver_a":2},"blocks":3162823,"datafolder":"/home/HyperChain","netstats":{"active":3,"clients":2,"servers":1,"servers_t":1,"total":722,"tclients":266,"tservers":456,"breceived":1420661550,"bsend":406192088,"ips":5},"nodeservers":[{"ip":"183.*.127.*","port":9714,"lastcon":1644158022,"attempts":0},{"ip":"*.166.204.*","port":9714,"lastcon":1644158019,"attempts":0}]},"id":"123456","jsonrpc":"2.0"}
addBlacklist
Add the IP to the blacklist.
Params
- ip : String - IP Address
- why : String - Reasons for blacklisting (Option)
Result
- Returns a JSON Object with a "BlackList Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"addBlacklist","params":{"ip":"BlacklistIP","why":"BlacklistReason"},"id":123456}' http://localhost:8121
Response
{"result":{"blacklist":[{"ip":"121.*.*.*","port":9714,"LastConnection":"2022-07-22 10:41:45","reason":"Invalid operation: Autosend Operation:ERROR ERRCODE:2 ERROR:Your IP is blacklisted:183.*.*.*:50076"}],"total":1},"id":"123456","jsonrpc":"2.0"}
getBlacklist
Returns the list of Blacklist nodes.
Params
- none
Result
- Returns a JSON Object with a "BlackList Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getBlacklist","id":123456}' http://localhost:8121
Response
{"result":{"blacklist":[{"ip":"121.*.*.*","port":9714,"LastConnection":"2022-07-22 10:41:45","reason":"Invalid operation: Autosend Operation:ERROR ERRCODE:2 ERROR:Your IP is blacklisted:183.*.*.*:50076"}],"total":1},"id":"123456","jsonrpc":"2.0"}
clearBlacklist
Initialize the blacklist list of nodes.
Params
- none
Result
- Returns an integer with blacklist count.
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"clearBlacklist","id":123456}' http://localhost:8121
Response
{"result":4,"id":"123456","jsonrpc":"2.0"}
getConnection
Get information of the currently connected node.
Params
- none
Result
- Returns a JSON Array with a "Connection Object"
Example
Request
curl -X POST --data '{"jsonrpc":"2.0","method":"getConnection","id":123456}' http://localhost:8121
Response
{"result":{"connection":[{"server":false,"ip":"*.166.*.223","port":57825,"secs":103623,"sent":88888754,"recv":102550710,"appver":"1.0Wl64b","netver":1,"netver_a":2,"timediff":0},{"server":true,"ip":"183.*.127.*","port":9714,"secs":103557,"sent":87359335,"recv":90683762,"appver":"1.0Ll64b","netver":1,"netver_a":2,"timediff":-1}]},"id":"123456","jsonrpc":"2.0"}