We have reporoducable builds coming soon. Sorry for this mess.
run ./scripts/build.sh
For frontend only: npm run dev
Or on mainnet: Switch canister_ids.json with your own canisters and run ./scripts/network_build.sh
(Linux)
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
| nvm install --lts
sudo apt install nodejs npm
sudo apt-get update sudo apt-get upgrade nodejs
nvm install --lts
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add wasm32-unknown-unknown
Sudo apt install build-essential
DFX_VERSION=0.22.0 sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
& npx azle install-dfx-extension
Please follow these if you add stuff.
Please use the existing Typescript or Rust patterns in dfx.json.
Always name the folder, and .did file the same canister name, e.g.,
Add it to the following files with the existing patterns: (1) src/alex_frontend/src/contexts/SessionContext.tsx (2) src/alex_frontend/src/features/auth/utils/authUtils.tsx (3) src/alex_frontend/src/providers/SessionProvider.tsx
We use 2 patterns when calling actor functions: Implemented with const { actor } = useSession();
via SessionContext.tsx or createAsyncThunk
... via Redux? When should we use which?
todo before next push: Fix fetchBooks.ts, fetchEngineBooks.ts, and irys.tsx
The registry canister handles all canister ids so they shouldn't be hardcoded anywhere.
Use this pattern:
pub const REGISTRY_CANISTER_ID: &str = "uxyan-oyaaa-aaaap-qhezq-cai";
pub async fn get_canister_id(canister_name: &str) -> Principal {
// Call get_registry_principal from registry canister
ic_cdk::call::<(String,), (Principal,)>(
Principal::from_text(REGISTRY_CANISTER_ID).unwrap(),
"get_registry_principal",
(canister_name.to_string(),),
)
.await
.expect("Failed to get canister ID")
.0
}
get_canister_id("TOKENOMICS").await
This way the only hardcoded canister id is the registry canister id, which will never change.
It's preferable to put this in the lib.rs file so we know what canisters each canister interacts with very easily.
Rationale: This methodology is the most consise, and having all the canister ids in each Lib.rs immediately tells you what canisters it interacts with.
Use the pattern in nsfwjs/nsfwImports.tsx. It was used to dynamically import TensorFlow with much success.
Add a `src/apps/your_app_name/index.tsx, and keep all supporting components in the apps folder. Eventually the good apps may move to different repos/subdomains, so the logic must be standalone. For this reason it's better to have duplicate code, that reusing/relying on parts of the main app which might have to be moved.
Looks like we've actually already figured this out.
Blocks are NFTs, Channels are SBTs.
So we'll have to make the Arweave Uploads more Generic. The app has to handle lots of different rendering methods, so we'll have the uploader preview how it displays in the block before uploading.
It's free to create a channel and you can make money from it, but to add a block to the channel you must pay that block.
Next steps - Let's just worry about making blocks and channels, not the experience yet.
Primatives for Uploader in Main Pager:
Minting NFTs:
Perfect the NFT/DAO canister to get it handling this kind of thing.
Minting SBTs (paying an nft for the right to use it as your own):
Rules of engaagment for experience stuff: