{"id":32,"date":"2021-11-05T12:34:17","date_gmt":"2021-11-05T11:34:17","guid":{"rendered":"https:\/\/abch-330809.firebaseapp.com\/blog\/?p=32"},"modified":"2022-08-24T11:28:47","modified_gmt":"2022-08-24T09:28:47","slug":"announcing-trdelnik-rust-testing-client-for-anchor","status":"publish","type":"post","link":"https:\/\/ackee.xyz\/blog\/announcing-trdelnik-rust-testing-client-for-anchor\/","title":{"rendered":"Announcing Trdelnik &#8211; Rust testing client for Anchor"},"content":{"rendered":"<p class=\"p1\">Ackee Blockchain Security auditors have decided to <strong>create a Rust testing client<\/strong> for the popular Solana framework\u00a0<a href=\"https:\/\/www.anchor-lang.com\/docs\"><span class=\"s1\">Anchor<\/span><\/a>.\u00a0We hope this is exciting news for all Anchor developers who prefer Rust over Javascript.<\/p>\n<p class=\"p1\">Let\u2019s talk about the motivation for writing such a client and then the details.<\/p>\n<h4>The motivation<\/h4>\n<p class=\"p1\">Solana is an awesome Rust blockchain. The top <a href=\"https:\/\/solana.com\/\">Solana<\/a> priority is performance. However, the trade-off for the speed and universality of the Solana API is a pretty low-level <a href=\"https:\/\/ackeeblockchain.com\/blog\/glossary\/smart-contract\/\">smart contract<\/a> (aka Solana <i>program<\/i>) API. Fortunately, there is the Anchor framework. It\u2019s an opinionated framework designed to mitigate many issues caused by error-prone Solana API and reduce the developer&#8217;s cognitive load and the number of non-business decisions needed (e.g., choosing the most suitable <i>account<\/i> data encoding).<\/p>\n<p class=\"p1\">As a result, many Solana projects based on Anchor are growing, and we &#8211; the auditors &#8211; have to adapt to this trend. And since we want to be as efficient as possible to find all security issues and save our clients time and money, we need the best tooling for the job. But the Solana ecosystem, especially the Anchor one, is super new, and the necessary tools haven\u2019t been developed yet.<\/p>\n<p class=\"p1\"><strong>We decided to change that, and the first step is to write the Rust testing client.<\/strong><\/p>\n<h4>What can trdelnik help us with?<\/h4>\n<p class=\"p1\">Anchor can generate JavaScript\/TypeScript client program code. But we hope nobody wants to use JavaScript where security, performance, and reliability are priorities. The generated code also doesn\u2019t help you to start testing the Solana <i>validator, <\/i>deploy the <i>program<\/i> and run your scripts.<\/p>\n<p class=\"p1\">The Rust testing client for Anchor will do all these things automatically for you. You can <strong>think of it as a <a href=\"https:\/\/ackeeblockchain.com\/blog\/glossary\/brownie\/\">Brownie<\/a> for Solana<\/strong> (for those familiar with\u00a0Ethereum tooling). It will consist of a CLI tool and a library with test helpers and APIs for connecting various plugins. A fuzzer will be one of the plugins.<\/p>\n<p class=\"p1\">However, the CLI tool and the library with helpers are just the beginning. I imagine we could generate test scenarios and schemas from the Anchor <a href=\"https:\/\/en.wikipedia.org\/wiki\/Interface_description_language\"><span class=\"s1\">IDL<\/span><\/a> and program code. Or we could write a Rust\/Wasm GUI layer for the client &#8211; basically <a href=\"https:\/\/www.postman.com\/\"><span class=\"s1\">Postman<\/span><\/a> for Anchor\/Solana on steroids. The project could also help us remove the unnecessary JavaScript layer and allow us to write Rust-only apps with Anchor. Let\u2019s develop better decentralized apps together!<\/p>\n<h5 class=\"p1\" style=\"text-align: left;\"><a href=\"https:\/\/github.com\/Ackee-Blockchain\/trdelnik\"><strong>The Trdelnik repository is now publicly accessible on GitHub.<\/strong><\/a><\/h5>\n<p class=\"p1\">PS: You might ask &#8211; <strong>why Trdelnik?<\/strong> Well, since we plan to write Brownie for Solana, we were looking for a similar name. Ackee Blockchain comes from Prague, where the typical sweet that everyone sells to tourists on the street is called Trdelnik. So we decided to adopt it, haha.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Follow us on <a href=\"https:\/\/twitter.com\/ackeeblockchain\"><span class=\"s1\">Twitter<\/span><\/a> for updates, or join us on <a href=\"https:\/\/discord.gg\/2HgPXQZVzP\"><span class=\"s1\">Discord<\/span><\/a>. You can also subscribe to our blog posts to read about other news from the blockchain world.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ackee Blockchain Security auditors have decided to create a Rust testing client for the popular Solana framework\u00a0Anchor.\u00a0We hope this is exciting news for all Anchor developers who prefer Rust over Javascript. Let\u2019s talk about the motivation for writing such a client and then the details. The motivation Solana is an awesome Rust blockchain. The top Solana priority is performance. However, the trade-off&hellip;<\/p>\n","protected":false},"author":8,"featured_media":251,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[7,2,9,8,6,15],"class_list":["post-32","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-solana","tag-anchor","tag-anchor-client-rust-solana","tag-open-source","tag-rust","tag-solana","tag-trdelnik"],"aioseo_notices":[],"featured_image_src":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2021\/11\/Na\u0301vrh-bez-na\u0301zvu-2-600x400.png","featured_image_src_square":"https:\/\/ackee.xyz\/blog\/wp-content\/uploads\/2021\/11\/Na\u0301vrh-bez-na\u0301zvu-2-600x600.png","author_info":{"display_name":"Martin Kavik","author_link":"https:\/\/ackee.xyz\/blog\/author\/martin-kavik\/"},"_links":{"self":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":0,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media\/251"}],"wp:attachment":[{"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ackee.xyz\/blog\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}