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

HIP-110: Proxy voting #154

Merged
merged 44 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
de5a5b7
WIP: About to change to proxy assignment rename
ChewingGlass May 3, 2024
dde599b
Finish refactor to proxy assignments
ChewingGlass May 3, 2024
29da73b
Remove instances of useHeliumVsr for useGovernance
bryzettler May 13, 2024
02d2503
Propposal takes 100% width on small screens now
bryzettler May 13, 2024
f0840b8
rework some styles on proxies and nuke hard coded color value
bryzettler May 13, 2024
7da543b
change tab title
bryzettler May 14, 2024
da79de1
WIP
ChewingGlass May 24, 2024
2c6183b
WIP: History
ChewingGlass May 29, 2024
0911d14
wip
ChewingGlass May 30, 2024
91fc123
Finish, just need to do more testing
ChewingGlass May 31, 2024
2313f9d
WIP: React query
ChewingGlass Jun 14, 2024
504398d
WIP: React query
ChewingGlass Jun 17, 2024
8744416
Finishing touches
ChewingGlass Jun 21, 2024
344e0c2
Rm yalc
ChewingGlass Jun 21, 2024
29889f1
Fix bugs
ChewingGlass Jul 2, 2024
08d90ff
Fix 404
ChewingGlass Jul 2, 2024
da0ee8b
Fix linking
ChewingGlass Jul 2, 2024
d17b5a9
Fix top callouts
ChewingGlass Jul 3, 2024
3b4143c
Flex layout of position card
bryzettler Jul 3, 2024
2f61ff6
Redesign of positions
bryzettler Jul 3, 2024
b0dac8b
round of style tweaks
bryzettler Jul 3, 2024
c6284e7
remove dup destructuring
bryzettler Jul 3, 2024
391e2c3
style tweaks round 2
bryzettler Jul 3, 2024
76a400f
Proposal view tweaks
bryzettler Jul 8, 2024
a3609b5
add isProxy logic
bryzettler Jul 8, 2024
1899574
Update packages
bryzettler Jul 9, 2024
3d9b44a
update logic for isProxy on position manager
bryzettler Jul 9, 2024
92c749e
Add fix for faster vote txns
ChewingGlass Jul 9, 2024
87c4742
Merge remote-tracking branch 'origin/488-add-recursive-delegatoin' in…
ChewingGlass Jul 9, 2024
0d8e56f
FIx large position actions
ChewingGlass Jul 17, 2024
2bb982c
Purge yalc
ChewingGlass Jul 24, 2024
008cc63
Bump
ChewingGlass Jul 24, 2024
d201f36
Fix build
ChewingGlass Jul 30, 2024
a8b661e
Bump ver
ChewingGlass Jul 30, 2024
da73151
Fix build issue
ChewingGlass Jul 30, 2024
87f58bb
Bugfix
ChewingGlass Aug 1, 2024
37b68d0
Merge remote-tracking branch 'origin/main' into 488-add-recursive-del…
ChewingGlass Sep 9, 2024
b507b87
Fix package versions
ChewingGlass Sep 9, 2024
d563f81
Bugfix image
ChewingGlass Sep 9, 2024
5cfcfd5
Fix build
ChewingGlass Sep 9, 2024
32f3a6e
Fix minor bugs
ChewingGlass Sep 10, 2024
71af3e5
Bump versions
ChewingGlass Sep 10, 2024
0353fa4
Merge remote-tracking branch 'origin/main' into 488-add-recursive-del…
abhay Sep 23, 2024
2c57848
Fix build issues
ChewingGlass Oct 15, 2024
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
124 changes: 124 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,127 @@ A straw poll website that enables a simple straw-poll for Helium related initiat
* A block height deadline is set for the tally to be taken.
* Votes are tallied by the HNT voting "power" of the account. One HNT = 1 Vote.
* DCs sent to an outcome address will be flushed from the system after voting is complete.

## Developing Locally (with proxies)

### 1. Localnet from helium-program-library

Clone helium-program-library. Run

```
anchor localnet
```

Then run

```
./scripts/bootstrap.sh
```

This will create a bunch of keypairs in packages/helium-admin-cli/keypairs. You will need to get the addresses of the HNT, IOT, and MOBILE tokens it created. Then update constants.js in `spl-utils`.

### 2. Make sure modgov idls deployed

Clone modular-governance.

```
./scripts/upgrade-idls.sh
```

### 3. Bootstrap the Helium DAO

In this repo

```
./bin/helium-vote.ts bootstrap --name Helium --mint APqAVo5q9erS8GaXcbJuy3Gx4ikuSzXjzY4SnyppPUm1 --authority $(solana address)
```

### 4. Create a proposal

