Hi y’all, this is a general post about developer tooling that the community members would like. Feel free to leave ideas in this thread, with or without explanations. Eventually I will post this information somewhere, like on a public Notion page or Github repo or something. I’m planning to then use this list as part of our target list for community development requests for our public funds.
However, it is not clear to someone coming onto ICON what they need to do to get started, or which tools to use. Many of these tools assume a level of familiarity with Java and ICON that is greater than what we should assume an onboarding developer would have. Additionally, some have either incomplete or incorrect documentation that cause frustrating experiences building on ICON.
I would like to see a single tool to improve the smart contract developer experience that contains the following:
In-process or standalone local goloop node that includes account and state management. This is similar to Ganache and the Hardhat Network
Standardized deployment process with a single command to build, test, and deploy smart contracts
Standardized project initialization that minimizes startup steps to a single init command and bootstraps development
Standardized development environment across multiple platforms (Linux, Apple Sillicon)
Standardized testing framework that integrates JUnit 5 and Mockito, and includes the ability to get stack traces for failed transactions
CLI to communicate with accounts and smart contracts
Documented in such a way that assumes no prior Java knowledge
Requires minimal effort by the developer to set up
I believe this tool would best be a Gradle plugin. Gradle wrapper itself does not need to be abstracted, it just needs to be documented how to use for someone new to Java and ICON. I would additionally like to see an IntelliJ and VSCode plugin that integrates the tool directly to the IDE along with JCL whitelist and ABI type checking. As the initial scope, I believe this would primarily involve tying pre-existing work together, and a single developer familiar with Java and smart contract development could do so in a few months.
This Gradle and IDE tool could later be extended to include the following:
Cyrus covered it all very well and don’t really have much to add to that, but ill share things i found difficult or frustrating when i started developing smart contracts in java.
Templating. Has already been said many times now, but a full contract that can be unit tested integration Tested (on a localNode) and deployed to a testnet. After running one init command
Local chain management. If a tool is made a new developer should not need anything more than docker installed to be able to run the node. Currently you need to fetch additional repos and build them to set it up.
Contract mocking (in unit tests). Contracts are usually not simple and interact with other contracts in a call. This is done in many ways across projects few which allows autocomplete, type checking and more help you’d want when testing/mocking. Otherwise unit testing with javaee-unittest is really good imo.
Integration testing. Here is for sure where i had the most frustrations.
No real complete framework/library. Requires you to build a lot extra to be able to deploy you project and test it in a useful manner.
Contract not deploying because of non allowed methods (should be caught in optimized Jar process or earlier.
No good Error messages or none at all. Depending a bit on what framework/libraries you are using. You pretty much need to navigate the gochain log while integration testing. The error messages in the log are thorough and good but never reach the user.
Gochain configurations. Again you should optimally never have to leave you project to do these things. Mostly setting block Interval and in general being able to speed up integration Testing. Bonus if we where able to fast forward on chain to test time dependent features without having to introduce extra or change code.
A small local tracker that can be run along with Local node would be helpful. I think a tool like ganache would be sufficient showing the blocks, transactions, addresses.
More trustable unit testing library: Some of the things in the unit test framework behave completely different from goloop like not reverting the context of the transaction on reverts. Unit testing library currently uses Context.call to call the contract methods, it would be better to have a framework to create class instance as score and call methods natively as if calling class methods. This would give autocomplete.
Generation of Boilerplates/Templates to start writing contract. (can be achieved by using gradle tool but would be better to get single command specifically tailored for ICON smart contracts)
Some of the tools/things that I feel are very important to build/update:
Support for different utility methods library. Currently, very few are supported and it would be very hard for developers to find the supported libraries that they can use.
A tool for local chain management for account and state of nodes. Similar to Ganache. It would be even better if there was a complete suite for the development process.
Complete 101 articles on how to get started in ICON. Currently, it is very difficult to understand and navigate as so many process areas are scattered in different sites.
A framework of the SCORE development unit and integration testing, and Gradle settings where we can set coverage in order to deploy the SCORE. This would ensure that there is an auto-completion and proper design pattern for development.
A good design pattern where we separate models like (DBs) with the business logic (APIs).
Integration test: There are no proper status codes or messages when there are errors from contract-contract calls. “Unkown failure” is only displayed currently. A proper message should be displayed here.