Skip to content

Commit 49c0b14

Browse files
committed
more identation
1 parent e74e226 commit 49c0b14

File tree

1 file changed

+59
-51
lines changed

1 file changed

+59
-51
lines changed

release_process.md

Lines changed: 59 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
53-
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)
56+
### v3 Release Plan
5757

58-
---
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)
5961

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

67-
#### Using personal account on testnet
69+
___
6870

69-
**1. Create a new NEAR account for the factory:**
71+
### 1 1 Using personal account on testnet
72+
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+
___
147+
148+
### 1 2 Using official account on testnet
143149

144-
**1. Upgrade the factory code:**
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,101 @@ 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+
### 2 1 Using official account on testnet
208216

209-
**1. Checkout to the right commit id**
217+
***1. Checkout to the right commit id***
210218
```bash
211219
git checkout 596f27a649c5df3310e945a37a41a957492c0322
212220
```
213221

214-
**2. Build the DAO v3 code:**
222+
***2. Build the DAO v3 code:***
215223
```bash
216224
./build.sh
217225
```
218226

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:**
227+
***3. Use the code built at the previous step and store it inside the factory as the default code used for creating new DAOs:***
220228
```bash
221229
BYTES='cat sputnikdao2/res/sputnikdao2.wasm | base64'
222230
```
223231
```bash
224232
near call sputnikv2.testnet store $(eval "$BYTES") --base64 --accountId sputnikv2.testnet --gas 100000000000000 --amount 10
225233
```
226234

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

232-
**5. See all the contract versions stored inside the factory:**
240+
***5. See all the contract versions stored inside the factory:***
233241
```bash
234242
near view sputnikv2.testnet get_contracts_metadata
235243
```
236244
2 versions should be displayed:
237245
- v2 with commit id `c2cf1553b070d04eed8f659571440b27d398c588` and hash `ZGdM2TFdQpcXrxPxvq25514EViyi9xBSboetDiB3Uiq`
238246
- v3 with commit id `596f27a649c5df3310e945a37a41a957492c0322` and hash `GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS`
239247

240-
**6. Try to create a DAO v3 - using Astro DAO:**
248+
***6. Try to create a DAO v3 - using Astro DAO:***
241249

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

245-
#### 2.2 Mainnet - using official factory account
253+
### 2 2 Using official account on mainnet
246254

247255
The process is very similar with 2.1.
248256

249-
---
257+
___
250258

251-
### Migrate DAO from v2 to v3
259+
### 3 Migrate DAO from v2 to v3
252260

253261
Assumptions:
254262
- we are the trying to upgrade `amber.sputnik-dao.near` from v2 to v3
255263
- we have the account id `ctindogaru.near`
256264

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

259267
```bash
260268
export NEAR_ENV=mainnet
@@ -264,7 +272,7 @@ export NEAR_ENV=mainnet
264272
near login
265273
```
266274

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

269277
```bash
270278
git clone https://github.com/near-daos/sputnik-dao-contract && cd sputnik-dao-contract
@@ -274,7 +282,7 @@ git clone https://github.com/near-daos/sputnik-dao-contract && cd sputnik-dao-co
274282
git checkout 596f27a649c5df3310e945a37a41a957492c0322
275283
```
276284

277-
3. Store the DAO code in your DAO.
285+
***3. Store the DAO code in your DAO.***
278286

279287
```bash
280288
BYTES='cat sputnikdao2/res/sputnikdao2.wasm | base64'
@@ -286,23 +294,23 @@ near call amber.sputnik-dao.near store_blob $(eval "$BYTES") --base64 --accountI
286294

287295
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`.
288296

289-
4. Create an upgrade proposal for your DAO.
297+
***4. Create an upgrade proposal for your DAO.***
290298

291299
Run the following command:
292300
```bash
293301
near call amber.sputnik-dao.near add_proposal '{"proposal": {"description": "Upgrade DAO to v3 version", "kind": {"UpgradeSelf": {"hash": "GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS"}}}}' --accountId ctindogaru.near --amount 1
294302
```
295303

296-
5. Approve the proposal.
304+
***5. Approve the proposal.***
297305

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

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

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

304312
```bash
305313
near call amber.sputnik-dao.near remove_blob '{"hash": "GUMFKZP6kdLgy3NjKy1EAkn77AfZFLKkj96VAgjmHXeS"}' --accountId ctindogaru.near --gas 100000000000000 --amount 10
306314
```
307315

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

0 commit comments

Comments
 (0)