We, the Solana auditors, at Ackee Blockchain, decided to create a Rust testing client for the popular Solana framework Anchor. We hope this is exciting news for all Anchor developers who prefer Rust over Javascript.

Let’s 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 for the speed and universality of the Solana API is a pretty low-level smart contract (aka Solana program) API. Fortunately, there is the Anchor framework. It’s an opinionated framework designed to mitigate many issues caused by error-prone Solana API and reduce the developer’s cognitive load and the number of non-business decisions needed (e.g., choosing the most suitable account data encoding).

As a result, many Solana projects based on Anchor are growing, and we – the auditors – 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’t been developed yet.

We decided to change that, and the first step is to write the Rust testing client.

What can trdelnik help us with?

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’t help you to start testing the Solana validator, deploy the program and run your scripts.

The Rust testing client for Anchor will do all these things automatically for you. You can think of it as a Brownie for Solana (for those familiar with Ethereum 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.

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 IDL and program code. Or we could write a Rust/Wasm GUI layer for the client – basically Postman 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’s develop better decentralized apps together!

The Trdelnik repository is now publicly accessible on GitHub.

PS: You might ask – why Trdelnik? 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.

 

Follow us on Twitter for updates, or join us on Discord. You can also subscribe to our blog posts to read about other news from the blockchain world.