```
./bin/helium-vote.ts create-proposal --name HIP 110: Proxy Voting --proposalUri https://gist.githubusercontent.com/hiptron/4404ea1e78ed8c92ba5001df45740386/raw/88adb21a40475dd7b6673e816492357fb425c72a/HIP-110-HNT-Vote-Summary.md --orgName Helium
```

### 5. Run the account-postgres-sink for helium-vote-service

Make sure you have a postgres running. I just have a script to run it via docker:

```
#!/bin/bash

docker volume create -o size=10GB pgdata
docker run --shm-size=1g -it --rm -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=postgres -d -v pgdata:/var/lib/postgresql/data postgres:latest

docker logs -f postgres
```

In helium-program-library, cd `packages/account-postgres-sink-service`

Update the `.env` to the following:

```
SOLANA_URL=http://localhost:8899
PGUSER=postgres
PGPASSWORD=postgres
USE_SUBSTREAMS=false
PHOTON_URL=https://photon.komoot.io
USE_KAFKA=false
PROGRAM_ACCOUNT_CONFIGS=/path/to/helium-program-library/packages/account-postgres-sink-service/vote_service_example.json

```

Making sure to update the path to the `vote_service_example.json`

Run

```
yarn dev
```

Then, navigate to `localhost:3000/refresh-accounts`

Every time you make a change to proxies, you will need to re-hit-this endpoint.

### 6. Run the helium-vote service.

cd into helium-program-library/packages/helium-vote-service

Update the .env to:

```
PGDATABASE=postgres
PGUSER=postgres
PGPASSWORD=postgres
```

Then:

```
yarn dev
```

### 7. Run helium-vote on port 3001

In this repo,

```
env PORT=3001 yarn dev
```

Note that if you're using yalc, it's useful to just run:

```
yalc update && rm -rf .next/cache && env PORT=3001 yarn dev
```


### 8. Fund any wallets you're using for testing

```
solana transfer -u http://localhost:8899 exmrL4U6vk6VFoh3Q7fkrPbjpNLHPYFf1J8bqGypuiK 10 --allow-unfunded-recipient
```

Make sure to transfer some fake HNT to whatever wallet you plan to stake with.
```
spl-token transfer -u http://localhost:8899 <hnt-mint> 100 <your-wallet> --allow-unfunded-recipient --fund-recipient
```
2 changes: 1 addition & 1 deletion bin/helium-vote.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ts-node
#!/usr/bin/env npx ts-node

const { hideBin } = require("yargs/helpers");

