Skip to content

Commit 5301087

Browse files
committed
more identation
1 parent e74e226 commit 5301087

File tree

1 file changed

+63
-51
lines changed

1 file changed

+63
-51
lines changed

release_process.md

Lines changed: 63 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ There are two important concepts you need to know about Sputnik. There is a *mot
88
- the factory aka *the mother*: it is considered to be the mother of all the DAOs, since it's responsible for creating them. A new child (DAO) is born when calling the `create` method on the mother (factory) contract (check `sputnikdao-factory2/src/lib.rs` for the factory code).
99
- the DAOs aka *the children*: once created, they become independent from their mother and they have their own set of rules and policies that help them with self-governance (check `sputnikdao2/src/lib.rs` for the DAO code).
1010

11+
***
12+
1113
## History of Sputnik - Searching through the archives:
1214

1315
### Sputnik V1 smart contracts
@@ -43,49 +45,51 @@ There are two important concepts you need to know about Sputnik. There is a *mot
4345
- https://v2.sputnik.fund/ -> it uses v2 smart contracts
4446
- https://astrodao.com/ -> it uses v2 smart contracts
4547

48+
***
49+
4650
## Introducing Sputnik v3 smart contracts
4751

4852
The biggest advantage of v3 smart contracts is introducing an easy way for the DAO to upgrade to a new version of the code so it can take full advantage of the new features/performance improvements/bug fixes.
4953

5054
Since this is the first time that the factory and the DAO are being upgraded and upgrading smart contracts is a very sensitive topic, everything must be done with due diligence.
5155

52-
## v3 Release Plan
56+
### v3 Release Plan
5357

