@helium/helium-admin-cli 0.0.50 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,91 +1,37 @@
1
- First, brick the genesis transactions. This keeps someone from front-running the genesis transaction lazy signer.
1
+ # Migration
2
2
 
3
- Now, setup HST **using the migration service wallet**:
3
+ ## A few days before migration
4
4
 
5
- ```
6
- helium-admin setup-hst -u https://api.devnet.solana.com --multisig BBhoCZSUJH8iiXHT5aP6GVbhnX2iY2vWR1BAsuYm7ZUm --hnt $(solana address -k keypairs/hnt.json) --name "HST"
7
- ```
8
-
9
- Next, make sure startUnixTime in the emissions schedules is equal to the current time.
10
-
11
-
12
- Setup the price oracles:
13
-
14
- ```
15
- helium-admin create-price-oracle -u https://api.devnet.solana.com --multisig BBhoCZSUJH8iiXHT5aP6GVbhnX2iY2vWR1BAsuYm7ZUm --priceOracleKeypair keypairs/hnt-price-oracle.json --oracles price-oracle-authorities.json --decimals 8
16
-
17
- helium-admin create-price-oracle -u https://api.devnet.solana.com --multisig BBhoCZSUJH8iiXHT5aP6GVbhnX2iY2vWR1BAsuYm7ZUm --priceOracleKeypair keypairs/mobile-price-oracle.json --oracles price-oracle-authorities.json --decimals 6
18
-
19
- helium-admin create-price-oracle -u https://api.devnet.solana.com --multisig BBhoCZSUJH8iiXHT5aP6GVbhnX2iY2vWR1BAsuYm7ZUm --priceOracleKeypair keypairs/iot-price-oracle.json --oracles price-oracle-authorities.json --decimals 6
20
- ```
21
-
22
- ```
23
- helium-admin create-dao -u https://api.devnet.solana.com --numHnt 200136852 --numHst 200000000 --numDc 2000000000000 --realmName "Helium" --emissionSchedulePath emissions/hnt.json --hstEmissionSchedulePath emissions/hst.json
24
-
25
- helium-admin create-subdao -u https://api.devnet.solana.com --rewardsOracleUrl https://iot-oracle.oracle.helium.io --activeDeviceOracleUrl https://iot-rewards.oracle.helium.io/active-devices -n IOT --subdaoKeypair keypairs/iot.json --numTokens 100302580998 --emissionSchedulePath emissions/iot.json --realmName "Helium IOT" --dcBurnAuthority $(solana address) --executeProposal --switchboardNetwork devnet
26
-
27
- helium-admin create-subdao -u https://api.devnet.solana.com --rewardsOracleUrl https://mobile-oracle.oracle.helium.io --activeDeviceOracleUrl https://mobile-rewards.oracle.helium.io/active-devices -n Mobile --subdaoKeypair keypairs/mobile.json --numTokens 100302580998 --emissionSchedulePath emissions/iot.json --realmName "Helium Mobile" --dcBurnAuthority $(solana address) --executeProposal --switchboardNetwork devnet
28
- ```
29
- Now, go approve and run all commands in realms.
30
-
31
- Now create iot makers:
32
-
33
- ```
34
-
35
- helium-admin create-maker -u https://api.devnet.solana.com --symbol IOT --subdaoMint $(solana address -k keypairs/iot.json) --fromFile makers.json --executeProposal
5
+ First, build the migration docker container.
36
6
 
37
7
  ```
38
-
39
- Next, create mobile makers:
40
-
41
- ```
42
- helium-admin create-maker -u https://api.devnet.solana.com --symbol MOBILE --subdaoMint $(solana address -k keypairs/mobile.json) --fromFile makers-mobile.json --executeProposal
8
+ docker build -f migration-docker/Dockerfile . -t migration:latest
43
9
  ```
44
10
 
45
- Now, fund any maker wallets
11
+ Then, tar all keypairs:
46
12
 
47
13
  ```
48
- helium-admin mint-dc -u https://api.devnet.solana.com --destination maker_address --numHnt 10000 --dcKey $(solana address -k keypairs/dc.json)
49
-
50
- # If needed, fund the maker wallet
51
- solana transfer -u devnet maker_address 1 --allow-unfunded-recipient
14
+ tar -cf keypairs.tar.gz keypairs
15
+ mv keypairs.tar.gz migration-docker/data/
52
16
  ```
53
17
 
54
- Now, go approve and run maker create in realms
55
-
56
- Now,migrate to a `-n` that nobody knows you're using. This will ensure nobody can frontrun
18
+ Then, use that container to encrypt all `keypairs` and generate a gpg key. This key will be output to ./migration-docker/data/migration.gpg
57
19
 
58
20
  ```
59
- cd ../migration-service
60
-
61
- node --max_old_space_size=16000 lib/cjs/gen-transactions.js --mobile $(solana address -k ../helium-admin-cli/keypairs/mobile.json) --hnt $(solana address -k ../helium-admin-cli/keypairs/hnt.json) --dc $(solana address -k ../helium-admin-cli/keypairs/dc.json) --iot $(solana address -k ../helium-admin-cli/keypairs/iot.json) --hst $(solana address -k ../helium-admin-cli/keypairs/hst.json) -n devnethelium -u http://127.0.0.1:8899 --payer $(solana address) --pgPort 5432 --pgDatabase migration --makers ../helium-admin-cli/makers.json -p
21
+ ./migration-docker/run-encrypt-keypairs.sh <PASSWORD>
62
22
  ```
63
23
 
64
- At this point, go and update all lazy signers with the value from -n (ie devnethelium), and unbrick the genesis endpoints.
24
+ Upload the encrypted keypairs to s3. Have migration.gpg as a sealed secret on the migration container. As well as the password.
65
25
 
66
- Must also then go update all state in the cluster
26
+ Push the container, and make a pull request on k8s for the deploy.
67
27
 
68
- Now, dump the local migration db and port it to the prod db:
28
+ ## Migration Day
69
29
 
70
- ```
71
- ssh -i ~/bastion -L localhost:5433:oracle-rds.cf49lv1xslmw.us-east-1.rds.amazonaws.com:5432 ubuntu@52.5.106.80
72
- ```
30
+ Upload the export.json, makers.json, and makers-mobile.json files to the s3 bucket. Merge the k8s PR. Watch the export go
73
31
 
74
- ```
75
- docker run -e PGPASSWORD=postgres postgres:latest pg_dump -h host.docker.internal -U postgres migration > ~/devnet-dump.sql
76
- ```
77
-
78
- ```
79
- psql -U web_admin -p 5433 -h localhost -d migration -f ~/devnet-dump.sql -W
80
- ```
81
-
82
- You must also populate the iot and mobile metadata databases. Switch the port forward to the oracle db. Then:
32
+ You must also populate the iot and mobile metadata databases. Port forward oracle db. Then:
83
33
 
84
34
  ```
85
35
  $: cd ../hotspot-data-sink
86
36
  $: env ANCHOR_WALLET=/path/to/.config/solana/id.json yarn run seed-db -f ../migration-service/export.json
87
37
  ```
88
-
89
-
90
- Make sure to mint an epoch of IOT/MOBILE and put in rewards pool
91
-