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

Bringing sns-testing up to speed w.r.t. its dependencies #81

Merged
merged 13 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/sns_lifecycle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
SNS_TESTING_INSTANCE=$(
docker run -p 8000:8000 -p 8080:8080 -v "`pwd`":/dapp -d ghcr.io/dfinity/sns-testing dfx start --clean
)
while ! docker logs $SNS_TESTING_INSTANCE 2>&1 | grep -m 1 'Dashboard:'
while ! docker logs $SNS_TESTING_INSTANCE 2>&1 | grep -m 1 'Replica API running'
do
echo "Awaiting local replica ..."
sleep 3
Expand Down
52 changes: 14 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The `sns-testing` solution is based on Docker; however, there are subtle issues
This should print the dashboard URL:

```
Dashboard: http://localhost:8000/_/dashboard
Replica API running on 0.0.0.0:8000
```

5. Open another Bash console:
Expand Down Expand Up @@ -135,7 +135,7 @@ After getting familiar with the basic scenario, you may replace the test caniste
SNS_TESTING_INSTANCE=$(
docker run -p 8000:8000 -p 8080:8080 -v "`pwd`":/dapp -d ghcr.io/dfinity/sns-testing:main dfx start --clean
)
while ! docker logs $SNS_TESTING_INSTANCE 2>&1 | grep -m 1 'Dashboard:'
while ! docker logs $SNS_TESTING_INSTANCE 2>&1 | grep -m 1 'Replica API running'
do
echo "Awaiting local replica ..."
sleep 3
Expand Down
16 changes: 12 additions & 4 deletions deploy_dapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ export ARG="${3:-()}"

. ./constants.sh normal

dfx --provisional-create-canister-effective-canister-id jrlun-jiaaa-aaaab-aaaaa-cai canister create "${NAME}" --network "${NETWORK}" --no-wallet
./bin/dfx \
--provisional-create-canister-effective-canister-id jrlun-jiaaa-aaaab-aaaaa-cai \
canister create "${NAME}" \
--network "${NETWORK}" \
--no-wallet

if [[ -z "${WASM}" ]]
then
export WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}.wasm"
dfx build --network "${NETWORK}" "${NAME}"
WASM=".dfx/${DX_NETWORK}/canisters/${NAME}/${NAME}"
rm -f "${WASM}-s.wasm.gz"
./bin/dfx build --network "${NETWORK}" "${NAME}"
ic-wasm "${WASM}.wasm" -o "${WASM}-s.wasm" shrink
gzip "${WASM}-s.wasm"
export WASM="${WASM}-s.wasm.gz"
fi

