Skip to content

Commit

Permalink
solana: Update README prerequisites and testing instructions (#491)
Browse files Browse the repository at this point in the history
* solana: Update README

* solana: Add screenshots for troubleshooting section in README
  • Loading branch information
nvsriram committed Jul 31, 2024
1 parent d4563e3 commit ef20b45
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 7 deletions.
54 changes: 47 additions & 7 deletions solana/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Solana
# Solana

## Prequisities

Ensure that you are using the correct version of the Solana and Anchor CLI tools by consulting `Anchor.toml`.

```toml
[toolchain]
anchor_version = "0.29.0" # CLI
solana_version = "1.17.2"
solana_version = "1.18.10"
```

You will also need to install the toolchain listed in `rust-toolchain`.
You will also need to install the toolchain listed in `rust-toolchain`. You can verify this by running:

```sh
rustup show
```

## Design Overview

Expand Down Expand Up @@ -92,8 +97,6 @@ Program log: Instruction: ReleaseInboundMint
Program log: Instruction: ReleaseInboundUnlock
```



## Testing

The test files are loacated in the `sdk/solana/__tests__/` directory
Expand All @@ -103,5 +106,42 @@ In order to run them, the Solana programs must be built and their IDL made avail
To ensure the SDK has the generated IDL, run the tests with the make command:

```sh
make anchor-test
```
make test
```

### Troubleshooting

<details>
<summary><code>make: *** No rule to make target `test'. Stop.</code></summary>

- Ensure `Makefile` has target `test`
</details>

<details>
<summary><code>tsx: command not found</code></summary>

- Screenshot:
<img src="images/tsx-command-not-found.png" alt="tsx command not found screenshot">
- Update `Makefile` ([line #29](https://github.com/wormhole-foundation/example-native-token-transfers/blob/main/solana/Makefile#L29)) from:

```sh
tsx scripts/regenerateIdl.ts $$jsonfile > $$tsfile; \
```

to:

```sh
npx tsx scripts/regenerateIdl.ts $$jsonfile > $$tsfile; \
```

</details>

<details>
<summary><code>Lifecycle script `build:esm` failed with error</code></summary>

- Screenshot:
<img src="images/lifecycle-script.png" alt="lifecycle script screenshot">
- This occurs due to Typescript files failing compilation.
- [`patch-idl` script](https://github.com/wormhole-foundation/example-native-token-transfers/blob/main/solana/scripts/patch-idl) requires [`jq`](https://jqlang.github.io/jq/) to be installed. Install `jq` and retry.

</details>
Binary file added solana/images/lifecycle-script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added solana/images/tsx-command-not-found.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ef20b45

Please sign in to comment.