Marlowe Runtime Web API #341
Replies: 3 comments 1 reply
-
ResourcesHere is one possible RESTful representation of the runtime as resources: RootThe root resource is the resource that links to all top-level resources. URI(s)
Representation
Links
ContractThis refers to a Marlowe contract deployed on chain. URI(s)
RepresentationThe current state of the contract (i.e. the datum of the most recent UTxO or Close contract/state if the contract is closed) and whether or not it is followed (actively managed and monitored by the runtime). Links
TransactionAn event that changes the state of a Marlowe contract. URI(s)
RepresentationAn object consisting of the Cardano Tx data, the Marlowe inputs, the resulting state and contract. Links
PayoutA payment to a role from a contract. (Qeustion should this include non-role payouts too?) URI(s)
RepresentationAn object containing the UTxO that created the payout, the role the payout was sent to, and whether or not it is redeemed. Links
WithdrawalA transaction that redeems a payout to a role in a contract URI(s)
RepresentationAn object containing the payout(s) that was/were redeemed, the role to which the payouts were sent, and the address of the wallet that withdrew the funds. Links
RoleA role in a contract is an abstract entity. In Cardano, you must hold the correct role token in your wallet to perform actions on behalf of a role. URI(s)
RepresentationAn object containing the minting transaction, current owning address, minting policy ID, token name, and metadata of the role token. Links
|
Beta Was this translation helpful? Give feedback.
-
Other domains to consider (thanks for listing these @bwbush)
This clearly fits into a REST API quite nicely. Here's an idea of the routes we could support:
I find these a little less clear in terms of their mapping to URIs/resources. I assume most would be One possible representation of this is to create an intermediary
This would be an interesting REST API, but the question of persistence is a bit unclear - would we want to add this functionality to the runtime? Or would this be implemented by the web server or a separate |
Beta Was this translation helpful? Give feedback.
-
Notes from @paluh
|
Beta Was this translation helpful? Give feedback.
-
The purpose of this thread is to discuss the design of the Marlowe Runtime Web API. The purpose of the Web API is to provide a more programmer-friendly interface to the Marlowe Runtime compared with the binary protocols. The API server will be built on top of the binary protocols and may offer more abstract / higher-level capabilities.
Components
The two main components of the API are:
Marlowe REST API
Following RESTful architecture, this API maps all entities, operations, and system states to a set of resources identified by URIs. These resources are linked to one another via hypermedia links. Thus, all operations available on a resource can be discovered by querying that resource. One of the goals of this discussion is to define these resources, the structure of their URIs and the topology of their links to one another.
Another goal of the discussion is to discuss what media types to support. JSON is an obvious (and ubiquitous) choice, but supporting HTML would also be useful, as it would allow web browsers to display the resources as web pages. Furthermore, the links can be rendered in HTML as clickable hyperlinks as well as forms for allowing manual execution of operations.
Marlowe WebSocket API
We need to define the domain's subscribable events and provide WebSocket APIs. Here are some candidates:
Additionally, we could consider adding WebSocket APIs for changes of other state, but this may be unnecessary.
Additional Components
Some additional components that are necessary to form the core of the ecosystem are:
Beta Was this translation helpful? Give feedback.
All reactions