Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(solana): clarify on what to do with OFT programId #1068

Merged
merged 4 commits into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions examples/oft-solana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## Setup

We recommend using `pnpm` as a package manager (but you can of course use a package manager of your choice).
Additionally, we highly recommend that you use the most up-to-date Docker version to avoid any issues with anchor
Docker is required to build using anchor. We highly recommend that you use the most up-to-date Docker version to avoid any issues with anchor
builds.

### Get the code
Expand Down Expand Up @@ -49,10 +49,28 @@ anchor keys sync

:warning: `--force` flag overwrites the existing keys with the ones you generate.

:warning: Ensure that [lib.rs](./programs/oft/src/lib.rs) has the updated programId.
Run `anchor keys list` to view the generated programIds (public keys). The output should look something like this:

```
endpoint: <ENDPOINT_PROGRAM_ID>
oft: <OFT_PROGRAM_ID>
```

Copy the OFT's programId and go into [lib.rs](./programs/oft/src/lib.rs). Note the following snippet:

```
declare_id!(Pubkey::new_from_array(program_id_from_env!(
"OFT_ID",
"9UovNrJD8pQyBLheeHNayuG1wJSEAoxkmM14vw5gcsTT"
)));
```

Replace `9UovNrJD8pQyBLheeHNayuG1wJSEAoxkmM14vw5gcsTT` with the programId that you have copied.

### Building and Deploying the OFT Program

Ensure you have Docker running before running the build command.

```bash
anchor build -v # verification flag enabled
solana program deploy --program-id target/deploy/oft-keypair.json target/verifiable/oft.so -u mainnet-beta
Expand Down