-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload JSON From Local Drive To Marlowe Playground #72
Comments
Thanks for the feature request! We can definitely add a Load/Save to local disk, and it is a feature I wanted to do for some time. The current Download as JSON has a different purpose, so the implementation it's not trivial. The idea behind this button is to obtain the Marlowe Core Json representation of a contract, ready to be used by the marlowe-cli to instantiate a contract in the blockchain. The feature you are requesting requires us to save the Extended Marlowe Json bundled with the source instead. Currently the only difference between the Marlowe Core JSON and Marlowe Extended JSON is the contract template parameters, but eventually this representation is the one that can include comments, metadata, functions, etc. We already have a way to serialize the Extended Marlowe in its gist format, but we need to modify that so that it can be saved in a single |
Hi Hernan,
Thanks for considering the request.
Yes not trivial. I am working on a project similar to yours.
It's an application generator for Cardano built from scratch (no libraries)
in which not only builds the backend RESTful-API and JSON
Database/DataDictionary but also the JavaScipt UI which runs in the
browser. The application generator is even used to build itself. Now I want
to automate coding of Plutus and Marlowe smart contracts and put that in
the generator too. That is why I am studying Marlow, Plutus, and Haskell
now. The repository is named after IOTA because I didn't know about Cardano
when I started building but after finishing a few last thoughts in
JavaScript I will start a brand new repository for Cardano and convert as
much code as possible over to Haskell.
The generator script
<https://github.com/johnshearing/IOTA-Secure-Airgapped-Accounting-and-Banking-System/blob/master/lib/meta.js>
reads the JSON database
<https://github.com/johnshearing/IOTA-Secure-Airgapped-Accounting-and-Banking-System/blob/master/accounting/database/dbMetadata/metadata.json>
and uses the metadata found there to generate for each table a UI for adding
<https://github.com/johnshearing/IOTA-Secure-Airgapped-Accounting-and-Banking-System/blob/master/accounting/database/dbMetadata/metadataAdd.html>
records, a UI for editing
<https://github.com/johnshearing/IOTA-Secure-Airgapped-Accounting-and-Banking-System/blob/master/accounting/database/dbMetadata/metadataEdit.html>
records, a UI for searching
<https://github.com/johnshearing/IOTA-Secure-Airgapped-Accounting-and-Banking-System/blob/master/accounting/database/dbMetadata/metadataList.html>
records, and a backend RESTful-API with validation
<https://github.com/johnshearing/IOTA-Secure-Airgapped-Accounting-and-Banking-System/blob/master/accounting/database/dbMetadata/metadataLogic.js>.
I can't wait to start automating the construction of smart contracts too.
Generic code for the finished applications is stored in the generator
script. but if you need to deviate from generic behaviour then you can
specify different code in the JSON database. The idea is to make a
generator that one can use to code any kind of Cardano DAO that you would
like to have.
Anyway, thank you for the work you are doing which makes all of this
possible.
Best to you,
John
…On Tue, Jun 14, 2022 at 5:33 PM Hernan Rajchert ***@***.***> wrote:
Thanks for the feature request! We can definitely add a Load/Save to local
disk, and it is a feature I wanted to do for some time. The current
Download as JSON has a different purpose, so the implementation it's not
trivial.
The idea behind this button is to obtain the Marlowe Core Json
representation of a contract, ready to be used by the marlowe-cli to
instantiate a contract in the blockchain. The feature you are requesting
requires us to save the Extended Marlowe Json bundled with the source
instead. Currently the only difference between the Marlowe Core JSON and
Marlowe Extended JSON is the contract template parameters, but eventually
this representation is the one that can include comments, metadata,
functions, etc.
We already have a way to serialize the Extended Marlowe in its gist
format, but we need to modify that so that it can be saved in a single tar
file. I created the following ticket
<#73> to
capture that work. Also, if this means that we remove the current "Download
as JSON", then we need to keep issue 157
<input-output-hk/marlowe-cardano#157> in mind.
—
Reply to this email directly, view it on GitHub
<#72>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFKC3EO5IGYI4JYEAY44OLTVPD3D5ANCNFSM5YIIBRBQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Describe the feature you'd like
I noticed that if I cut and paste Marlowe code into the Marlowe Playground it will not load unless there is metadata from an example already loaded. Of course the metadata will not match the smart contract that I just pasted in. I understand that I would not be having this issue if I were loading and saving from gists on my github account. I am guessing that when saving to or loading from gists then the json data is what is saved and loaded which likely has the Marlowe code and the metadata for the smart contract. For those of us who can not or will not give write access to their github account, it would be nice if the json file that we can save to our downloads folder could later be uploaded again. Maybe it can and I am just not seeing how. Thanks
Describe alternatives you've considered
There could be a place to paste in the json as can be done with the Marlowe code.
Additional context / screenshots
The text was updated successfully, but these errors were encountered: