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.

79 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
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. * `RetCode (int8)`
  12. * `RetData ([]KVPair)`
  13. * `Error (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. * `RetCode (int8)`
  21. * `RetData ([]KVPair)`
  22. * `Error (string)`
  23. * __Usage__:<br/>
  24. Validate a transaction. This message should not mutate the state.
  25. #### GetHash
  26. * __Returns__:
  27. * `Hash ([]byte)`
  28. * __Usage__:<br/>
  29. Return a Merkle root hash of the application state
  30. #### Flush
  31. * __Usage__:<br/>
  32. Flush the response queue. Applications that implement `types.Application` need not implement this message -- it's handled by the project.
  33. #### Info
  34. * __Returns__:
  35. * `Data ([]string)`
  36. * __Usage__:<br/>
  37. Return an array of strings about the application state. Application specific.
  38. #### SetOption
  39. * __Arguments__:
  40. * `Key (string)`
  41. * `Value (string)`
  42. * __Returns__:
  43. * `Error (string)`
  44. * __Usage__:<br/>
  45. Set application options. E.g. Key="mode", Value="mempool" for a mempool connection, or Key="mode", Value="consensus" for a consensus connection.
  46. Other options are application specific.
  47. ## Changelog
  48. ### Jan 23th, 2016
  49. * Added CheckTx/Query TMSP message types
  50. * Added RetData/Error fields to AppendTx/CheckTx/SetOption
  51. * Removed Listener messages
  52. * Removed RetCode from ResponseSetOption and ResponseGetHash
  53. ### Jan 12th, 2016
  54. * Added "RetCodeBadNonce = 0x06" return code
  55. ### Jan 8th, 2016
  56. Tendermint/TMSP now comes to consensus on the order first before AppendTx.
  57. This means that we no longer need the Commit/Rollback TMSP messages.
  58. Instead, there’s a “CheckTx” message for mempool to check the validity of a message.
  59. One consequence is that txs in blocks now may include invalid txs that are ignored.
  60. In the future, we can include a bitarray or merkle structure in the block so anyone can see which txs were valid.
  61. 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.
  62. 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.
  63. 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.