- start local dfx
dfx start --clean
- Run NPM server
npm start
- Deploy canisters
dfx deploy --argument='("CryptoDunks #123", principal "d66ef-652qc-p4sw2-nevk4-hkj3w-hgihb-cliym-lzdjb-cl7ux-7tq6r-eqe", (vec {137; 80; 78; 71; 13; 10; 26; 10; 0; 0; 0; 13; 73; 72; 68; 82; 0; 0; 0; 10; 0; 0; 0; 10; 8; 6; 0; 0; 0; 141; 50; 207; 189; 0; 0; 0; 1; 115; 82; 71; 66; 0; 174; 206; 28; 233; 0; 0; 0; 68; 101; 88; 73; 102; 77; 77; 0; 42; 0; 0; 0; 8; 0; 1; 135; 105; 0; 4; 0; 0; 0; 1; 0; 0; 0; 26; 0; 0; 0; 0; 0; 3; 160; 1; 0; 3; 0; 0; 0; 1; 0; 1; 0; 0; 160; 2; 0; 4; 0; 0; 0; 1; 0; 0; 0; 10; 160; 3; 0; 4; 0; 0; 0; 1; 0; 0; 0; 10; 0; 0; 0; 0; 59; 120; 184; 245; 0; 0; 0; 113; 73; 68; 65; 84; 24; 25; 133; 143; 203; 13; 128; 48; 12; 67; 147; 94; 97; 30; 24; 0; 198; 134; 1; 96; 30; 56; 151; 56; 212; 85; 68; 17; 88; 106; 243; 241; 235; 39; 42; 183; 114; 137; 12; 106; 73; 236; 105; 98; 227; 152; 6; 193; 42; 114; 40; 214; 126; 50; 52; 8; 74; 183; 108; 158; 159; 243; 40; 253; 186; 75; 122; 131; 64; 0; 160; 192; 168; 109; 241; 47; 244; 154; 152; 112; 237; 159; 252; 105; 64; 95; 48; 61; 12; 3; 61; 167; 244; 38; 33; 43; 148; 96; 3; 71; 8; 102; 4; 43; 140; 164; 168; 250; 23; 219; 242; 38; 84; 91; 18; 112; 63; 0; 0; 0; 0; 73; 69; 78; 68; 174; 66; 96; 130;}))'
- Head to localhost
<div className="minter-container">
<h3 className="Typography-root makeStyles-title-99 Typography-h3 form-Typography-gutterBottom">
Minted!
</h3>
<div className="horizontal-center">
</div>
</div>
<div className="lds-ellipsis">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div className="Chip-root makeStyles-chipBlue-108 Chip-clickable">
<span
onClick={}
className="form-Chip-label"
>
Sell
</span>
</div>
<input
placeholder="Price in CATECOINs"
type="number"
className="price-input"
value={}
onChange={}
/>
<div className="disButtonBase-root disChip-root makeStyles-price-23 disChip-outlined">
<span className="disChip-label">23 CATECOINs</span>
</div>
- Mint an NFT on the command line to get NFT into mapOfNFTs:
dfx canister call opend mint '(vec {137; 80; 78; 71; 13; 10; 26; 10; 0; 0; 0; 13; 73; 72; 68; 82; 0; 0; 0; 10; 0; 0; 0; 10; 8; 6; 0; 0; 0; 141; 50; 207; 189; 0; 0; 0; 1; 115; 82; 71; 66; 0; 174; 206; 28; 233; 0; 0; 0; 68; 101; 88; 73; 102; 77; 77; 0; 42; 0; 0; 0; 8; 0; 1; 135; 105; 0; 4; 0; 0; 0; 1; 0; 0; 0; 26; 0; 0; 0; 0; 0; 3; 160; 1; 0; 3; 0; 0; 0; 1; 0; 1; 0; 0; 160; 2; 0; 4; 0; 0; 0; 1; 0; 0; 0; 10; 160; 3; 0; 4; 0; 0; 0; 1; 0; 0; 0; 10; 0; 0; 0; 0; 59; 120; 184; 245; 0; 0; 0; 113; 73; 68; 65; 84; 24; 25; 133; 143; 203; 13; 128; 48; 12; 67; 147; 94; 97; 30; 24; 0; 198; 134; 1; 96; 30; 56; 151; 56; 212; 85; 68; 17; 88; 106; 243; 241; 235; 39; 42; 183; 114; 137; 12; 106; 73; 236; 105; 98; 227; 152; 6; 193; 42; 114; 40; 214; 126; 50; 52; 8; 74; 183; 108; 158; 159; 243; 40; 253; 186; 75; 122; 131; 64; 0; 160; 192; 168; 109; 241; 47; 244; 154; 152; 112; 237; 159; 252; 105; 64; 95; 48; 61; 12; 3; 61; 167; 244; 38; 33; 43; 148; 96; 3; 71; 8; 102; 4; 43; 140; 164; 168; 250; 23; 219; 242; 38; 84; 91; 18; 112; 63; 0; 0; 0; 0; 73; 69; 78; 68; 174; 66; 96; 130;}, "CryptoDunks #123")'
- List the item into mapOfListings:
dfx canister call opend listItem '(principal "<REPLACE WITH NFT CANISTER ID>", 2)'
eg: dfx canister call opend listItem '(principal "qaa6y-5yaaa-aaaaa-aaafa-cai", 2)'
- Get OpenD canister ID:
dfx canister id opend
- Transfer NFT to OpenD:
dfx canister call <REPLACE WITH NFT CANISTER ID> transferOwnership '(principal "<REPLACE WITH OPEND CANISTER ID>", true)'
eg: dfx canister call qaa6y-5yaaa-aaaaa-aaafa-cai transferOwnership '(principal "ryjl3-tyaaa-aaaaa-aaaba-cai", true)'
-
Copy over the token declarations folder
-
Set the token canister id into the
const catePrincipal = Principal.fromText("<REPLACE WITH TOKEN CANISTER ID>");
(NOTE: Place or Copy the file to IC-PROJECT(your project folder) folder before running below steps)
-
-> In dfx.json file we can see the "dfx": "0.9.3" .
-
-> Now we have to downgrade our dfx version to 0.9.3 (this takes some time ~15mins) , Now to downgrade use the command
DFX_VERSION=0.9.3 sh -ci "$(curl -fsSL https://smartcontracts.org/install.sh)"
-
->After downgrading the dfx version, Now type
$ dfx start --emulator
-
-> Now split the terminal and type
$ npm install --legacy-peer-deps
(NOTE: Ignore the deprecated warning)
-
-> Now deploy
$ dfx deploy
-
-> Now after this type
$ npm start
(NOTE: Don't worry of downgrading the dfx version we can upgrade it back to latest version when needed)
(--->
ADDITIONAL SOLUTION FOR ERROR IN dfx deploy
Error: The replica returned an HTTP Error: Http Error: status 400 Bad Request for your canister
Solution: Just type
$ dfx start --clean
<----)