54-
[1. Upgrade the factory from v2 to v3 and then set up the default code for the DAO to be v2.](#upgrade-the-factory-from-v2-to-v3)
55-
[2. After we get enough confidence using factory v3 and DAO v2, change the default code for the DAO from v2 to v3.](#change-dao-default-code-from-v2-to-v3)
56-
[3. Existing DAOs will need to migrate from v2 to v3.](#migrate-dao-from-v2-to-v3)
58+
[1 Upgrade the factory from v2 to v3 and then set up the default code for the DAO to be v2.](#1-upgrade-the-factory-from-v2-to-v3)
59+
[2 After we get enough confidence using factory v3 and DAO v2, change the default code for the DAO from v2 to v3.](#2-change-dao-default-code-from-v2-to-v3)
60+
[3 Existing DAOs will need to migrate from v2 to v3.](#3-migrate-dao-from-v2-to-v3)
5761

58-
---
59-
60-
### Upgrade the factory from v2 to v3
62+
### 1 Upgrade the factory from v2 to v3
6163

6264
This should be done in the following order:
63-
- [testnet - using a personal account](#using-personal-account-on-testnet)
64-
- [testnet - using the official testnet factory account](#using-official-account-on-testnet)
65-
- [mainnet - using the official mainnet factory account](#using-official-account-on-mainnet)
65+
- [testnet - using a personal account](#1-1-using-personal-account-on-testnet)
66+
- [testnet - using the official testnet factory account](#1-2-using-official-account-on-testnet)
67+
- [mainnet - using the official mainnet factory account](#1-3-using-official-account-on-mainnet)
68+
69+
___
6670

67-
#### Using personal account on testnet
71+
### 1 1 Using personal account on testnet
6872

69-
**1. Create a new NEAR account for the factory:**
73+
***1. Create a new NEAR account for the factory:***
7074

7175
```bash
7276
near create-account sputnik-factory.ctindogaru.testnet --masterAccount ctindogaru.testnet --initialBalance 50
7377
```
7478

75-
**2. Deploy the factory code:**
79+
***2. Deploy the factory code:***
7680
```bash
7781
./build.sh
7882
```
7983
```bash
8084
near deploy sputnik-factory.ctindogaru.testnet sputnikdao-factory2/res/sputnikdao_factory2.wasm
8185
```
8286

83-
**3. Init the factory:**
87+
***3. Init the factory:***
8488
```bash
8589
near call sputnik-factory.ctindogaru.testnet new '{}' --accountId sputnik-factory.ctindogaru.testnet --gas 100000000000000
8690
```
8791

88-
**4. Download the current `wasm` code used for creating new DAOs:**
92+
***4. Download the current `wasm` code used for creating new DAOs:***
8993

9094
```bash
9195
near view sputnikv2.testnet get_dao_list
@@ -98,26 +102,26 @@ params:='{"request_type":"view_code","finality":"final","account_id":"thegame.sp
98102
| base64 --decode > dao-code-v2.wasm
99103
```
100104

101-
**5. Use the code downloaded at the previous step and store it inside the factory as the default code used for creating new DAOs:**
105+
***5. Use the code downloaded at the previous step and store it inside the factory as the default code used for creating new DAOs:***
102106
```bash
103107
BYTES='cat dao-code-v2.wasm | base64'
104108
```
105109
```bash
106110
near call sputnik-factory.ctindogaru.testnet store $(eval "$BYTES") --base64 --accountId sputnik-factory.ctindogaru.testnet --gas 100000000000000 --amount 10
107111
```
108112

109-
**6. Use the code hash returned from the previous step to store the metadata associated with the code:**
113+
***6. Use the code hash returned from the previous step to store the metadata associated with the code:***
110114
```bash
111115
near call sputnik-factory.ctindogaru.testnet store_contract_metadata '{"code_hash": "ZGdM2TFdQpcXrxPxvq25514EViyi9xBSboetDiB3Uiq", "metadata": {"version": "v2", "commit_id": "c2cf1553b070d04eed8f659571440b27d398c588"}, "set_default": true}' --accountId sputnik-factory.ctindogaru.testnet
112116
```
113117

114-
**7. See all the contract versions stored inside the factory:**
118+
***7. See all the contract versions stored inside the factory:***
115119
```bash
116120
near view sputnik-factory.ctindogaru.testnet get_contracts_metadata
117121
```
118122
2 versions should be displayed. The one that got created on init and the one that you stored in the previous step.
119123

120-
**8. Try to create a new DAO from the factory - using NEAR CLI:**
124+
***8. Try to create a new DAO from the factory - using NEAR CLI:***
121125
```bash
122126
export COUNCIL='["ctindogaru.testnet"]'
123127
```
@@ -128,28 +132,30 @@ export ARGS=`echo '{"config": {"name": "ctindogaru-dao", "purpose": "ctindogaru
128132
near call sputnik-factory.ctindogaru.testnet create "{\"name\": \"ctindogaru-dao\", \"args\": \"$ARGS\"}" --accountId sputnik-factory.ctindogaru.testnet --gas 150000000000000 --amount 10
129133
```
130134

131-
**9. See all the DAOs created by the factory:**
135+
***9. See all the DAOs created by the factory:***
132136
```bash
133137
near view sputnik-factory.ctindogaru.testnet get_dao_list
134138
```
135139
The DAO created in the previous step should be displayed here.
136140

137-
**10. Try to interact with the DAO and make sure everything works:**
141+
***10. Try to interact with the DAO and make sure everything works:***
138142
```bash
139143
near view ctindogaru-dao.sputnik-factory.ctindogaru.testnet get_available_amount
140144
```
141145

142-
#### Using official account on testnet
146+
___
143147

144-
**1. Upgrade the factory code:**
148+
### 1 2 Using official account on testnet
149+
150+
***1. Upgrade the factory code:***
145151
```bash
146152
./build.sh
147153
```
148154
```bash
149155
near deploy sputnikv2.testnet sputnikdao-factory2/res/sputnikdao_factory2.wasm
150156
```
151157

152-
**2. Download the current `wasm` code used for creating new DAOs:**
158+
***2. Download the current `wasm` code used for creating new DAOs:***
153159

154160
```bash
155161
near view sputnikv2.testnet get_dao_list
@@ -162,99 +168,105 @@ params:='{"request_type":"view_code","finality":"final","account_id":"thegame.sp
162168
| base64 --decode > dao-code-v2.wasm
163169
```
164170

165-
**3. Use the code downloaded at the previous step and store it inside the factory as the default code used for creating new DAOs:**
171+
***3. Use the code downloaded at the previous step and store it inside the factory as the default code used for creating new DAOs:***
166172
```bash
167173
BYTES='cat dao-code-v2.wasm | base64'
168174
```
169175
```bash
170176
near call sputnikv2.testnet store $(eval "$BYTES") --base64 --accountId sputnikv2.testnet --gas 100000000000000 --amount 10
171177
```
172178

173-
**4. Use the code hash returned from the previous step to store the metadata associated with the code:**
179+
***4. Use the code hash returned from the previous step to store the metadata associated with the code:***
174180
```bash
175181
near call sputnikv2.testnet store_contract_metadata '{"code_hash": "ZGdM2TFdQpcXrxPxvq25514EViyi9xBSboetDiB3Uiq", "metadata": {"version": "v2", "commit_id": "c2cf1553b070d04eed8f659571440b27d398c588"}, "set_default": true}' --accountId sputnikv2.testnet
176182
```
177183

178-
**5. See all the contract versions stored inside the factory:**
184+
***5. See all the contract versions stored inside the factory:***
179185
```bash
180186
near view sputnikv2.testnet get_contracts_metadata
181187
```
182188
Only the version stored in the previous step should be displayed.
183189

184-
**6. Try to create a new DAO using the new factory - using Astro DAO:**
190+
***6. Try to create a new DAO using the new factory - using Astro DAO:***
185191

186192
Go to https://testnet.app.astrodao.com/all/daos and try to create a new DAO from the UI. It should use the new version of the factory code.
187193

188194
Please note that the DAO itself is still v2. The only difference is that the DAO gets created through the v3 version of the factory.
189195

190-
#### Using official account on mainnet
196+
___
197+
198+
### 1 3 Using official account on mainnet
191199

192200
The process is very similar with 1.2.
193201

194-
---
202+
___
195203

196-
### Change DAO default code from v2 to v3
204+
### 2 Change DAO default code from v2 to v3
197205

198206
After a few weeks of running factory v3 + DAO v2, it's time to step up the game and upgrade the default DAO version to v3.
199207

200208
This should be done in the following order:
201-
- 1. testnet, using the official testnet factory account
202-
- 2. mainnet, using the official mainnet factory account
209+
- [testnet - using the official testnet factory account](#2-1-using-official-account-on-testnet)
210+
- [mainnet - using the official mainnet factory account](#2-2-using-official-account-on-mainnet)
203211

204212
Assumptions:
205213
- the DAO v3 code will be a snapshot of the code from commit id 596f27a649c5df3310e945a37a41a957492c0322.
206214

207-
#### 2.1 Testnet - using official factory account
215+
___
208216

209-
**1. Checkout to the right commit id**
217+
### 2 1 Using official account on testnet
218+
219+
***1. Checkout to the right commit id***
210220
```bash
211221
git checkout 596f27a649c5df3310e945a37a41a957492c0322
212222
```
213223

214-
**2. Build the DAO v3 code:**
224+
***2. Build the DAO v3 code:***
215225
```bash
216226
./build.sh
217227
```
218228

219-
**3. Use the code built at the previous step and store it inside the factory as the default code used for creating new DAOs:**
229+
***3. Use the code built at the previous step and store it inside the factory as the default code used for creating new DAOs:***
220230
```bash
221231
BYTES='cat sputnikdao2/res/sputnikdao2.wasm | base64'
222232
```
223233
```bash
224234
near call sputnikv2.testnet store $(eval "$BYTES") --base64 --accountId sputnikv2.testnet --gas 100000000000000 --amount 10
225235
```
226236

227-
**4. Use the code hash returned from the previous step to store the metadata associated with the code:**
237+
***4. Use the code hash returned from the previous step to store the metadata associated with the code:***
228238
```bash
229239
near call sputnikv2.testnet store_contract_metadata '{"code_hash": "GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS", "metadata": {"version": "v3", "commit_id": "596f27a649c5df3310e945a37a41a957492c0322"}, "set_default": true}' --accountId sputnikv2.testnet
230240
```
231241

232-
**5. See all the contract versions stored inside the factory:**
242+
***5. See all the contract versions stored inside the factory:***
233243
```bash
234244
near view sputnikv2.testnet get_contracts_metadata
235245
```
236246
2 versions should be displayed:
237247
- v2 with commit id `c2cf1553b070d04eed8f659571440b27d398c588` and hash `ZGdM2TFdQpcXrxPxvq25514EViyi9xBSboetDiB3Uiq`
238248
- v3 with commit id `596f27a649c5df3310e945a37a41a957492c0322` and hash `GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS`
239249

240-
**6. Try to create a DAO v3 - using Astro DAO:**
250+
***6. Try to create a DAO v3 - using Astro DAO:***
241251

242252
Go to https://testnet.app.astrodao.com/all/daos and try to create a new DAO from the UI.
243253
The DAO that gets created should be a brand new v3 DAO.
244254

245-
#### 2.2 Mainnet - using official factory account
255+
___
256+
257+
### 2 2 Using official account on mainnet
246258

247259
The process is very similar with 2.1.
248260

249-
---
261+
___
250262

251-
### Migrate DAO from v2 to v3
263+
### 3 Migrate DAO from v2 to v3
252264

253265
Assumptions:
254266
- we are the trying to upgrade `amber.sputnik-dao.near` from v2 to v3
255267
- we have the account id `ctindogaru.near`
256268

257-
1. Open a bash terminal and login to your near account:
269+
***1. Open a bash terminal and login to your near account:***
258270

259271
```bash
260272
export NEAR_ENV=mainnet
@@ -264,7 +276,7 @@ export NEAR_ENV=mainnet
264276
near login
265277
```
266278

267-
2. Clone the sputnik repo and go to the v3 snapshot of the code.
279+
***2. Clone the sputnik repo and go to the v3 snapshot of the code.***
268280

269281
```bash
270282
git clone https://github.com/near-daos/sputnik-dao-contract && cd sputnik-dao-contract
@@ -274,7 +286,7 @@ git clone https://github.com/near-daos/sputnik-dao-contract && cd sputnik-dao-co
274286
git checkout 596f27a649c5df3310e945a37a41a957492c0322
275287
```
276288

277-
3. Store the DAO code in your DAO.
289+
***3. Store the DAO code in your DAO.***
278290

279291
```bash
280292
BYTES='cat sputnikdao2/res/sputnikdao2.wasm | base64'
@@ -286,23 +298,23 @@ near call amber.sputnik-dao.near store_blob $(eval "$BYTES") --base64 --accountI
286298

287299
After running the command from above, you should get the following code hash in return: `GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS`. If your result differs from `GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS`, do not proceed further as you could harm your DAO. Ask for help on the telegram group: `SputnikDAO v2.0`.
288300

289-
4. Create an upgrade proposal for your DAO.
301+
***4. Create an upgrade proposal for your DAO.***
290302

291303
Run the following command:
292304
```bash
293305
near call amber.sputnik-dao.near add_proposal '{"proposal": {"description": "Upgrade DAO to v3 version", "kind": {"UpgradeSelf": {"hash": "GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS"}}}}' --accountId ctindogaru.near --amount 1
294306
```
295307

296-
5. Approve the proposal.
308+
***5. Approve the proposal.***
297309

298310
Everyone from the DAO should go to `https://app.astrodao.com/dao/amber.sputnik-dao.near/proposals` and approve the proposal.
299311

300-
6. Once the proposal get approved, the upgrade will take place.
312+
***6. Once the proposal get approved, the upgrade will take place.***
301313

302-
7. Now that the upgrade is complete, remove the code from your DAO.
314+
***7. Now that the upgrade is complete, remove the code from your DAO.***
303315

304316
```bash
305317
near call amber.sputnik-dao.near remove_blob '{"hash": "GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS"}' --accountId ctindogaru.near --gas 100000000000000 --amount 10
306318
```
307319

308-
7. Congrats! You're now using the DAO v3.
320+
***8. Congrats! You're now using the DAO v3.***

0 commit comments

Comments
 (0)