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

fix: update path in Solana readme #1146

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
10 changes: 7 additions & 3 deletions examples/oft-solana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ cp .env.example .env

In the `.env` just created, set `SOLANA_PRIVATE_KEY` to your private key value in base58 format. Since the locally stored keypair is in an integer array format, we'd need to encode it into base58 first.

You can run the `npx hardhat lz:solana:base-58` to output your private key in base58 format. Optionally, pass in a value for the `--keypair-file` flag if you want to use the keypair other than the default at `~/.config/solana.id.json`
You can run the `npx hardhat lz:solana:base-58` to output your private key in base58 format. Optionally, pass in a value for the `--keypair-file` flag if you want to use the keypair other than the default at `~/.config/solana/id.json`

Also set the `RPC_URL_SOLANA_TESTNET` value. Note that while the naming used here is `TESTNET`, it refers to the [Solana Devnet](https://docs.layerzero.network/v2/developers/evm/technical-reference/deployed-contracts#solana-testnet). We use `TESTNET` to keep it consistent with the existing EVM testnets.

Expand All @@ -100,14 +100,18 @@ anchor keys sync

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

Run `anchor keys list` to view the generated programIds (public keys). The output should look something like this:
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:
Copy the OFT's programId and go into [lib.rs](./programs/oft/src/lib.rs) (located inside this project under oft-solana/programs/oft/src/lib.rs). Note the following snippet:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lzdane I don't think there's a need for the note in parentheses, the link already links to the right file. Devs can click on it. It's normal assumption that a filename with a link in a README links to a file in the same repo.


```
declare_id!(Pubkey::new_from_array(program_id_from_env!(
Expand Down
2 changes: 1 addition & 1 deletion examples/oft-solana/tasks/solana/base58.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ task('lz:solana:base-58', 'Outputs the base58 string for a keypair')
const keypairJson = JSON.parse(data)
const keypair = Keypair.fromSecretKey(Uint8Array.from(keypairJson))
const base58EncodedPrivateKey = bs58.encode(keypair.secretKey)
console.log(base58EncodedPrivateKey)
console.log(`Base58 encoded private key: ${base58EncodedPrivateKey}`)
})
Loading