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.

72 lines
2.0 KiB

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. * __Usage__:<br/>
  13. Append and run a transaction. The transaction may or may not be final.
  14. #### GetHash
  15. * __Returns__:
  16. * `RetCode (int8)`
  17. * `Hash ([]byte)`
  18. * __Usage__:<br/>
  19. Return a Merkle root hash of the application state
  20. #### Commit
  21. * __Returns__:
  22. * `RetCode (int8)`
  23. * __Usage__:<br/>
  24. Finalize all appended transactions
  25. #### Rollback
  26. * __Returns__:
  27. * `RetCode (int8)`
  28. * __Usage__:<br/>
  29. Roll back to the last commit
  30. #### AddListener
  31. * __Arguments__:
  32. * `EventKey (string)`
  33. * __Returns__:
  34. * `RetCode (int8)`
  35. * __Usage__:<br/>
  36. Add event listener callback for events with given key.
  37. #### RemoveListener
  38. * __Arguments__:
  39. * `EventKey (string)`
  40. * __Returns__:
  41. * `RetCode (int8)`
  42. * __Usage__:<br/>
  43. Remove event listener callback for events with given key.
  44. #### Flush
  45. * __Usage__:<br/>
  46. Flush the response queue. Applications that implement `types.Application` need not implement this message -- it's handled by the project.
  47. #### Info
  48. * __Returns__:
  49. * `Data ([]string)`
  50. * __Usage__:<br/>
  51. Return an array of strings about the application state. Application specific.
  52. #### SetOption
  53. * __Arguments__:
  54. * `Key (string)`
  55. * `Value (string)`
  56. * __Returns__:
  57. * `RetCode (int8)`
  58. * __Usage__:<br/>
  59. Set application options. E.g. Key="mode", Value="mempool" for a mempool connection, or Key="mode", Value="consensus" for a consensus connection.
  60. Other options are application specific.