Closed marekyggdrasil closed 3 years ago
grin server run
curl -ugrin:$(cat ~/.grin/main/.api_secret) localhost:3413/v2/owner -d '{"jsonrpc": "2.0", "method": "get_connected_peers", "params": [], "id": 1}' -w "\n" -v
* Trying 127.0.0.1...
* TCP_NODELAY set
* 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 Z3JpbjpNajJuNDFkUVcyN3Y3SXNtNjBiUw==
> User-Agent: curl/7.64.1
> Accept: */*
> Content-Length: 74
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 74 out of 74 bytes
< HTTP/1.1 200 OK
< access-control-allow-origin: *
< access-control-allow-headers: Content-Type, Authorization
< content-type: application/json
< content-length: 2340
< date: Fri, 01 Jan 2021 09:43:17 GMT
<
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"Ok": [
{
"addr": "78.47.206.120:3414",
"capabilities": {
"bits": 15
},
"direction": "Outbound",
"height": 1027437,
"total_difficulty": 1739045550555972,
"user_agent": "MW/Grin 5.0.0-rc.2",
"version": 1000
},
{
"addr": "139.99.37.158:3414",
"capabilities": {
"bits": 15
},
"direction": "Outbound",
"height": 1027425,
"total_difficulty": 1739043318215515,
"user_agent": "MW/Grin 5.0.0-rc.1",
"version": 1000
},
{
"addr": "39.96.171.125:3414",
"capabilities": {
"bits": 15
},
"direction": "Outbound",
"height": 1027437,
"total_difficulty": 1739045550555972,
"user_agent": "MW/Grin 4.0.1",
"version": 2
},
{
"addr": "45.153.187.189:3414",
"capabilities": {
"bits": 15
},
"direction": "Outbound",
"height": 1027437,
"total_difficulty": 1739045550555972,
"user_agent": "MW/Grin 4.1.1",
"version": 1000
},
{
"addr": "162.220.62.124:3414",
"capabilities": {
"bits": 15
},
"direction": "Outbound",
"height": 1027437,
"total_difficulty": 1739045550555972,
"user_agent": "MW/Grin 4.1.0",
"version": 1000
},
{
"addr": "178.196.7.116:3414",
"capabilities": {
"bits": 15
},
"direction": "Outbound",
"height": 1027437,
"total_difficulty": 1739045550555972,
"user_agent": "MW/Grin 4.1.1",
"version": 1000
},
{
"addr": "129.226.150.153:3414",
"capabilities": {
"bits": 15
},
"direction": "Outbound",
"height": 1027437,
"total_difficulty": 1739045550555972,
"user_agent": "MW/Grin 4.0.0",
"version": 2
},
{
"addr": "217.120.234.230:3414",
"capabilities": {
"bits": 15
},
"direction": "Outbound",
"height": 1027437,
"total_difficulty": 1739045550555972,
"user_agent": "MW/Grin 5.0.0-rc.1",
"version": 1000
}
]
}
* Connection #0 to host localhost left intact
}
* Closing connection 0
Looking good! Thanks!
Description Goal of this issue is to test the get_peers 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