Skip to content

Commit

Permalink
Cleanup examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lrettig committed Jun 4, 2024
1 parent 30a94ad commit 9f6358a
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 47 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ members = [
"vm/entrypoint",
"vm/precompiles",
]
exclude = [
"examples/hello_world",
]
exclude = ["examples/target"]
resolver = "2"

[workspace.dependencies]
2 changes: 2 additions & 0 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[workspace]
members = [
"fibonacci/script",
"hello_world/script",
"io/script",
]
resolver = "2"
Binary file not shown.
11 changes: 11 additions & 0 deletions examples/hello_world/script/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
version = "0.1.0"
name = "hello_world-script"
edition = "2021"

[dependencies]
serde = { version = "1.0.196", features = ["derive"] }
athena-sdk = { path = "../../../sdk" }

[build-dependencies]
athena-helper = { path = "../../../helper" }
3 changes: 3 additions & 0 deletions examples/hello_world/script/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
athena_helper::build_program(&format!("{}/../program", env!("CARGO_MANIFEST_DIR")));
}
18 changes: 18 additions & 0 deletions examples/hello_world/script/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use athena_sdk::{utils, ExecutionClient, AthenaStdin};

/// The ELF we want to execute inside the zkVM.
const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf");

fn main() {
// Setup a tracer for logging.
utils::setup_logger();

// Create an input stream.
let stdin = AthenaStdin::new();

// Run the given program.
let client = ExecutionClient::new();
let _output = client.execute(ELF, stdin).unwrap();

println!("successful execution")
}
8 changes: 0 additions & 8 deletions examples/simple_add/program/Cargo.toml

This file was deleted.

36 changes: 0 additions & 36 deletions examples/simple_add/program/src/main.rs

This file was deleted.

0 comments on commit 9f6358a

Please sign in to comment.