Expand Down
92 changes: 68 additions & 24 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ const nextConfig = {
port: "",
pathname: "/**/**",
},
{
protocol: "https",
hostname: "helium.io",
port: "",
pathname: "/**/**",
},
{
protocol: "https",
hostname: "*.test-helium.com",
port: "",
pathname: "/**/**",
},
...(process.env.NODE_ENV === "development" ? [
{
protocol: "http",
hostname: "localhost",
port: "8082",
pathname: "/**/**",
},
] : []),
],
},
logging: {
Expand Down Expand Up @@ -1272,122 +1292,146 @@ const nextConfig = {
},
{
source: "/147pXvGVcLKU76D7Hdi7iTTLvLw9qX8jXsCgNkKSHqo3rnfzkby",
destination: "/legacy/147pXvGVcLKU76D7Hdi7iTTLvLw9qX8jXsCgNkKSHqo3rnfzkby",
destination:
"/legacy/147pXvGVcLKU76D7Hdi7iTTLvLw9qX8jXsCgNkKSHqo3rnfzkby",
permanent: true,
},
{
source: "/14rmHKjpZhsnrA2j24KiGzg8teA1zAMRhVGcWVUdmTAomTrJJQf",
destination: "/legacy/14rmHKjpZhsnrA2j24KiGzg8teA1zAMRhVGcWVUdmTAomTrJJQf",
destination:
"/legacy/14rmHKjpZhsnrA2j24KiGzg8teA1zAMRhVGcWVUdmTAomTrJJQf",
permanent: true,
},
{
source: "/146pksPcH7C3Wz8hN5NxL544k1VVq6Z4W2iB14e1yJ1HFJ3Wtf3",
destination: "/legacy/146pksPcH7C3Wz8hN5NxL544k1VVq6Z4W2iB14e1yJ1HFJ3Wtf3",
destination:
"/legacy/146pksPcH7C3Wz8hN5NxL544k1VVq6Z4W2iB14e1yJ1HFJ3Wtf3",
permanent: true,
},
{
source: "/144wSVHr4cuVSjxEC62X1bHuLsc5Hcpq6XBhfSY8BQwiyMborFZ",
destination: "/legacy/144wSVHr4cuVSjxEC62X1bHuLsc5Hcpq6XBhfSY8BQwiyMborFZ",
destination:
"/legacy/144wSVHr4cuVSjxEC62X1bHuLsc5Hcpq6XBhfSY8BQwiyMborFZ",
permanent: true,
},
{
source: "/143vgVpLgC3LcXLZCyXYZiHCFcsH9UNz3vR8CL6SDxTLPL5tWtr",
destination: "/legacy/143vgVpLgC3LcXLZCyXYZiHCFcsH9UNz3vR8CL6SDxTLPL5tWtr",
destination:
"/legacy/143vgVpLgC3LcXLZCyXYZiHCFcsH9UNz3vR8CL6SDxTLPL5tWtr",
permanent: true,
},
{
source: "/14jH67zhctwb3B5NmwiAjaXQuyF7jZMZCAnfyBYhSpRS3L22sQE",
destination: "/legacy/14jH67zhctwb3B5NmwiAjaXQuyF7jZMZCAnfyBYhSpRS3L22sQE",
destination:
"/legacy/14jH67zhctwb3B5NmwiAjaXQuyF7jZMZCAnfyBYhSpRS3L22sQE",
permanent: true,
},
{
source: "/13Z3p82AX8H1EUQF74cP2qq7RmmhbKBAiGWWsyA7WLxQ9NENTVW",
destination: "/legacy/13Z3p82AX8H1EUQF74cP2qq7RmmhbKBAiGWWsyA7WLxQ9NENTVW",
destination:
"/legacy/13Z3p82AX8H1EUQF74cP2qq7RmmhbKBAiGWWsyA7WLxQ9NENTVW",
permanent: true,
},
{
source: "/13Y79HnMVt4Epug2rbLYivMPvrcpC2wYUNbZK5Dga3tw3VBpBjk",
destination: "/legacy/13Y79HnMVt4Epug2rbLYivMPvrcpC2wYUNbZK5Dga3tw3VBpBjk",
destination:
"/legacy/13Y79HnMVt4Epug2rbLYivMPvrcpC2wYUNbZK5Dga3tw3VBpBjk",
permanent: true,
},
{
source: "/13Y79HnMVt4Epug2rbLYivMPvrcpC2wYUNbZK5Dga3tw3VBpBjk",
destination: "/legacy/13Y79HnMVt4Epug2rbLYivMPvrcpC2wYUNbZK5Dga3tw3VBpBjk",
destination:
"/legacy/13Y79HnMVt4Epug2rbLYivMPvrcpC2wYUNbZK5Dga3tw3VBpBjk",
permanent: true,
},
{
source: "/13KaGoC2ED8kEh2sXLZ7eGWrqDUMyFH5k48VQ3LLjU5QoQidMV4",
destination: "/legacy/13KaGoC2ED8kEh2sXLZ7eGWrqDUMyFH5k48VQ3LLjU5QoQidMV4",
destination:
"/legacy/13KaGoC2ED8kEh2sXLZ7eGWrqDUMyFH5k48VQ3LLjU5QoQidMV4",
permanent: true,
},
{
source: "/13rA4AXq5ME5s9FEyZrE4BMjxiAF9W3kU2tnmUH8FkFGsV97jEp",
destination: "/legacy/13rA4AXq5ME5s9FEyZrE4BMjxiAF9W3kU2tnmUH8FkFGsV97jEp",
destination:
"/legacy/13rA4AXq5ME5s9FEyZrE4BMjxiAF9W3kU2tnmUH8FkFGsV97jEp",
permanent: true,
},
{
source: "/14cXnMdXYcS7WKNh33dYUaPeo8bZmRFn5AoPA78AZtAgfFXu9jf",
destination: "/legacy/14cXnMdXYcS7WKNh33dYUaPeo8bZmRFn5AoPA78AZtAgfFXu9jf",
destination:
"/legacy/14cXnMdXYcS7WKNh33dYUaPeo8bZmRFn5AoPA78AZtAgfFXu9jf",
permanent: true,
},
{
source: "/14KhDJUdvAXNVVP5m5cqEaLGNC859sXvpHtxWX9r999pZKC8xAs",
destination: "/legacy/14KhDJUdvAXNVVP5m5cqEaLGNC859sXvpHtxWX9r999pZKC8xAs",
destination:
"/legacy/14KhDJUdvAXNVVP5m5cqEaLGNC859sXvpHtxWX9r999pZKC8xAs",
permanent: true,
},
{
source: "/13UrtNApGd3NbeP3NyyTejqNEPAv3NGxkGjvtwTVdaRs24NT7Wy",
destination: "/legacy/13UrtNApGd3NbeP3NyyTejqNEPAv3NGxkGjvtwTVdaRs24NT7Wy",
destination:
"/legacy/13UrtNApGd3NbeP3NyyTejqNEPAv3NGxkGjvtwTVdaRs24NT7Wy",
permanent: true,
},
{
source: "/14Rjhhz1DXLVmSRdzappqWgD6rfgu6XYxmdaSCvWLyLH8ZWbciK",
destination: "/legacy/14Rjhhz1DXLVmSRdzappqWgD6rfgu6XYxmdaSCvWLyLH8ZWbciK",
destination:
"/legacy/14Rjhhz1DXLVmSRdzappqWgD6rfgu6XYxmdaSCvWLyLH8ZWbciK",
permanent: true,
},
{
source: "/14me3X7jpEmn3eeFfnAkMvUoFU3cN6GAS3CDomqCikr7VQfHWrU",
destination: "/legacy/14me3X7jpEmn3eeFfnAkMvUoFU3cN6GAS3CDomqCikr7VQfHWrU",
destination:
"/legacy/14me3X7jpEmn3eeFfnAkMvUoFU3cN6GAS3CDomqCikr7VQfHWrU",
permanent: true,
},
{
source: "/14hfi6Vs9YmwYLwVHKygqyEqwTERRrx5kfQkVoX1uqMTxiE5EgJ",
destination: "/legacy/14hfi6Vs9YmwYLwVHKygqyEqwTERRrx5kfQkVoX1uqMTxiE5EgJ",
destination:
"/legacy/14hfi6Vs9YmwYLwVHKygqyEqwTERRrx5kfQkVoX1uqMTxiE5EgJ",
permanent: true,
},
{
source: "/14XDEkg1t398kvqvgxMMKH8qzVGNBb1mgHhTjNmc5KkC3XJxu8p",
destination: "/legacy/14XDEkg1t398kvqvgxMMKH8qzVGNBb1mgHhTjNmc5KkC3XJxu8p",
destination:
"/legacy/14XDEkg1t398kvqvgxMMKH8qzVGNBb1mgHhTjNmc5KkC3XJxu8p",
permanent: true,
},
{
source: "/14rifUhocpzdwsrWaG5PDbdREDkzyesKe1hXuWzibv8h9DdqKLe",
destination: "/legacy/14rifUhocpzdwsrWaG5PDbdREDkzyesKe1hXuWzibv8h9DdqKLe",
destination:
"/legacy/14rifUhocpzdwsrWaG5PDbdREDkzyesKe1hXuWzibv8h9DdqKLe",
permanent: true,
},
{
source: "/13NyqFtVKsifrh6HQ7DjSBKXRDi7qLHDoATHogoSgvBh56oZJv8",
destination: "/legacy/13NyqFtVKsifrh6HQ7DjSBKXRDi7qLHDoATHogoSgvBh56oZJv8",
destination:
"/legacy/13NyqFtVKsifrh6HQ7DjSBKXRDi7qLHDoATHogoSgvBh56oZJv8",
permanent: true,
},
{
source: "/14MnuexopPfDg3bmq8JdCm7LMDkUBoqhqanD9QzLrUURLZxFHBx",
destination: "/legacy/14MnuexopPfDg3bmq8JdCm7LMDkUBoqhqanD9QzLrUURLZxFHBx",
destination:
"/legacy/14MnuexopPfDg3bmq8JdCm7LMDkUBoqhqanD9QzLrUURLZxFHBx",
permanent: true,
},
{
source: "/13wCuq7XGnc4xgxPAc9n9ragKsRfmH9t9jB3c1smfKPZWSikZkd",
destination: "/legacy/13wCuq7XGnc4xgxPAc9n9ragKsRfmH9t9jB3c1smfKPZWSikZkd",
destination:
"/legacy/13wCuq7XGnc4xgxPAc9n9ragKsRfmH9t9jB3c1smfKPZWSikZkd",
permanent: true,
},
{
source: "/14iwaexUYUe5taFgb5hx2BZw74z3TSyonRLYyZU1RbddV4bJest",
destination: "/legacy/14iwaexUYUe5taFgb5hx2BZw74z3TSyonRLYyZU1RbddV4bJest",
destination:
"/legacy/14iwaexUYUe5taFgb5hx2BZw74z3TSyonRLYyZU1RbddV4bJest",
permanent: true,
},
{
source: "/13F5AWLhxwTjhDMnZ6ww4oJWgRkBoW9ji4JnDzwQXjsQhiT2kcX",
destination: "/legacy/13F5AWLhxwTjhDMnZ6ww4oJWgRkBoW9ji4JnDzwQXjsQhiT2kcX",
destination:
"/legacy/13F5AWLhxwTjhDMnZ6ww4oJWgRkBoW9ji4JnDzwQXjsQhiT2kcX",
permanent: true,
},
];
Expand Down
Loading
Loading