-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |