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

9 years ago
9 years ago
9 years ago
9 years ago
  1. # Tendermint Socket Protocol (TMSP)
  2. **TMSP** is a socket protocol, which means applications can be written in any programming language.
  3. TMSP is an asynchronous 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. #### AddListener
  30. * __Arguments__:
  31. * `EventKey (string)`
  32. * __Returns__:
  33. * `RetCode (int8)`
  34. * __Usage__:<br/>
  35. Add event listener callback for events with given key.
  36. #### RemoveListener
  37. * __Arguments__:
  38. * `EventKey (string)`
  39. * __Returns__:
  40. * `RetCode (int8)`
  41. * __Usage__:<br/>
  42. Remove event listener callback for events with given key.
  43. #### Flush
  44. * __Usage__:<br/>
  45. Flush the response queue. Applications that implement `types.Application` need not implement this message -- it's handled by the project.
  46. #### Info
  47. * __Returns__:
  48. * `Data ([]string)`
  49. * __Usage__:<br/>
  50. Return an array of strings about the application state. Application specific.
  51. #### SetOption
  52. * __Arguments__:
  53. * `Key (string)`
  54. * `Value (string)`
  55. * __Returns__:
  56. * `RetCode (int8)`
  57. * __Usage__:<br/>
  58. Set application options. E.g. Key="mode", Value="mempool" for a mempool connection, or Key="mode", Value="consensus" for a consensus connection.
  59. Other options are application specific.