How can I see all the history of a contract in UI?

G-d willing

Hello, assuming I have a simple contract like the following:

template Simple
    owner: Party
    status : Int
    signatory owner

  choice ChangeStatus : ContractId Simple
  controller owner 
      create this with status = status + 1

How can I fetch the data of this contract knowing when the status was equal to 1 or 2 and etc…?
I need this for a system where I need to show the history of a contract in a UI application.


The JSON API does not provide access to historical data at the moment. Your best option is to build a custom (Java) backend using the Java bindings + codegen that stores the history you’re interested in based on the data it receives on the transaction/transaction tree stream and then expose that through an HTTP API to your frontend.

G-d willing

I am not sure I understood you completely.
Are you suggesting I use a database where I will store all the history I need - and not use the ledger?
If this is what you mean, how do I take advantage of a ledger that holds all the contract’s history?