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.0 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. # Tendermint Socket Protocol (TMSP)
  2. Blockchains are a system for creating shared multi-master application state.
  3. **TMSP** is a socket protocol enabling a blockchain consensus engine, running in one process,
  4. to manage a blockchain application state, running in another.
  5. For more information on TMSP, motivations, and tutorials, please visit [our blog post](http://tendermint.com/posts/tendermint-socket-protocol/).
  6. ## Message types
  7. #### AppendTx
  8. * __Arguments__:
  9. * `TxBytes ([]byte)`
  10. * __Returns__:
  11. * `Code (int8)`
  12. * `Result ([]byte)`
  13. * `Log (string)`
  14. * __Usage__:<br/>
  15. Append and run a transaction. The transaction may or may not be final.
  16. #### CheckTx
  17. * __Arguments__:
  18. * `TxBytes ([]byte)`
  19. * __Returns__:
  20. * `Code (int8)`
  21. * `Result ([]byte)`
  22. * `Log (string)`
  23. * __Usage__:<br/>
  24. Validate a transaction. This message should not mutate the state.
  25. #### GetHash
  26. * __Returns__:
  27. * `Hash ([]byte)`
  28. * `Log (string)`
  29. * __Usage__:<br/>
  30. Return a Merkle root hash of the application state
  31. #### Flush
  32. * __Usage__:<br/>
  33. Flush the response queue. Applications that implement `types.Application` need not implement this message -- it's handled by the project.
  34. #### Info
  35. * __Returns__:
  36. * `Data ([]string)`
  37. * __Usage__:<br/>
  38. Return an array of strings about the application state. Application specific.
  39. #### SetOption
  40. * __Arguments__:
  41. * `Key (string)`
  42. * `Value (string)`
  43. * __Returns__:
  44. * `Log (string)`
  45. * __Usage__:<br/>
  46. Set application options. E.g. Key="mode", Value="mempool" for a mempool connection, or Key="mode", Value="consensus" for a consensus connection.
  47. Other options are application specific.
  48. ## Changelog
  49. ### Jan 23th, 2016
  50. * Added CheckTx/Query TMSP message types
  51. * Added Result/Log fields to AppendTx/CheckTx/SetOption
  52. * Removed Listener messages
  53. * Removed Code from ResponseSetOption and ResponseGetHash
  54. * Made examples BigEndian
  55. ### Jan 12th, 2016
  56. * Added "RetCodeBadNonce = 0x06" return code
  57. ### Jan 8th, 2016
  58. Tendermint/TMSP now comes to consensus on the order first before AppendTx.
  59. This means that we no longer need the Commit/Rollback TMSP messages.
  60. Instead, there’s a “CheckTx” message for mempool to check the validity of a message.
  61. One consequence is that txs in blocks now may include invalid txs that are ignored.
  62. In the future, we can include a bitarray or merkle structure in the block so anyone can see which txs were valid.
  63. To prevent spam, applications can implement their “CheckTx” messages to deduct some balance, so at least spam txs will cost something. This isn’t any more work that what we already needed to do, so it’s not any worse.
  64. You can see the new changes in the tendermint/tendermint “order_first” branch, and tendermint/tmsp “order_first” branch. If you your TMSP apps to me I can help with the transition.
  65. Please take a look at how the examples in TMSP changed, e.g. how AppContext was removed, CheckTx was added, how the TMSP msg bytes changed, and how commit/rollback messages were removed.