From 0f5c424837177cac16edecb18e36ca2106ebc9b2 Mon Sep 17 00:00:00 2001 From: Jon C Date: Thu, 5 Sep 2024 23:41:11 +0200 Subject: [PATCH] README: Add info about what this is --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/README.md b/README.md index ca628c2..e2d71b8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,74 @@ # solana-program-rosetta + Multiple implementations of Solana programs across languages + +More programs will be added over time! + +## Getting started + +### Prerequisite for all languages + +* Install Rust: https://www.rust-lang.org/tools/install + +### Rust + +* Install Solana tools + +```console +./install-solana.sh +``` + +* Go to a program directory + +```console +cd helloworld +``` + +* Build a program + +```console +cargo build-sbf +``` + +* Test a program + +```console +cargo test-sbf +``` + +### Zig + +* Get the compiler + +```console +./install-solana-zig.sh +``` + +* Go to the Zig implementation of a program + +```console +cd helloworld/zig +``` + +* Build the program + +```console +../../solana-zig/zig build +``` + +* Test it + +```console +cd .. +SBF_OUT_DIR="./zig/zig-out/lib" cargo test" +``` + +* OR use the helper from the root of this repo to build and test + +```console +./test-zig helloworld +``` + +## Current Programs + +* Helloworld: logs a static string using the `sol_log_` syscall