Tips for Corda Developers
November 10, 2020
Corda has done a lot to create a robust and scalable distributed blockchain for enterprise (we’ve even prepared for quantum algorithms!). Still, we’ve found that there are some tips people tend to miss when they’re first getting started developing with Corda or thinking about going to production.
Static Code Analysis
We often advocate for computers to do the work and static code analyzers are my favourite implementation of this idea. You may be aware that the Corda development team uses a static code analyzer called detekt to monitor the codebase’s quality. If you look at the Corda developer recommended code style guide, you’ll find that many of these rules are already encoded for you in the Corda repo. It could be worth looking to see if some code consistency could save you down the road and make your codebase more comfortable to work with.
I’d also recommend Prettier for Java users, which has become incredibly popular and has a java plugin. With as many as two million downloads in a single day and forty million in the last month, Prettier has become a fantastic asset to the developer community. Google has put out an excellent set of style guides for Java as well.
New Developer Tooling
Earlier this year, we wrote about new developer tooling that we’ve put together, and it bears repeating.
You can now develop a CordApp or test an idea in minutes on the online IDE. We’ve completely redesigned the node explorer so you can see your network and interact with it seamlessly. We have a Corda VSCode extension, and for those of you who use truffle, we have a Corda integration as well.
Be aware of Accounts
When talking with developers, people often want to run an entire Corda node to represent each of their customers’ identities. This is how Corda was originally designed, so it makes sense that some developers think this way. However, it can quickly become expensive as Corda nodes need a reasonably good machine (Corda Node 4 CPU Core, 8 GB Memory).
One of Corda’s most powerful features is that you can represent multiple identities on a single Corda node. When using Corda accounts, you can scale much more responsibly with the number of customers you have.
If you find that you often have many identities you want to represent with your platform, but they don’t make transactions too often, this might be an excellent way to improve your configuration.
You can run Corda as a system service
Corda is compatible with a wide variety of familiar operating system service managers. You can control Corda with upstart, systemD, Windows service, and more.
This can make running a service in production as simple as
sudo start corda. You can find out more specific details in the Corda documentation.
Reach out to us!
One of the most helpful things is knowing that you can get to one quickly if you need an answer. We have a public developer community that you can reach out to with questions and direct access to help at any time. We run regular office hours, and we strive to answer every question that comes our way. If you want help figuring out an error or support with a particular resource, I highly encourage you to get in touch.
Want to learn more about building awesome blockchain applications on Corda? Be sure to visit corda.net, check out our community page to learn how to connect with other Corda developers, and sign up for one of our newsletters for the latest updates.
— David Awad is a Developer Evangelist at R3, an enterprise blockchain software firm working with a global ecosystem of more than 350 participants across multiple industries from both the private and public sectors to develop on Corda, its open-source blockchain platform, and Corda Enterprise, a commercial version of Corda for enterprise usage.
Follow David on Twitter here.