Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
By Jason Ibrahim
The Internet Computer is a secure compute platform that enables developers to launch unstoppable, decentralized applications rapidly, sovereign of cloud provider oligopoly overreach. Think of ICP as a protocol for compute over IP — it is for compute what Internet Protocol is for communication.
Close to 800,000 applications are deployed on the Internet Computer Protocol (ICP) today, with that number growing each and every day. Providing a first-class developer experience, along with providing developers access to tools and insights that help them succeed is a pivotal focal point for DFINITY’s research and development team.
With the launch of the Beryllium milestone, DFINITY is bringing better and more effective DevOps capabilities to ICP.
Beryllium — The High Level
The Beryllium milestone encapsulates several features that live within the domain of DevOps — a speciality that aims to shorten development cycles, increase deployment frequency, and deliver high-quality software in a more predictable and sustainable way.
This milestone provides substantial simplifications and improvements for the developer lifecycle of canisters, particularly regarding their development and operations. Snapshotting capabilities, powerful logging infrastructure and improved error handling give developers new tools and paradigms to add to their debugging arsenal.
Canister Snapshots
In environments where rapid development and iteration cycles are a necessity, every deployment is an opportunity for success… or failure. Those versed in the paragons of Continuous Integration and Continuous Deployment will tell you just how important it is to be able to recover from a failure quickly. Every second of downtime equates to dollars lost.
Applications deployed on ICP need access to secure, resilient, and fast mechanisms for recovery so that developers can deploy rapidly and with more confidence. By bringing canister snapshotting to the Internet Computer, developers can take a snapshot of their application, including all of its data, and upgrade without fear of irrevocability or data loss. This is huge for developers who have high data safety and/or SLA requirements.
The basic mechanism is that a snapshot of a canister can be taken (e.g. by using a tool like dfx), and that snapshot will be stored securely onchain. Later, that canister can be rolled back to the snapshot taken in a matter of seconds, say if a new buggy version is deployed through an upgrade.
Combined with utilities for monitoring applications on ICP, this feature gives developers higher confidence in performing experiments, running A/B tests, and offering more stringent SLA’s to their customers. The R&D team at DFINITY is looking forward to seeing all the creative ways in which developers make use of snapshots in their application development lifecycle.
Canister Logging
When it comes to debugging an issue, most developers will tell you that the very first place to start is with the logs. Any software system — whether it’s an operating system, a web application, firmware, or anything in between — emits logs as a standard part of its operation. Logs can give insights into the events that took place leading up to and after an error, helping developers diagnose the root cause and come up with a fix.
The most critical point for log capture is, arguably, in the aftermath of an error. With canister logging capabilities on ICP, developers can now access full error logs produced by the system in the event of a trap. This gives developers greater visibility into the operation of their canisters — a peek behind the curtain if you will — and with that, an ability to troubleshoot and respond to application failures quickly.
In addition to capturing traps, developers can leverage canister logging to capture any and all log messages emitted by application code running in production. Developers can insert log messages in any place they wish to allow for use cases that go beyond debugging and into the realm of user experience enhancements.
While the canister logging capabilities introduced in the Beryllium milestone are powerful, they are still in their infancy. Many improvements and expansions are yet to come, and DFINITY is steadfast in its mission to bring a premiere logging experience to developers building on ICP.
Backtraces, Errors, and Standardized Response Codes
While logs are a good starting point in the process of debugging, they only provide a glimpse into the system producing an error. For developers to understand exactly what went wrong in the event of, say, a panic, they need more information.
Canisters running on ICP now expose the trace of functions called on the stack immediately preceding a crash. This information ties seamlessly into the error logging mechanism described previously — when retrieving production logs, developers will automatically see backtrace information as well.
Debugging isn’t the whole story. Developers also need to be able to respond proactively to errors, handling potential error scenarios gracefully by building out specific logic in their applications to, for example, show informational error screens, attempt to recover automatically, or guide the user to try again with different input. To accomplish this, developers need finer-grained error information in the responses returned by the network.
DFINITY has spent ample time looking over all of the potential errors that can be produced and has made an effort to standardize response codes where possible. This way, an error being returned by the network can be better understood and far more predictable, allowing developers to more confidently build graceful degradation into the “sad paths” of their application workflows.
In addition to standardizing response codes, errors are now embellished with helpful documentation links. Developers who encounter an error during the development process can quickly learn why it happened and how to fix it.
Conclusion
No software system is perfect, and something is bound to go wrong eventually. The Beryllium milestone marks the commitment of ICP to help developers recover more quickly and keep moving. The ability to take a snapshot of a running canister allows an upgrade to proceed with confidence, knowing that the system can be rolled back if things don’t go as planned. Logging functionality coupled with backtrace information provides insights into what went wrong, including the exact source code line number the error took place. Standardized response codes provide a consistent apparatus for handling the myriad result scenarios a canister may return when called to perform an action.
These improvements reinforce ICP’s mission to create a reliable, user-friendly platform for decentralized applications, empowering developers to innovate with greater confidence.
Elevating the DevOps Experience on ICP with Beryllium was originally published in The Internet Computer Review on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.