Coder Social home page Coder Social logo

governance-ui's Introduction

Switchboard Add-in Support

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

  • Install 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

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:

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

governance-ui's People

Contributors

abrzezinski94 avatar sebastianbor avatar asktree avatar mschneider avatar bryzettler avatar nramadas avatar stevesarmiento avatar saml33 avatar dependabot[bot] avatar johnrees avatar mury12 avatar dankelleher avatar brittcyr avatar tomjohn1028 avatar jpbogle avatar tlrjs avatar orelsanpls avatar kishithemechanic avatar silas-x avatar mjcage avatar dukemtambo avatar microwavedcola1 avatar emoney023 avatar evgeniivoznyuk avatar kevinheavey avatar 0xcen avatar guibescos avatar sjillen avatar nikarm22 avatar xentoshi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.