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.

75 lines
2.0 KiB

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