tupui / soroban-versioning

Tansu - Soroban Versioning
https://tansu.dev
Other
4 stars 3 forks source link

Store proposals on IPFS #90

Open tupui opened 1 week ago

tupui commented 1 week ago

Relates to https://github.com/tupui/soroban-versioning/issues/83#issuecomment-2475093808

Send the proposal to IPFS with Storacha to the DID of the project (https://docs.storacha.network/how-to/upload/). The proposal is a markdown file and can have images.

Here is an example of proposal

https://bafybeidsfg2rfmpgtisfnmk6lur5dmy6j4kwjblh2rhme6nrsvjcaci4jq.ipfs.w3s.link

To store the possible actions in XDR form. I think the best would be to store a json file (I will make an example tomorrow and provide another IPFS link.) This JSON file need to be loaded and displayed at the bottom of the proposal.

{
    "approved": {
        "description": "What happens if this proposal is approved",
        "xdr": "AAAAAgAAAABiu...="
    },
    "rejected": {
        "description": "What happens if this proposal is rejected",
        "xdr": "AAAAAgAAAABiu...="
    },
    "cancelled": {
        "description": "What happens if this proposal is cancelled",
        "xdr": "AAAAAgAAAABiu...="
    }
}

The XDR field is optional.

See the laboratory for some XDR example. We are storing in the JSON files the XDR as a string. But in the UI we are only interested in displaying the JSON form. The XDR should be a collapsible and scrollable as it can be long.

0xExp-po commented 1 week ago

Hey, @tupui in the IPFS, is the proposal description file name proposal.md whenever?

0xExp-po commented 1 week ago

also, the action JSON data, is it stored as another file in IPFS? then what is the file name?

tupui commented 1 week ago

Yes the proposal should always be proposal.md. When a user will create a proposal, it should create this file and send it to IPFS.

For the JSON data, I will make a new link with everything to show.

Let's call the file, outcomes.json

0xExp-po commented 1 week ago

in the outcome, should I display the XDR data or decoded data of it?

tupui commented 6 days ago

We only display the decoded data. So json. We do t need to show the XDR itself there.

What we will need is to add a link somewhere on the page to see the files on IPFS. This way people can verify for themselves everything if they want to.

tupui commented 6 days ago

Here is the new link with outcomes:

https://bafybeigstnjnededvbckmvlmodpw2m745i5lidmyttb4u7o6ouiudokbx4.ipfs.w3s.link

0xExp-po commented 2 days ago

then I'll add 'link' icon to the beside of the titles 'Proposal Description' and 'Proposal Outcome' the links will be like these for example with the above ipfs link

https://bafybeigstnjnededvbckmvlmodpw2m745i5lidmyttb4u7o6ouiudokbx4.ipfs.w3s.link/proposal.md https://bafybeigstnjnededvbckmvlmodpw2m745i5lidmyttb4u7o6ouiudokbx4.ipfs.w3s.link/outcomes.json

0xExp-po commented 1 day ago

like this image

and this image

tupui commented 1 day ago

That works 👍