Skip to content

Commit 4bc8844

Browse files
authored
Update README.md
1 parent 09c6330 commit 4bc8844

File tree

1 file changed

+55
-59
lines changed

1 file changed

+55
-59
lines changed

README.md

Lines changed: 55 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,60 @@ Or run a new release to mainnet on every tag push for example.
160160
Or you can setup a matrix build for multiple programs and networks.
161161
Customize the workflow to your needs!
162162
163-
### Running the actions locally
163+
## How to setup Squads integration:
164+
165+
In general its recommended to use the [Squads Multisig](https://docs.squads.so/squads-cli/overview) to manage your programs.
166+
It makes your program deployments more secure and is considered good practice.
167+
168+
1. Setup a new squad in [Squads](https://v4.squads.so/squads/) then transfer your program authority to the squad.
169+
170+
<img width="1345" alt="image" src="https://github.com/user-attachments/assets/c1b9d003-806f-4389-bf4c-3275f180f479" />
171+
172+
173+
2. Add your local keypair to the squad as a member (At least needs to have voter permissions) so that you can propose transactions. And also add that keypair as a github secret.
174+
To run it locally add the following to your .secrets file:
175+
176+
```bash
177+
DEVNET_DEPLOYER_KEYPAIR=
178+
MAINNET_DEPLOYER_KEYPAIR=
179+
```
180+
181+
<img width="832" alt="image" src="https://github.com/user-attachments/assets/492eee0c-48d0-4748-838e-849d7b91f773" />
182+
183+
184+
2. Add the following to your .secrets file if you want to run it locally or add them to your github secrets if you want to run it in github actions:
185+
186+
```bash
187+
DEVNET_MULTISIG= # Sadly at the time of writing squads V4 does not support devnet
188+
DEVNET_MULTISIG_VAULT= # Sadly at the time of writing squads V4 does not support devnet
189+
MAINNET_MULTISIG=
190+
MAINNET_MULTISIG_VAULT=
191+
```
192+
193+
Where Multisig vault is the address you can find on the top left corner in the [Squads Dachboard](https://v4.squads.so/squads/)
194+
The MULTISIG is the address of the multisig you want to use this one you can find the the settings. Its a bit more hidden so that people dont accidentally use it as program upgrade authority.
195+
196+
<img width="1735" alt="image" src="https://github.com/user-attachments/assets/34584a9a-62b9-42c9-a6c4-4e4bf99e6631" />
197+
198+
What this workflow will do is write a program and an IDL buffer for your program and then propose a transaction that you can approve in the Squads UI.
199+
200+
201+
Close Buffer:
202+
203+
You may need this in case your deploy failed and you want to close a buffer that was already transfered to your multisig.
204+
205+
```bash
206+
solana program show --buffers --buffer-authority <You multisig vault address>
207+
208+
npx ts-node scripts/squad-closebuffer.ts \
209+
--rpc "https://api.mainnet-beta.solana.com" \
210+
--multisig "FJviNjW3L2u2kR4TPxzUNpfe2ZjrULCRhQwWEu3LGzny" \
211+
--buffer "7SGJSG8aoZj39NeAkZvbUvsPDMRcUUrhRhPzgzKv7743" \
212+
--keypair ~/.config/solana/id.json \
213+
--program "BhV84MZrRnEvtWLdWMRJGJr1GbusxfVMHAwc3pq92g4z"
214+
```
215+
216+
### Running the actions locally (optional)
164217

165218
If you for some reason want to run the actions locally you can do so with the following commands using the act command.
166219

@@ -186,7 +239,7 @@ act -W .github/workflows/reusable-build.yaml \
186239

187240
2. Run anchor tests
188241

189-
Note: The anchor tests use solana-test-validator which does not work in act docker container on mac because of AVX dependency. Wither run them in github, locally without docker or open PR to fix it. I couldnt find a nice way to fix it.
242+
Note: The anchor tests use solana-test-validator which does not work in act docker container on mac because of AVX dependency. Either run them in github, locally without docker or open PR to fix it. I couldnt find a nice way to make local-test-validator run in act.
190243
You can adjust the workflow to run your specific tests as well.
191244

192245
```bash
@@ -197,49 +250,6 @@ act -W .github/workflows/test.yaml \
197250
--input program=transaction-example
198251
```
199252

200-
## How to setup Squads integration:
201-
202-
In general its recommended to use the [Squads Multisig](https://docs.squads.so/squads-cli/overview) to manage your programs.
203-
It makes your program deployments more secure and is considered good practice.
204-
205-
1. Setup a new squad in [Squads](https://v4.squads.so/squads/) then transfer your program authority to the squad.
206-
207-
2. Add your local keypair to the squad as a member (At least needs to be a voter) so that you can propose transactions. And also add that keypair as a github secret.
208-
To run it locally add the following to your .secrets file:
209-
210-
![alt text](image.png)
211-
212-
```bash
213-
DEVNET_DEPLOYER_KEYPAIR=
214-
MAINNET_DEPLOYER_KEYPAIR=
215-
```
216-
217-
2. Add the following to your .secrets file if you want to run it locally or add them to your github secrets if you want to run it in github actions:
218-
219-
```bash
220-
DEVNET_MULTISIG=
221-
DEVNET_MULTISIG_VAULT=
222-
MAINNET_MULTISIG=
223-
MAINNET_MULTISIG_VAULT=
224-
```
225-
226-
Where Multisig vault is the address you can find on the top left corner in the [Squads Dachboard](https://v4.squads.so/squads/)
227-
The MULTISIG is the address of the multisig you want to use this one you can find the the settings. Its a bit more hidden so that people dont accidentally use it as program upgrade authority.
228-
229-
What this will do is write a program and an IDL buffer for your program and then propose a transaction that you can approve in the Squads UI.
230-
231-
4. Now you can run the workflow with the following command:
232-
233-
```bash
234-
act -W .github/workflows/build.yaml \
235-
--container-architecture linux/amd64 \
236-
--secret-file .secrets \
237-
workflow_dispatch \
238-
--input program=transaction-example \
239-
--input network=devnet \
240-
--input deploy=true \
241-
--input upload_idl=true --input use-squads=true --input verify=true
242-
```
243253

244254
## 📝 Todo List
245255

@@ -273,17 +283,3 @@ act -W .github/workflows/build.yaml \
273283
- [ ] Add Codama support
274284
- [ ] Add to solana helpers or mucho -> release
275285

276-
Close Buffer:
277-
278-
You may need this in case your deploy failed and you want to close a buffer that was already transfered to your multisig.
279-
280-
```bash
281-
solana program show --buffers --buffer-authority <You multisig vault address>
282-
283-
npx ts-node scripts/squad-closebuffer.ts \
284-
--rpc "https://api.mainnet-beta.solana.com" \
285-
--multisig "FJviNjW3L2u2kR4TPxzUNpfe2ZjrULCRhQwWEu3LGzny" \
286-
--buffer "7SGJSG8aoZj39NeAkZvbUvsPDMRcUUrhRhPzgzKv7743" \
287-
--keypair ~/.config/solana/id.json \
288-
--program "BhV84MZrRnEvtWLdWMRJGJr1GbusxfVMHAwc3pq92g4z"
289-
```

0 commit comments

Comments
 (0)