Skip to content

harimasoor12/governance-ui

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Switchboard Add-in Support

To set this up for development with Switchboard, the first step is to get this to work.

  • install anchorinstall anchor 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

NextJS Typescript Boilerplate

Bootstrap a developer-friendly NextJS app configured with:

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm or Yarn to bootstrap the example:

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 (Documentation).

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.0%
  • Other 1.0%