You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.1 KiB

  1. # ADR 052: Tendermint Mode
  2. ## Changelog
  3. * 27-11-2019: Initial draft from ADR-051
  4. * 13-01-2020: Separate ADR Tendermint Mode from ADR-051
  5. ## Context
  6. - Fullnode mode: fullnode mode does not have the capability to become a validator.
  7. - Validator mode : this mode is exactly same as existing state machine behavior. sync without voting on consensus, and participate consensus when fully synced
  8. - Seed mode : lightweight seed mode maintaining an address book, p2p like [TenderSeed](https://gitlab.com/polychainlabs/tenderseed)
  9. ## Decision
  10. We would like to suggest a simple Tendermint mode abstraction. These modes will live under one binary, and when initializing a node the user will be able to specify which node they would like to create.
  11. - Which reactor, component to include for each node
  12. - fullnode *(default)*
  13. - switch, transport
  14. - reactors
  15. - mempool
  16. - consensus
  17. - evidence
  18. - blockchain
  19. - p2p/pex
  20. - rpc (safe connections only)
  21. - *~~no privValidator(priv_validator_key.json, priv_validator_state.json)~~*
  22. - validator
  23. - switch, transport
  24. - reactors
  25. - mempool
  26. - consensus
  27. - evidence
  28. - blockchain
  29.   - p2p/pex
  30. - rpc (safe connections only)
  31. - with privValidator(priv_validator_key.json, priv_validator_state.json)
  32. - seed
  33. - switch, transport
  34. - reactor
  35. - p2p/pex
  36. - Configuration, cli command
  37. - We would like to suggest by introducing `mode` parameter in `config.toml` and cli
  38. - <span v-pre>`mode = "{{ .BaseConfig.Mode }}"`</span> in `config.toml`
  39. - `tendermint node --mode validator` in cli
  40. - fullnode | validator | seed (default: "fullnode")
  41. - RPC modification
  42. - `host:26657/status`
  43. - return empty `validator_info` when fullnode mode
  44. - no rpc server in seed mode
  45. - Where to modify in codebase
  46. - Add switch for `config.Mode` on `node/node.go:DefaultNewNode`
  47. - If `config.Mode==validator`, call default `NewNode` (current logic)
  48. - If `config.Mode==fullnode`, call `NewNode` with `nil` `privValidator` (do not load or generation)
  49. - Need to add exception routine for `nil` `privValidator` to related functions
  50. - If `config.Mode==seed`, call `NewSeedNode` (seed version of `node/node.go:NewNode`)
  51. - Need to add exception routine for `nil` `reactor`, `component` to related functions
  52. ## Status
  53. Proposed
  54. ## Consequences
  55. ### Positive
  56. - Node operators can choose mode when they run state machine according to the purpose of the node.
  57. - Mode can prevent mistakes because users have to specify which mode they want to run via flag. (eg. If a user want to run a validator node, she/he should explicitly write down validator as mode)
  58. - Different mode needs different reactors, resulting in efficient resource usage.
  59. ### Negative
  60. - Users need to study how each mode operate and which capability it has.
  61. ### Neutral
  62. ## References
  63. - Issue [#2237](https://github.com/tendermint/tendermint/issues/2237) : Tendermint "mode"
  64. - [TenderSeed](https://gitlab.com/polychainlabs/tenderseed) : A lightweight Tendermint Seed Node.