CBOR plug in or tools?

We probably have 20ICP we can put behind it from ICDevs right away. We just need to write up the simplest path forward. I’m guessing it is something along the lines of adding a tab to the dev tools via a plug-in that looks for cbor and decodes it and then further decodes any candid it finds?

1 Like

That makes a lot of sense. I went straight to patching devtools core :laughing:. I’ve yet to parse the output even manually, but getting that down then building a little devtools extension seems like the shortest critical path.

Dove into this a bit today. What we’re getting back from a canister is b64 encoded byte array. Getting that to play nicely with cbor.me was a matter of hex encoding it. Now I just need to throw Candid decoding in there. Am I crazy, or is it only possible encode/decode Candid if you have type data? agent-js seems to be providing types as well as args for each encode/decode event. If so, I suppose the extension would have to provide a way to map an interface onto a canister in order to function.

If you can use web assembly in the extension, you could probably compile the Candid crate to decode it without having to do a bunch of extra work in JS

Interesting… was thinking of grabbing @dfinity/candid/idl.js -> decode() and its deps.

Here’s the repo: GitHub - jorgenbuilder/chrome-dfinity-decoder: Decode responses from the Dfinity blockchain in chrome devtools

2 Likes

Stuck for the moment on decoding the candid.

Made an attempt at building a wasm from the Candid crate and importing it into the extension. Import seems to work (would likely require some additional work to get into the chrome web store,) but I don’t know any rust so didn’t really get it to actually do anything.

didc makes quick work of decoding the bytes without types though, so I know it can be done.

1 Like

Some success using a hacked version of the agent-js code today:

5 Likes
3 Likes

Create a CBOR developer plugin - #5

Current Status: Discussion

  • Discussion (11/21/2021)
  • Ratification (11/22/2021)
  • Open for application (11/23/2021)
  • Assigned (11/23/2021) ← We are here
  • In Review
  • Closed

Issue Link - Discussion Forum

Bounty Details

  • Current Bounty Amount: 10 ICP
  • ICDevs.org Match Available: 10 ICP - (For every ICP sent to 66083bb3c940c7de2a70aa127ec771da75d60deadc10f5f66b280f203d8f6e73, ICDevs.org will add one more ICP to the bounty, up to 10 ICP, After 10 ICP, Donations to the above address will add .25 ICP to this issue and .75 ICP to fund other ICDevs.org initiatives)
  • Time Left: Expires 12/31/2022
  • Project Type: Single Contributor
  • Opened: 11/23/2021
  • Time Commitment: Days
  • Project Type: Traditional
  • Experience Type: Intermediate - Web Dev
  • Issue Type: Application Development

Description

This bounty gives the opportunity to

  • learn how chrome plugins work
  • learn how CBOR encoding works
  • learn how Candid encodings work
  • learn how the Internet Computer communicates with other applications

The developer will need to create a plug-in for Google Chrome in the style of react developer tools. This plug in should detect when CBOR has been sent or recieved from a server and be able to display that CBOR content in a more readable format. The user should be able to switch between a candid view/motoko data view/rust data view/json view. This will allow the user to copy and paste the data easily in to test harneses if they need to.

To apply for this bounty you should:

Github user jorgenbuilder applied for this bounty.

Selection Process

Github user jorgenbuilder was selected for this bounty.

Bounty Completion

Please keep your ongoing code in a public repository(fork or branch is ok). Please provide regular (at least weekly) updates. Code commits count as updates if you link to your branch/fork from the bounty thread. We just need to be able to see that you are making progress.

The balance of the bounty will be paid out at completion.

Once you have finished, please alert the dev forum thread that you have completed work and where we can find that work. We will review and award the bounty reward if the terms have been met. If there is any coordination work(like a pull request) or additional documentation needed we will inform you of what is needed before we can award the reward.

Bounty Abandonment and Re-awarding

If you cease work on the bounty for a prolonged(at the Developer Advisory Board’s discretion) or if the quality of work degrades to the point that we think someone else should be working on the bounty we may re-award it. We will be transparent about this and try to work with you to push through and complete the project, but sometimes, it may be necessary to move on or to augment your contribution with another resource which would result in a split bounty.

Funding

The bounty was generously funded by the community. If you would like to turbocharge this bounty you can seed additional donations of ICP to 66083bb3c940c7de2a70aa127ec771da75d60deadc10f5f66b280f203d8f6e73. ICDevs will match the bounty 1:1 for the first 10 ICP and then 0.25:1 after that. All donations will be tax deductible for US Citizens and Corporations. If you send a donation and need a donation receipt, please email the hash of your donation transaction, physical address, and name to [email protected]. More information about how you can contribute can be found at our donations page.

General Bounty Process

Discussion

The draft bounty is posted to the DFINITY developer’s forum for discussion

Ratification

The developer advisor’s board will propose a bounty be ratified and a vote will take place to ratify the bounty. Until a bounty is ratified by the Dev it hasn’t been officially adopted. Please take this into consideration if you are considering starting early.

Open for application

Developers can submit applications to the Dev Forum post. The council will consider these as they come in and propose a vote to award the bounty to one of the applicants. If you would like to apply anonymously you can send an email to austin at icdevs dot org or sending a PM on the dev forum.

Assigned

A developer is currently working on this bounty, you are free to contribute, but any splitting of the award will need to be discussed with the currently assigned developer.

In Review

The Dev Council is reviewing the submission

Awarded

The award has be been given and the bounty is closed.

Matches

We are waiting on our first community match.

Other ICDevs.org Bounties

6 Likes

Hey…just wanted to remind everyone that we have an open bounty for this. @jorgenbuilder 's latest progress is at GitHub - jorgenbuilder/chrome-dfinity-decoder: Decode responses from the Dfinity blockchain in chrome devtools and someone could pick up and run with it.

3 Likes

I slapped a UI on what I had so far and have a release pending review in the chrome web store. I think this will serve as a fine alpha release, and I’ve started adding issues for future releases to the github repo.

5 Likes

We’re live on the chrome webstore :slight_smile:

2 Likes

For decoding Candid message online, you can try https://fxa77-fiaaa-aaaae-aaana-cai.raw.ic0.app/explain

1 Like

Any idea why the tool doesn’t work with https://app.sonic.ooo ?

@coin_master It was a problem with the url capture regex. I’ve updated it and capture on sonic.ooo is working now. The 0.0.6 release with this change should be live on the web store any minute now. Thanks for letting me know!

1 Like

Sonic uses some url entries into the internet computer that I hadn’t seen before. I recently swapped from capturing IC requests based on content types to capturing them based on urls (as of now, *.(ic0.app|dfinity.network|localhost:*)/api/v2/canister/<canister>/<method> ). I opened up that matcher a bit in order to work well with sonic, but there may yet be some URLs to add to this list, or perhaps it’s the wrong mechanism to identify IC requests :man_shrugging:

1 Like

I cannot find out how to use this. In an app that talks to the IC (based on icfront) I open the debug tools and in the network tab I expect a ‘decoder’ tab. But it does not appear. See this:

How can I get the CBOR tab?

It shold be at the end on the right of your tab bar. Maybe check settings that it is enabled or restart chrome?

I found that after restarting the browser it worked. This is really useful. Thanks!!