Skip to content

Commit

Permalink
docs(solana): clarify on what to do with OFT programId (#1068)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazreen authored Nov 21, 2024
1 parent ed49d7d commit 5d03563
Showing 1 changed file with 20 additions and 2 deletions.
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

0 comments on commit 5d03563

Please sign in to comment.