Skip to content

Commit

Permalink
remove switchboard plugin UI (solana-labs#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
asktree authored Aug 6, 2023
1 parent 636257d commit 31a99ca
Show file tree
Hide file tree
Showing 25 changed files with 10 additions and 16,296 deletions.
58 changes: 0 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +0,0 @@
# Switchboard Add-in Support

## To set this up for development with Switchboard, the first step is to get [this](https://github.com/switchboard-xyz/switchboard-core/blob/main/switchboard_v2/tests/addin-tests.ts) to work.

- [Install Anchor](https://www.anchor-lang.com/docs/installation) if you don't currently have it installed.
- navigate to the `switchboard_v2` directory within `switchboard-core` and run `anchor test`. This will build switchboardv2 and run the addin-tests.ts script, which will set up a realm, governance, queue, oracles, permissions, and proposal.
- you will need to make sure the pubkeys of the governance program and switchboard program throughout the codebase are pointed to your local pubkeys of those programs:
- you can determine the pubkeys of the localnet switchboardv2 and governance programs by navigating to `switchboard-core/switchboard_v2/target/deploy` and running `solana-keygen pubkey switchboard_v2-keypair.json` and `solana-keygen pubkey spl_governance-keypair.json` respectively
- You'll need to set the `declare_id!(...)` in Switchboardv2's `lib.rs` to point at your localnet switchboard program's pubkey, and you'll need to set Switchboardv2's `lib.rs` `GOVERNANCE_PID` variable to the spl_governance pubkey.
- you'll also need to ensure that `sbv2.ts` variable GOVERNANCE_PID points at the correct pubkey for your localnet governance program
- when you want to run the UI, start a local validator by running `solana-test-validator`. This will created a directory called `test-ledger` in the location you run the command.
- run the addin test suite, `anchor test`
- start the governance-ui by running `yarn dev`

## Working on governance-ui

- most of the work is in `hooks/useRealm.ts` and `hooks/useVotingPlugins.ts` in the governance-ui. The UI work is in `components/TokenBalance`

## Changing dependencies
Whenever you change dependencies (adding, removing, or updating, either in package.json or yarn.lock), there are various files that must be kept up-to-date.

`yarn.lock`:
- Run yarn again after your changes to ensure yarn.lock has been properly updated.
- Run `yarn deduplicate` to remove duplicate dependencies from the lockfile.

The `allow-scripts` configuration in `package.json`:
- Run `yarn allow-scripts auto` to update the `allow-scripts` configuration automatically. This config determines whether the package's install/postinstall scripts are allowed to run.
- Alternatively update the `allow-scripts` section manually.
- Review each new package to determine whether the install script needs to run or not, testing if necessary.
- Use `npx can-i-ignore-scripts` to help assessing whether scripts are needed

# NextJS Typescript Boilerplate

Bootstrap a developer-friendly NextJS app configured with:

- [Typescript](https://www.typescriptlang.org/)
- Linting with [ESLint](https://eslint.org/)
- Formatting with [Prettier](https://prettier.io/)
- Linting, typechecking and formatting on by default using [`husky`](https://github.com/typicode/husky) for commit hooks
- Testing with [Jest](https://jestjs.io/) and [`react-testing-library`](https://testing-library.com/docs/react-testing-library/intro)

## Deploy your own

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-typescript-eslint-jest&project-name=with-typescript-eslint-jest&repository-name=with-typescript-eslint-jest)

## How to use

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:

```bash
npx create-next-app --example with-typescript-eslint-jest with-typescript-eslint-jest-app
# or
yarn create next-app --example with-typescript-eslint-jest with-typescript-eslint-jest-app
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
Loading

0 comments on commit 31a99ca

Please sign in to comment.