Anton Kaliaev
dc0e8de9b0
extract some of the consensus types into ./types
...
so they can be used in rpc/core/types/responses.go.
```
So, it seems like we could use the actual structs here, but we don't want to have to import consensus to get them, as then clients are importing too much crap. So probably we should move some types from consensus into consensus/types so we can import.
Will these raw messages be identical to:
type ResultDumpConsensusState struct {
RoundState cstypes.RoundState
PeerRoundStates map[string]cstypes.PeerRoundState
}
```
https://github.com/tendermint/tendermint/pull/724#discussion_r143598193
2017-10-10 12:39:21 +04:00
Anton Kaliaev
d6a87d3c43
[rpc] DumpConsensusState: output state as json rather than string
...
Before:
```
{
"jsonrpc": "2.0",
"id": "",
"result": {
"round_state": "RoundState{\n H:10 R:0 S:RoundStepNewHeight\n StartTime: 2017-10-09 13:07:24.841134374 +0400 +04\n CommitTime: 2017-10-09 13:07:23.841134374 +0400 +04\n Validators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n Proposal: \u003cnil\u003e\n ProposalBlock: nil-PartSet nil-Block\n LockedRound: 0\n LockedBlock: nil-PartSet nil-Block\n Votes: HeightVoteSet{H:10 R:0~0\n VoteSet{H:10 R:0 T:1 +2/3:\u003cnil\u003e BA{1:_} map[]}\n VoteSet{H:10 R:0 T:2 +2/3:\u003cnil\u003e BA{1:_} map[]}\n }\n LastCommit: VoteSet{H:9 R:0 T:2 +2/3:947F67A7B85439AF2CD5DFED376C51AC7BD67AEE:1:365E9983E466 BA{1:X} map[]}\n LastValidators: ValidatorSet{\n Proposer: Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n Validators:\n Validator{EF243CC0E9B88D0161D24D733BDE9003518CEA27 {PubKeyEd25519{2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202}} VP:10 A:0}\n }\n}",
"peer_round_states": []
}
}
```
After:
```
{
"jsonrpc": "2.0",
"id": "",
"result": {
"round_state": {
"Height": 1691,
"Round": 0,
"Step": 1,
"StartTime": "2017-10-09T14:08:09.129491764+04:00",
"CommitTime": "2017-10-09T14:08:08.129491764+04:00",
"Validators": {
"validators": [
{
"address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27",
"pub_key": {
"type": "ed25519",
"data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202"
},
"voting_power": 10,
"accum": 0
}
],
"proposer": {
"address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27",
"pub_key": {
"type": "ed25519",
"data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202"
},
"voting_power": 10,
"accum": 0
}
},
"Proposal": null,
"ProposalBlock": null,
"ProposalBlockParts": null,
"LockedRound": 0,
"LockedBlock": null,
"LockedBlockParts": null,
"Votes": {},
"CommitRound": -1,
"LastCommit": {},
"LastValidators": {
"validators": [
{
"address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27",
"pub_key": {
"type": "ed25519",
"data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202"
},
"voting_power": 10,
"accum": 0
}
],
"proposer": {
"address": "EF243CC0E9B88D0161D24D733BDE9003518CEA27",
"pub_key": {
"type": "ed25519",
"data": "2E0B9301334FCDAB193D514022F81BA09BBEC028685C96602BE9DD0BD4F9E202"
},
"voting_power": 10,
"accum": 0
}
}
},
"peer_round_states": {
"75EC8F15D244A421202F9725CD4DE509EE50303670310CF7530EF25E2B7C524B": {
"Height": 1691,
"Round": 0,
"Step": 1,
"StartTime": "2017-10-09T14:08:08.563251997+04:00",
"Proposal": false,
"ProposalBlockPartsHeader": {
"total": 0,
"hash": ""
},
"ProposalBlockParts": null,
"ProposalPOLRound": -1,
"ProposalPOL": null,
"Prevotes": null,
"Precommits": null,
"LastCommitRound": 0,
"LastCommit": null,
"CatchupCommitRound": -1,
"CatchupCommit": null
}
}
}
}
```
2017-10-09 14:09:26 +04:00
Anton Kaliaev
a3adac3787
[rpc] do not try to parse params if they were not provided (Refs #708 )
2017-10-09 13:30:52 +04:00
Anton Kaliaev
3702cb7e7c
restore rpc/lib readme as doc.go (Refs #710 ) [ci skip]
...
I don't want to lose any documentation. Correct me if I am wrong, but we
don't have this docs anywhere else.
2017-10-05 11:44:02 +04:00
Zach Ramsay
136b6a7673
rpc/lib: remove dead files, closes #710
2017-10-04 17:45:15 -04:00
Zach Ramsay
d56b44f3a5
all: no more anonymous imports
2017-10-04 16:40:45 -04:00
Anton Kaliaev
45ff7cdd0c
rewrite ws client to expose a callback instead of a channel
...
callback gives more power to the publisher. plus it is optional
comparing to a channel, which will block the whole client if you won't
read from it.
2017-10-02 13:00:20 -04:00
Alexandre Thibault
ce36a0111a
rpc: subscribe on reconnection ( #689 )
...
* rpc: subscribe on reconnection
* rpc: fix unit tests
2017-10-02 13:00:20 -04:00
Martin Dyring-Andersen
b61f5482d4
Fix broken reference to ABCI
2017-10-02 13:00:20 -04:00
Alexandre Thibault
382bead548
rpc: fix client websocket timeout ( #687 )
2017-09-29 13:32:30 +04:00
Anton Kaliaev
f9479b34cb
sleep time should be greater than readTimeout (5 sec)
...
otherwise, we're not testing ping/pongs.
see https://github.com/tendermint/tendermint/pull/687#issuecomment-332494735
2017-09-27 15:44:19 +04:00
Ethan Buchman
8311f5c611
abci.Info takes a struct; less merkleeyes
2017-09-22 11:42:40 -04:00
Ethan Buchman
ddb3d8945d
p2p: allow listener with no external connection
2017-09-22 10:13:23 -04:00
Ethan Buchman
779c2a22d0
node: NewNode takes DBProvider and GenDocProvider
2017-09-21 15:54:33 -04:00
Ethan Buchman
4382c8d28b
fix tests
2017-09-21 15:52:25 -04:00
Adrian Brink
7dd3c007c7
Refactor priv_validator
...
Users can now just pass an object that implements the Signer interface.
2017-09-21 15:50:43 -04:00
Ethan Buchman
3089bbf2b8
Amount -> Power. Closes #166
2017-09-21 14:59:27 -04:00
Anton Kaliaev
f8b152972f
return method not found error
...
if somebody tries to access WS method in non-ws context
2017-09-18 16:36:03 -04:00
Anton Kaliaev
95875c55fc
ID must be present in both request and response
...
from the spec:
This member is REQUIRED.
It MUST be the same as the value of the id member in the Request Object.
If there was an error in detecting the id in the Request object (e.g. Parse error/Invalid Request), it MUST be Null.
2017-09-18 16:36:03 -04:00
Anton Kaliaev
7fadde0b37
check for request ID after receiving it
2017-09-18 16:36:03 -04:00
Anton Kaliaev
e36c79f713
capitalize RpcError
2017-09-18 16:36:03 -04:00
Anton Kaliaev
b700ed8e31
remove check for non-empty message as it should always be present
2017-09-18 16:36:03 -04:00
Anton Kaliaev
f74de4cb86
include optional data field in error object
...
```
data
A Primitive or Structured value that contains additional information about the error.
This may be omitted.
The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).
```
2017-09-18 16:36:02 -04:00
Anton Kaliaev
6c1572c9b8
fix invalid memory address or nil pointer dereference
2017-09-18 16:36:02 -04:00
Dave Bryson
60a1f49a5c
updated json response to match spec by @davebryson
2017-09-18 16:35:50 -04:00
Ethan Buchman
aea8629272
peer interface
2017-09-15 18:40:59 -04:00
Ethan Buchman
ec3c91ac14
Merge pull request #618 from tendermint/historical_validators
...
Historical validators
2017-09-06 01:46:31 -04:00
Ethan Buchman
cc2b418f7f
p2p: test fix
2017-09-05 17:10:11 -04:00
Ethan Buchman
9deb647303
fixes from review
2017-09-04 18:29:51 -04:00
Ethan Buchman
f0f1ebe013
rpc: Block and Commit take pointers; return latest on nil
2017-09-03 16:07:37 -04:00
Ethan Buchman
e2e8746044
rpc: historical validators
2017-09-03 16:07:37 -04:00
Ethan Buchman
f2349b1092
Merge pull request #526 from tendermint/feature/rpc-docs
...
RPC docs
2017-08-25 18:10:21 -04:00
Ethan Buchman
83048fb2fe
Merge pull request #604 from tendermint/bugfix/ws-io-timeout
...
Biff up RPC WSClient
2017-08-25 17:59:34 -04:00
Ethan Buchman
9dde1a0bd4
rpc: comments
2017-08-25 17:57:09 -04:00
Zach Ramsay
b3796e0aaa
rpc: typo fixes
2017-08-16 15:18:55 -04:00
Anton Kaliaev
d24083b257
generate md for Slate
2017-08-16 15:17:08 -04:00
Anton Kaliaev
83ec9f773a
wrote docs for rpc methods [ci skip]
...
for all of them except unsafe
2017-08-16 15:17:08 -04:00
Anton Kaliaev
2fd8496bc1
correct handling of pings and pongs
...
server:
- always has read & write timeouts
- ping handler never blocks the reader (see A)
- sends regular pings to check up on a client
A:
at some point server write buffer can become full, so in order not to
block reads from a client (see
https://github.com/gorilla/websocket/issues/97 ), server may skip some
pongs. As a result, client may disconnect. But you either have to do
that or block the reader. There is no third way.
client:
- optional read & write timeouts
- optional ping/pong to measure latency
2017-08-10 17:53:49 -04:00
Ethan Buchman
49278a7f9c
Merge pull request #579 from tendermint/feature/sync_status
...
Add fast-sync status to Status() call
2017-08-09 23:51:25 -04:00
Ethan Buchman
b0728260e9
comments
2017-08-09 23:51:09 -04:00
Anton Kaliaev
236489aecf
backlog must always have higher priority
2017-08-08 19:03:48 -04:00
Ethan Buchman
797acbe911
ws: small comment
2017-08-08 17:33:17 -04:00
Anton Kaliaev
9b5f21a650
[ws-server] reset readTimeout when we receive something
2017-08-08 16:03:04 -04:00
Anton Kaliaev
8267920749
[ws-client] write normal close message
2017-08-08 16:02:37 -04:00
Anton Kaliaev
6c85e4be4f
change server ping period to be less frequent
...
no need to ping ws every 10 sec
2017-08-08 13:21:59 -04:00
Anton Kaliaev
23a87304cc
add a comment for PingPongLatencyTimer [ci skip]
2017-08-08 13:20:58 -04:00
Anton Kaliaev
c14b39da5f
make RPC server's ping period and pong wait configurable via options
2017-08-07 18:29:55 -04:00
Anton Kaliaev
57eee2466b
make WSClient thread-safe
2017-08-07 17:56:38 -04:00
Anton Kaliaev
5d66d1c28c
fixes from review
2017-08-05 13:11:00 -04:00
Anton Kaliaev
0013053fae
allow to change pong wait and ping period
2017-08-04 10:42:55 -04:00