dfx canister install "${NAME}" --network "${NETWORK}" --argument "${ARG}" --argument-type idl --wasm "${WASM}"
./bin/dfx canister install "${NAME}" --network "${NETWORK}" --argument "${ARG}" --argument-type idl --wasm "${WASM}"
110 changes: 103 additions & 7 deletions dfx.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,120 @@
{
"canisters": {
"nns-dapp": {
"internet_identity": {
"candid": "candid/internet_identity.did",
"type": "custom",
"wasm": "internet_identity_dev.wasm"
},
"nns-cycles-minting": {
"build": "",
"candid": "candid/nns-cycles-minting.did",
"remote": {
"id": {
"ic": "rkp4c-7iaaa-aaaaa-aaaca-cai",
"local": "rkp4c-7iaaa-aaaaa-aaaca-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-dapp": {
"candid": "candid/nns-dapp.did",
"type": "custom",
"wasm": "nns-dapp.wasm"
},
"internet_identity": {
"nns-genesis-token": {
"build": "",
"candid": "candid/nns-genesis-token.did",
"remote": {
"id": {
"ic": "renrk-eyaaa-aaaaa-aaada-cai",
"local": "renrk-eyaaa-aaaaa-aaada-cai"
}
},
"type": "custom",
"candid": "candid/internet_identity.did",
"wasm": "internet_identity_dev.wasm"
"wasm": ""
},
"sns_aggregator": {
"nns-governance": {
"build": "",
"candid": "candid/nns-governance.did",
"remote": {
"id": {
"ic": "rrkah-fqaaa-aaaaa-aaaaq-cai",
"local": "rrkah-fqaaa-aaaaa-aaaaq-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-ledger": {
"build": "",
"candid": "candid/nns-ledger.did",
"remote": {
"id": {
"ic": "ryjl3-tyaaa-aaaaa-aaaba-cai",
"local": "ryjl3-tyaaa-aaaaa-aaaba-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-lifeline": {
"build": "",
"candid": "candid/nns-lifeline.did",
"remote": {
"id": {
"ic": "rno2w-sqaaa-aaaaa-aaacq-cai",
"local": "rno2w-sqaaa-aaaaa-aaacq-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-registry": {
"build": "",
"candid": "candid/nns-registry.did",
"remote": {
"id": {
"ic": "rwlgt-iiaaa-aaaaa-aaaaa-cai",
"local": "rwlgt-iiaaa-aaaaa-aaaaa-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-root": {
"build": "",
"candid": "candid/nns-root.did",
"remote": {
"id": {
"ic": "r7inp-6aaaa-aaaaa-aaabq-cai",
"local": "r7inp-6aaaa-aaaaa-aaabq-cai"
}
},
"type": "custom",
"wasm": ""
},
"nns-sns-wasm": {
"build": "",
"candid": "candid/nns-sns-wasm.did",
"remote": {
"id": {
"ic": "qaa6y-5yaaa-aaaaa-aaafa-cai",
"local": "qaa6y-5yaaa-aaaaa-aaafa-cai"
}
},
"type": "custom",
"wasm": ""
},
"sns_aggregator": {
"candid": "candid/sns_aggregator.did",
"type": "custom",
"wasm": "sns_aggregator.wasm"
},
"test": {
"candid": "candid/test.did",
"type": "rust",
"package": "test"
"package": "test",
"type": "rust"
}
}
}
2 changes: 1 addition & 1 deletion example_sns_init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Distribution:
# as the treasury. This is initialized in a special sub-account, as the
# main account of Governance is the minting account of the SNS Ledger.
# This field is specified as a token. For instance, "1 token".
governance: 2_000_000 tokens
treasury: 2_000_000 tokens

# The initial SNS token balance of the Swap canister is what will be
# available for the decentralization swap. These tokens will be swapped
Expand Down
4 changes: 2 additions & 2 deletions generate_identities_for_neurons_fund_neurons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ if [ $# -eq 0 ]
then
echo "No arguments supplied. Please pass a neuron csv with the following format:"
echo ""
echo "neuron_id;owner_id;created_ts_ns;duration_to_dissolution_ns;staked_icpt;earnings;follows;not_for_profit;memo;maturity_e8s_equivalent;kyc_verified"
echo "1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;C;;false;0;0;false"
echo "neuron_id;owner_id;created_ts_ns;dissolve_delay_s;staked_icpt;follows;not_for_profit;maturity_e8s_equivalent"
echo "1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;;false;0"
echo "etc."
exit 1
else
Expand Down
36 changes: 18 additions & 18 deletions initial_neurons.csv
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
neuron_id;owner_id;created_ts_ns;duration_to_dissolution_ns;staked_icpt;earnings;follows;not_for_profit;memo;maturity_e8s_equivalent;kyc_verified
1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;C;;false;0;0;false
2;mccsf-b32dl-n42k3-57eqk-6fnii-ojxhg-ukyw7-cstu4-4u3eq-s64id-pqe;0;15780000000000000;0;C;;false;0;100000000;false
3;apudj-s5mmx-ddrec-sawcm-gsc5c-52sdk-4fs3k-ftmay-omsbn-t27lg-zae;0;15780000000000000;0;C;;false;0;500000000;false
4;so5fh-cx7bf-jhqti-t77pu-uxt2p-x7mb5-ybpkg-sp32z-m7lfw-4n7gy-cae;0;15780000000000000;0;C;;false;0;1000000000;false
5;fy5ch-dwxhf-gffsr-z7eum-7iqom-t727t-roth5-zxp7t-6n5di-mtkzo-7qe;0;15780000000000000;0;C;;false;0;10000000000;false
6;se4ei-zaxs6-lnq3z-oo6bp-ci2ed-isads-fe2by-pnjrj-i5fsp-sorcl-uqe;0;15780000000000000;0;C;;false;0;100000000000;false
7;e6xcz-i3oe4-3gp2e-w2g6u-vtdey-sb6dw-vzh5m-2qb4l-dc6ff-to6ll-5qe;0;15780000000000000;0;C;;false;0;1000000000000;false
8;72sl6-z6gmp-tuvar-hngo2-7gjov-jn43j-omkrv-2wx6k-fzcgj-sujmh-zae;0;15780000000000000;0;C;;false;0;10000000000000;false
9;2z6y4-6y7zq-vporp-tiumu-j3qhw-6og2g-sxvxh-e57qp-aevbm-gacrr-yae;0;15780000000000000;0;C;;false;0;100000000000000;false
10;3uigu-x6rsf-lwlyz-fauii-ewr7t-7vcmr-cfbcs-pye3t-oyh3o-5v23u-iae;0;15780000000000000;0;C;;false;0;100000000000000;false
449479075714955186;b2ucp-4x6ou-zvxwi-niymn-pvllt-rdxqr-wi4zj-jat5l-ijt2s-vv4f5-4ae;0;31536000000000000;100;D;;false;0;10000000000;false
3001;py6h5-6xdbk-bpdsi-7vcmw-f3yss-vaa7w-id2rh-knbzp-4hdmp-gxhxn-jae;0;15780000000000000;0;C;;false;0;9000000000;false
3002;6s5du-wqkks-6ljxw-wucs5-yharn-fqcxm-3evkn-ffa3f-iheap-7drpi-uae;0;15780000000000000;0;C;;false;0;90000000000;false
3003;l3mxb-xrmim-b4pej-jpoko-j2ise-baark-y53yo-c647u-rg6uf-2nxpr-pqe;0;15780000000000000;0;C;;false;0;900000000000;false
3004;2rifv-b6jdw-zde6b-3vxyz-xfulb-77gft-fngo4-5j74e-6vfbn-zwlnk-3ae;0;15780000000000000;0;C;;false;0;9000000000000;false
3005;wrrod-le7l3-tv5ya-3qtyl-2t7ik-dqjoi-mrr6y-nw7gx-bxiy6-ilo54-nqe;0;15780000000000000;0;C;;false;0;90000000000000;false
3006;7tkm4-zxi5p-gyfc5-zwtss-hrc6x-uf25u-4qngv-pb3fo-evr5u-wfejc-sae;0;15780000000000000;0;C;;false;0;900000000000000;false
neuron_id;owner_id;created_ts_ns;dissolve_delay_s;staked_icpt;follows;not_for_profit;maturity_e8s_equivalent
1;xz7xb-e726u-vsihc-fukxg-pfzzd-3cjix-gluc6-p4shw-sz4aw-ufgi3-yqe;0;15780000000000000;0;;false;0
2;mccsf-b32dl-n42k3-57eqk-6fnii-ojxhg-ukyw7-cstu4-4u3eq-s64id-pqe;0;15780000000000000;0;;false;100000000
3;apudj-s5mmx-ddrec-sawcm-gsc5c-52sdk-4fs3k-ftmay-omsbn-t27lg-zae;0;15780000000000000;0;;false;500000000
4;so5fh-cx7bf-jhqti-t77pu-uxt2p-x7mb5-ybpkg-sp32z-m7lfw-4n7gy-cae;0;15780000000000000;0;;false;1000000000
5;fy5ch-dwxhf-gffsr-z7eum-7iqom-t727t-roth5-zxp7t-6n5di-mtkzo-7qe;0;15780000000000000;0;;false;10000000000
6;se4ei-zaxs6-lnq3z-oo6bp-ci2ed-isads-fe2by-pnjrj-i5fsp-sorcl-uqe;0;15780000000000000;0;;false;100000000000
7;e6xcz-i3oe4-3gp2e-w2g6u-vtdey-sb6dw-vzh5m-2qb4l-dc6ff-to6ll-5qe;0;15780000000000000;0;;false;1000000000000
8;72sl6-z6gmp-tuvar-hngo2-7gjov-jn43j-omkrv-2wx6k-fzcgj-sujmh-zae;0;15780000000000000;0;;false;10000000000000
9;2z6y4-6y7zq-vporp-tiumu-j3qhw-6og2g-sxvxh-e57qp-aevbm-gacrr-yae;0;15780000000000000;0;;false;100000000000000
10;3uigu-x6rsf-lwlyz-fauii-ewr7t-7vcmr-cfbcs-pye3t-oyh3o-5v23u-iae;0;15780000000000000;0;;false;100000000000000
449479075714955186;b2ucp-4x6ou-zvxwi-niymn-pvllt-rdxqr-wi4zj-jat5l-ijt2s-vv4f5-4ae;0;31536000000000000;100;;false;10000000000
3001;hol7n-gtwzb-buu75-q3zrr-pqze3-pba4m-d2wss-lr5fo-nm4x6-m3ffv-bae;0;15780000000000000;0;;false;9000000000
3002;y7e3b-a3irj-4i5ra-gljbg-7y3e6-w4icm-fydkk-e6hxw-h5usa-x2vfl-xqe;0;15780000000000000;0;;false;90000000000
3003;uomfj-wba5i-ci5gj-yhuna-li2lb-qb3z6-6lzwr-6erii-6iu7c-kdzgy-bae;0;15780000000000000;0;;false;900000000000
3004;wl2t7-m6zav-y7lh2-q3xnm-6itvx-dgspm-gg47g-nwqrx-th7t2-fjlk5-oae;0;15780000000000000;0;;false;9000000000000
3005;yie43-s6m5a-sntag-e23dy-7tf46-h7q7z-5im7c-5o6up-myjis-ruyjt-jae;0;15780000000000000;0;;false;90000000000000
3006;vnkc3-jzx5m-a4kry-wrrim-3yonj-nimst-weddy-k3gha-ysu3a-3y4ms-dqe;0;15780000000000000;0;;false;900000000000000
Loading
Loading