Closed marekyggdrasil closed 3 years ago
Goal of this issue is to test the get_status
API method.
get_status
API method.Output should match the example. Include all cURL requests and responses.
Include the exact version of your grin-node and also your environment.
uname -a
OS: Debian 10 \
Grin Node: grin 5.0.0-rc.2
\
System Info: Linux debian3 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux
$ cd grin-5.0.0-rc.2/target/release/
$ ./grin
get_status
API method$ curl -ugrin:$(cat ~/.grin/main/.api_secret) localhost:3413/v2/owner -d '{"jsonrpc": "2.0", "method": "get_status", "params": [], "id": 1}' -w "\n" -v
* Expire in 0 ms for 6 (transfer 0x55749ccfdf90)
* Expire in 1 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 0 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 1 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 0 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 0 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 1 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 0 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 0 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 1 ms for 1 (transfer 0x55749ccfdf90)
...
...
* Expire in 0 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 0 ms for 1 (transfer 0x55749ccfdf90)
* Expire in 0 ms for 1 (transfer 0x55749ccfdf90)
* Trying ::1...
* TCP_NODELAY set
* Expire in 150000 ms for 3 (transfer 0x55749ccfdf90)
* Expire in 200 ms for 4 (transfer 0x55749ccfdf90)
* connect to ::1 port 3413 failed: Connection refused
* Trying 127.0.0.1...
* TCP_NODELAY set
* Expire in 150000 ms for 3 (transfer 0x55749ccfdf90)
* Connected to localhost (127.0.0.1) port 3413 (#0)
* Server auth using Basic with user 'grin'
> POST /v2/owner HTTP/1.1
> Host: localhost:3413
> Authorization: Basic Z3Jpbjp6M0tCMEdNQUVrQ2I3SlRYTUN5Yw==
> User-Agent: curl/7.64.0
> Accept: */*
> Content-Length: 65
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 65 out of 65 bytes
< HTTP/1.1 200 OK
< access-control-allow-origin: *
< access-control-allow-headers: Content-Type, Authorization
< content-type: application/json
< content-length: 490
< date: Thu, 31 Dec 2020 21:58:14 GMT
<
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"Ok": {
"connections": 8,
"protocol_version": 1000,
"sync_status": "no_sync",
"tip": {
"height": 1026734,
"last_block_pushed": "0002190695e74c3d7cb93c9c95d87506fc5a8912436b7cd826a1c2475728ca77",
"prev_block_to_last": "0003caa5249843b4a2efd653fec210eee81bfa3c4bdc1bccf3636f7dbeee09fa",
"total_difficulty": 1738910833446705
},
"user_agent": "MW/Grin 5.0.0-rc.2"
}
}
* Connection #0 to host localhost left intact
}
The actual results matches the expected results, which is successfully getting the node status. It displays useful information about the node, network, and current sync status. The version of the node is v5.0.0-rc.2
and uses protocol version 1000
. It shows 8 as the number of peer connections that it has currently. The sync status of the testing node is at no_sync
having already fully synced the chain data while the node is running.
Thanks @goyle !
Description Goal of this issue is to test the get_status API method
Prerequisites
Test procedure
Expected result:
Output should match the example. Include all cURL requests and responses.
Include the exact version of your grin-node and also your environment