The Internet Computer is a uniquely powerful blockchain. With this browser extension, you can inspect messages exchanged between your browser and the IC blockchain. IC Inspector provides developers with crucial tooling for blockchain projects using the browser devtools paradigm they already know.
The lifecycle of a message between your browser and any IC smart contract (or "canister") involves a few layers of encoding.
Data on the wire is sent in concise binary object representation (CBOR) format. Decoding this is fairly straightfoward.
Clients and smart contracts use Candid, a proprietary interface definition language (IDL), to encode arugment types, return types, and canister interfaces. IC Inspector automatically retrieves IDL definitions from the canister itself in order to accurately parse data.
An agent library called agent-js runs in the browser, sending https requests to boundary nodes which communicate with the blockchain itself. IC Inspector monitors these https requests and maps them back into a representation of the actual blockchain messages for easy reading.
The blockchain returns a pruned merkle tree containing the subset of blockchain state which constitutes a particular message response. IC Inspector picks your message out of this tree.
For development with automatic reloading:
npm run start
Open the Extensions Dashboard, enable "Developer mode",
click "Load unpacked", and choose the dist
folder.
You will see the "Dfinity" tab in your devtools window.
When you make changes in src
the background script and any content script will
reload automatically.
To simplify testing and development the extension's UIs, storybook is available with a set of message stubs captured from real IC apps.
npm run storybook
Pushing a new tag to github will trigger a release to the chrome webstore.
manifest.json
git tag vX.X.X
git push origin main
git push origin --tags
This library was originally incentivized by ICDevs. You can view more about the bounty on the forum or website. The bounty was funded by The ICDevs.org commuity and the award paid to @jorgenbuilder. If you use this library and gain value from it, please consider a donation to ICDevs.