sbv2-solana/programs/anchor-vrf-parser
dependabot[bot] b2b7bba5df
Bump eslint and @types/eslint
Bumps [eslint](https://github.com/eslint/eslint) and [@types/eslint](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/eslint). These dependencies needed to be updated together.

Updates `eslint` from 8.14.0 to 8.18.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.14.0...v8.18.0)

Updates `@types/eslint` from 8.4.3 to 8.4.5
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/eslint)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: "@types/eslint"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 23:03:51 +00:00
..
client uprev spl-token 2022-06-29 19:44:33 -06:00
src uprev spl-token 2022-06-29 19:44:33 -06:00
tests cleanup 2022-06-29 21:51:29 -06:00
Cargo.toml refactored example programs 2022-05-18 15:00:17 -06:00
README.md init 2022-05-17 10:42:04 -06:00
Xargo.toml refactored example programs 2022-05-18 15:00:17 -06:00
package.json Bump eslint and @types/eslint 2022-07-01 23:03:51 +00:00
tsconfig.json cleanup 2022-06-29 21:51:29 -06:00

README.md

Switchboard VRF Cross Program Invocation Example

Example repo

Setup

npm i
find secrets/payer-keypair.json || solana-keygen new -s --no-bip39-passphrase --outfile secrets/payer-keypair.json
solana airdrop 1 secrets/payer-keypair.json
solana airdrop 1 secrets/payer-keypair.json
solana airdrop 1 secrets/payer-keypair.json
anchor build
solana-keygen pubkey target/deploy/anchor_vrf_example-keypair.json

Note the program ID.

In the following files, replace the program ID from above:

  • programs/anchor-vrf-example/src/lib.rs
  • Anchor.toml
  • solita.ts

Rebuild the program anchor build.

Devnet Testing

NOTE: Need to re-write test so use switchboard permissionless devnet queue

In Anchor.toml, set the cluster to devnet.

[provider]
cluster = "devnet"
wallet = "secrets/payer-keypair.json"

Then deploy and run the tests.

anchor test

Localnet Testing

In Anchor.toml, set the cluster to localnet.

[provider]
cluster = "localnet"
wallet = "secrets/payer-keypair.json"

Create a localnet switchboard environment

npx sbv2 localnet:env --keypair secrets/payer-keypair.json

In a new shell, start the local validator using the script output from above

chmod +x ./start-local-validator.sh
./start-local-validator.sh

In a new shell, start the local Switchboard oracle

chmod +x ./start-oracle.sh
CLUSTER=localnet ./start-oracle.sh

Run the anchor test using the already running localnet validator

anchor test --skip-local-validator