Skip to content

Commit

Permalink
merge solana-sc
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwen01 committed Oct 8, 2024
2 parents f8a094b + 2826af5 commit 5c6f192
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ function createVerifyInstruction(pubkey: PublicKey, proof_path: string): Transac

### Running the solana program

Running the solana program and tests requires the following
* [Node.js](https://nodejs.org/en/download)
* [yarn](https://yarnpkg.com/getting-started/install)
* [Solana CLI](https://docs.solana.com/cli/install-solana-cli)
* Make sure to install the edge version. Run the following:
```shell
sh -c "$(curl -sSfL https://release.anza.xyz/edge/install)"
```
* [Rust](https://www.rust-lang.org/tools/install)

```shell
cd solana
npm install
Expand Down
2 changes: 1 addition & 1 deletion example/solana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "Apache-2.0",
"private": false,
"scripts": {
"test": "pnpm ts-mocha -p ./tests/tsconfig.test.json -t 1000000 ./tests/counter.test.ts",
"test": "pnpm ts-mocha -p ./tests/tsconfig.test.json -t 1000000 ./tests/verifier.test.ts",
"build-and-test": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./tests/fixtures && pnpm test",
"build": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so",
"deploy": "solana program deploy ./program/target/so/program.so"
Expand Down
5 changes: 5 additions & 0 deletions example/solana/program/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ pub fn process_instruction(
_accounts: &[AccountInfo],
instruction_data: &[u8],
) -> ProgramResult {
// Deserialize the fixture from the instruction data.
let fixture = SP1ProofFixture::try_from_slice(instruction_data).unwrap();

// Get the SP1 Groth16 verification key from the `groth16-solana` crate.
let vk = groth16_solana::GROTH16_VK_BYTES;

// Verify the proof.
let result = verify_proof_fixture(&fixture, &vk);
msg!("Result: {:?}", result);
Ok(())
Expand Down
File renamed without changes.

0 comments on commit 5c6f192

Please sign in to comment.