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
1.8 KiB

9 years ago
9 years ago
  1. # Tendermint Streaming Protocol (TMSP)
  2. **TMSP** is a socket protocol, which means applications can be written in any programming language.
  3. TMSP is an asynchronous streaming protocol: message responses are written back asynchronously to the platform.
  4. *Applications must be deterministic.*
  5. ## Message types
  6. #### AppendTx
  7. * __Arguments__:
  8. * `TxBytes ([]byte)`
  9. * __Returns__:
  10. * `RetCode (int8)`
  11. * __Usage__:<br/>
  12. Append and run a transaction. The transaction may or may not be final.
  13. #### GetHash
  14. * __Returns__:
  15. * `RetCode (int8)`
  16. * `Hash ([]byte)`
  17. * __Usage__:<br/>
  18. Return a Merkle root hash of the application state
  19. #### Commit
  20. * __Returns__:
  21. * `RetCode (int8)`
  22. * __Usage__:<br/>
  23. Finalize all appended transactions
  24. #### Rollback
  25. * __Returns__:
  26. * `RetCode (int8)`
  27. * __Usage__:<br/>
  28. Roll back to the last commit
  29. #### SetEventsMode
  30. * __Arguments__:
  31. * `EventsMode (int8)`:
  32. * `EventsModeOff (0)`: Events are not reported. Used for mempool.
  33. * `EventsModeOn (1)`: Report events that are listened on.
  34. * __Returns__:
  35. * `RetCode (int8)`
  36. * __Usage__:<br/>
  37. Set event reporting mode for future transactions
  38. #### AddListener
  39. * __Arguments__:
  40. * `EventKey (string)`
  41. * __Returns__:
  42. * `RetCode (int8)`
  43. * __Usage__:<br/>
  44. Add event listener callback for events with given key.
  45. #### RemoveListener
  46. * __Arguments__:
  47. * `EventKey (string)`
  48. * __Returns__:
  49. * `RetCode (int8)`
  50. * __Usage__:<br/>
  51. Remove event listener callback for events with given key.
  52. #### Flush
  53. * __Usage__:<br/>
  54. Flush the response queue. Applications that implement `types.Application` need not implement this message -- it's handled by the project.
  55. #### Info
  56. * __Returns__:
  57. * `Data ([]string)`
  58. * __Usage__:<br/>
  59. Return an array of strings about the application state. Application specific.