Skip to content

Commit b763d1a

Browse files
committed
Add new docs with info
1 parent b020b4c commit b763d1a

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

CanisterCommands.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
dfx canister call newwave create_entity "(record { _internalId = null; _creator = null; _entityType = variant {Webasset}; })"
2+
dfx canister call newwave get_entity '("D6C65674-91BE-170D-BCC0-000000000000")'
3+
dfx canister call newwave create_bridge '(record { _internalId = null; _creator = null; _entityType = variant {Webasset}; _bridgeType = variant {OwnerCreated}; _fromEntityId = "20621F98-91B0-170D-B0F5-000000000000"; _toEntityId = "D6C65674-91BE-170D-BCC0-000000000000"; })'
4+
dfx canister call newwave get_bridge '("76CBDF90-9246-170D-9C79-000000000000")'
5+
dfx canister call newwave get_bridge_ids_by_entity_id '("D6C65674-91BE-170D-BCC0-000000000000", true, true, true)'
6+
dfx canister call newwave get_bridges_by_entity_id '("D6C65674-91BE-170D-BCC0-000000000000", true, true, true)'
7+
dfx canister call newwave create_entity_and_bridge '(record { _internalId = null; _creator = null; _entityType = variant {Webasset}; }, record { _internalId = null; _creator = null; _entityType = variant {Webasset}; _bridgeType = variant {OwnerCreated}; _fromEntityId = "20621F98-91B0-170D-B0F5-000000000000"; _toEntityId = "D6C65674-91BE-170D-BCC0-000000000000"; })'
8+
dfx canister call newwave get_bridged_entities_by_entity_id '("D6C65674-91BE-170D-BCC0-000000000000", true, true, true)'
9+
dfx canister call newwave get_entity_and_bridge_ids '("D6C65674-91BE-170D-BCC0-000000000000", true, true, true)'
10+
11+
Call from CLI (IC):
12+
first deploy to IC mainnet: dfx deploy --network ic
13+
dfx canister --network ic call newwave create_entity "(record { _internalId = null; _creator = null; _entityType = variant {Webasset}; })"
14+
dfx canister --network ic call newwave get_entity '("C923CD99-92E1-170D-908C-000000000000")'
15+
## Call from CLI (local):
16+
17+
dfx canister --network ic call newwave create_bridge '(record { _internalId = null; _creator = null; _entityType = variant {Webasset}; _bridgeType = variant {OwnerCreated}; _fromEntityId = "01A90437-92F8-170D-9F6C-000000000000"; _toEntityId = "C923CD99-92E1-170D-908C-000000000000"; })'
18+
dfx canister --network ic call newwave get_bridge '("E64582AA-9302-170D-A43D-000000000000")'
19+
dfx canister --network ic call newwave get_bridge_ids_by_entity_id '("C923CD99-92E1-170D-908C-000000000000", true, true, true)'
20+
dfx canister --network ic call newwave get_bridges_by_entity_id '("C923CD99-92E1-170D-908C-000000000000", true, true, true)'
21+
dfx canister --network ic call newwave create_entity_and_bridge '(record { _internalId = null; _creator = null; _entityType = variant {Person}; }, record { _internalId = null; _creator = null; _entityType = variant {Webasset}; _bridgeType = variant {OwnerCreated}; _fromEntityId = "C923CD99-92E1-170D-908C-000000000000"; _toEntityId = ""; })'
22+
dfx canister --network ic call newwave get_bridged_entities_by_entity_id '("C923CD99-92E1-170D-908C-000000000000", true, true, true)'
23+
dfx canister --network ic call newwave get_entity_and_bridge_ids '("C923CD99-92E1-170D-908C-000000000000", true, true, true)'
24+
25+
Top up cycles:
26+
dfx identity --network=ic get-wallet
27+
dfx wallet --network ic balance
28+
dfx canister --network ic status newwave
29+
dfx canister --network ic --wallet 3v5vy-2aaaa-aaaai-aapla-cai deposit-cycles 3000000000000 newwave
30+
31+
2022-11-15: topped up 3.3T cycles, has balance of 7.2T (2023-02-20: basically hasn't changed, 2023-07-05: 7.186)
32+
33+
Fund wallet with cycles (from ICP): https://medium.com/dfinity/internet-computer-basics-part-3-funding-a-cycles-wallet-a724efebd111

DevNotes.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Dev notes
2+
dynamically expand storage canisters: https://github.com/dfinity/examples/tree/master/motoko/classes
3+
work with subaccounts: https://github.com/krpeacock/invoice-canister
4+
5+
using Entity type cuts other fields from entities -> flexible input and output format needed
6+
with Text? like stringifying object and parsing Text to object of entity type
7+
https://forum.dfinity.org/t/how-do-i-send-a-blob-from-js-frontend-to-motoko-backend/9148/2
8+
https://itnext.io/typescript-utilities-for-candid-bf5bdd92a9a3
9+
https://github.com/dfinity/motoko-base/blob/master/src/Blob.mo
10+
with HashMap? instead of object type use HashMap input and convert key-value pairs to entity type
11+
https://github.com/dfinity/motoko-base/blob/master/src/HashMap.mo
12+
having HashMap<Text,Text> as a field on Entity gives error: is or contains non-shared type Text -> ()
13+
function on Entity to retrieve entityType specific fields (or a static field)
14+
work with JSON: https://github.com/Toniq-Labs/creator-nfts/blob/main/canisters/nft/main.mo
15+
UI sends in JSON encoded as Blob: https://github.com/Toniq-Labs/creator-nfts/blob/main/frontend/src/canisters/nft/minting.ts
16+
potentially String / Text also works (i.e. no en-/decoding) --> work with Text for now, probably change to Blob later (after finding out about its potential benefits)

0 commit comments

Comments
 (0)