Please describe your proposed solution.
Answer:
The Problem
As a Cardano developer, I had to face a steep learning curve by myself. Even though I felt accomplished after going through it, It was a big pain and time-consuming process. My personal situation, having spare time, and being a self-learner allowed me to go through all of that, but definitely if we expect to onboard more developers this can not continue to be the case.
To reinforce this diagnosis we can go and see some data from a Developer Report, that shows the Cardano ecosystem, is far behind Polkadot, Solana & Cosmos in the number of developers, those three are above 300 active developers, while Cardano has only 160. But that is a snapshot. If we analyze the developer growing metric, it's a lot worse. Cardano is one of the slowest with a 14% increase comparing 2022 with 2021.
Link to the report: https://www.developerreport.com/developer-report
The solution
Our proposal is to create an all-in-one repository that enables developers to quickly start developing, compiling, testing, and implementing their projects.
We will implement an automated multi-container workflow that includes all the necessary tools and configurations to achieve this. By utilizing Docker Compose, we can define and run these multi-container applications seamlessly. This approach relieves developers from the burden of individually installing and configuring each tool, allowing them to concentrate on building dApps and smart contracts.
With our solution, developers can simply choose the desired version, begin writing their code, and experience a streamlined development process.
Protofire aims to create and maintain the Developer Studio as a public repository, offering a comprehensive resource for developers entering the world of Cardano smart contracts. This repository will include a CLI toolkit that empowers developers to make the most of the available tools. Additionally, it will provide sample contracts and Haskell libraries with essential functions to facilitate both on-chain and off-chain development. To enhance accessibility and adaptability, the repository will offer up-to-date Dockerfiles that users can easily configure to suit their specific needs, such as selecting desired tools, services, and networks.
Solution Features
Developer Studio will provide documentation, tutorials, and links to official pages and documentation. This ensures that developers have easy access to essential information and references.
To achieve this, we will provide the following tools within the Developer Studio repository:
1- Dockerfiles and Docker Compose for tools and services: We will offer Dockerfiles and Docker Compose configurations to facilitate the setup and execution of various core services in Cardano. These services, including Cardano Node, Cardano Wallet and DbSync are essential for many developments and applications. Developers will have the flexibility to start containers individually or in combination. The only requirement is that the user has Docker installed on their computer.
- cardano-node (software capable of running as a core block producer, as a relay or as a local entry-point to the network)
- cardano-wallet (provides an HTTP API and CLI for working with the wallet)
- cardano-cli (provides a collection of tools for generating keys, constructing transactions, creating certificates, and other important tasks)
- db-sync (database that maintains a copy of the ledger state)
2- Dockerfile and Docker Compose that sets up a development environment ready for writing, compiling, testing, and deploying smart contracts. It includes GHCup, Cabal, Nix, Plutus-Tx, and optionally Plutus-Apps. This uses the DevContainers offered by VS Code, the most widely used development environment for these projects today. Once the Docker is established within the DevContainer, VS Code seamlessly loads and runs the Docker for the user. This means that users can start writing and executing code within the mentioned Docker without any extra setup required.
Link: <https://code.visualstudio.com/docs/devcontainers/containers>
3- Bash script-based CLI toolkit to manage and utilize all the included tools within the Studio: containers, services and utilities. Users will be able to choose, configure, and create the aforementioned containers through interactive menus. The toolkit will also feature menus to interact with various services, such as querying the Cardano Node, creating basic transactions, signing and sending raw transactions, managing wallets in the Wallet Server and more.
Additionally, the toolkit will offer menus for performing essential tasks in the Cardano development process. This includes utilities to convert and derive addresses, view wallet balances, inspect UTXOs of addresses, calculate hash values of datums and redeemers, and more.
Menus will also be provided to interact with example contracts included as part of this solution, including minting contracts. Users will be able to create and utilize different pre-existing minting policies or add their own policies. These policies can be wallet-dependent or limited to one-time use (e.g., for creating NFTs). Users will be able to mint their tokens directly from this toolkit, add metadata to minting transactions and create metadata files in the required format for presentation to the Cardano Foundation. The suite empowers developers to create and deploy their own FT and NFTs needed for running and testing their applications.
Wallets can be exported for users to add them to their preferred wallet applications, such as Eternl, Nami, and others.
The toolkit will offer menus to download and select specific versions of Plutus Apps, along with commands to initiate the specific nix-shell for each of them. Additionally, there will be menus to facilitate running the documentation server (Haddock) for each of the downloaded Plutus Apps.
Menus will be available to start Chain Index, Playground Server, and Playground Client for the example contracts in the suite.
Other utility menus included:
- Fixing folder permissions (addressing issues with Cabal)
- Adding a folder to Git's safeDirectory for improved compatibility
4- Haskell libraries that encompass both off-chain and on-chain functions. These libraries serve as valuable resources for developers, enabling them to efficiently develop and interact with Cardano smart contracts. Includes functions to evaluate scripts that allows developers to assess the resource consumption of their contracts and getinsights into the performance and efficiency of the contracts, helping developers optimize their code and ensure optimal resource utilization.
These libraries equip developers with the necessary libraries, tools, and evaluation capabilities to enhance their development experience, simplify contract deployment, and optimize the efficiency of Cardano smart contracts.
5- Suite of example smart contracts and customizable minting policies: These examples, designed to inspire and empower developers, serve as invaluable references, providing developers with a solid foundation and inspiration to create their own smart contracts.
Moreover, the suite includes comprehensive testing files and a user-friendly CLI interface, enabling developers to easily execute PAB Simulator, Trace Emulator, and Plutus-Simple-Model. These tools facilitate thorough testing and interactive experimentation in simulated newtwork, ensuring the reliability and effectiveness of the contracts.
With these example contracts and customizable minting policies, developers have the resources they need to explore and experiment with different contract functionalities.
6- Automatization of building production image: To facilitate the deployment of the production environment, we offer a set of actions and scripts that automate the process. These actions and scripts enable the generation of a production-ready image that is portable and can be easily uploaded to Docker Hub.
With every new release on GitHub, the automation scripts automatically build and upload the image to Docker Hub. This ensures that the latest version is readily available for deployment.
The generated image is designed to be easily deployable on hosting services like Demeter. You can effortlessly mount the image on the hosting service, allowing for seamless deployment and scaling of your application.
With these actions and scripts, developers can efficiently generate a production environment, create a portable image, automate the release process, and deploy their applications on hosting services with ease.