### Install Project Dependencies Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/using-ID-in-dApps/wallet-connectors-tutorial.rst Navigate to the frontend directory, install project dependencies using yarn, and start the development server. ```console cd frontend yarn install yarn dev ``` -------------------------------- ### Install Web SDK Dependencies Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/plt/web-sdk.rst Install the necessary @concordium/web-sdk and @grpc/grpc-js packages for using the Web SDK. This is a prerequisite for running the provided examples. ```bash npm install @concordium/web-sdk@11.0.0 npm install @grpc/grpc-js ``` -------------------------------- ### Navigate to wCCD Examples Directory Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/wCCD/wCCD-frontend-set-up.rst Change the current directory to the wCCD examples folder. ```console $ cd ./examples/wCCD/ ``` -------------------------------- ### Start Server Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/verify-account-ownership-signature-proofs/signature-proofs.rst Starts the Node.js server on port 3001. This is a basic setup for the backend. ```jsx app.listen(3001, () => { console.log('Server running on port 3001'); }); ``` -------------------------------- ### Start the Web Frontend Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/voting/voting-dapp.rst Start the web frontend by running 'yarn start' in a separate terminal. This command launches the local dApp server. ```console $yarn start ``` -------------------------------- ### Start the Minting dApp Source: https://github.com/concordium/concordium.github.io/blob/main/source/academy/tutorials/nft-minting-w-id/how-it-works.rst Start the dApp from the mint-ui directory using the yarn start command. This dApp will interact with the verifier backend to mint an NFT. ```console yarn start ``` -------------------------------- ### Navigate to Voting Example Directory Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/voting/voting-dapp.rst Change the current directory to the voting example folder within the cloned repository. ```console $cd ./examples/voting/ ``` -------------------------------- ### Install Marketplace UI Dependencies Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/low-code-nft-marketplace/marketplace.rst Navigate to the marketplace UI directory and install its dependencies using Yarn. ```console cd Low-Code-NFT-Framework/market-ui && yarn install ``` -------------------------------- ### Clone Sponsored Transaction Example Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/sponsoredTransactions/sponsoredTransactionsSmartContract.rst Clone the sponsored transaction example repository, including submodules, to begin the tutorial. ```console $ git clone --recurse-submodules git@github.com:Concordium/concordium-rust-smart-contracts.git ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/voting/voting-dapp.rst Install all project dependencies using yarn. This command should be run in the root folder of the cloned repository. ```console $yarn ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/sponsoredTransactions/sponsoredTransactionsSmartContract.rst Navigate to the specific example folder within the cloned repository for the CIS-3 NFT sponsored transactions. ```console $ cd ./examples/cis3-nft-sponsored-txs ``` -------------------------------- ### Analyze Contract Trace Elements Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/smart-contracts/integration-test-contract.rst Retrieve and analyze trace elements from a contract update. This example shows how to get elements grouped by contract address and asserts specific contract update events. ```rust let chain = Chain::new(); // .. Creation of accounts and contracts omitted for brevity. let update = chain.contract_update(..).unwrap(); let elements_per_contract = update.trace_elements(); // No events occured for contract <123, 0>. assert_eq!(elements_per_contract.get(&ContractAddress(123,0))), None); // Check that the contract was updated. assert_eq!(elements_per_contract[&initialization.contract_address], [ ContractTraceElement::Updated { data: InstanceUpdatedEvent { address: contract_address, amount: Amount::zero(), receive_name: OwnedReceiveName::new_unchecked("my_contract.my_entrypoint".to_string()), contract_version: concordium_base::smart_contracts::WasmVersion::V1, instigator: Address::Account(account_address), message: OwnedParameter::empty(), events: Vec::new(), }, } ]) ``` -------------------------------- ### Navigate to Contract Version 2 Example Folder Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/smartContractUpgrade/smartContractUpgrade.rst Change the current directory to the smart contract upgrade example folder for version 2. ```console $cd ./examples/smart-contract-upgrade/contract-version2 ``` -------------------------------- ### Initialize Contract Instance with Example Module Reference Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/smartContractUpgrade/smartContractUpgrade.rst An example of initializing a contract instance using a specific module reference obtained from a previous deployment. ```bash $concordium-client contract init 8fc09d2519f516cfbb3d139b1e567753780fbb52854ecbf9a12c447756d18eb0 --contract smart_contract_upgrade --energy 30000 --sender --grpc-port 20000 --grpc-ip grpc.testnet.concordium.com --secure ``` -------------------------------- ### Mint New Tokens Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/plt/web-sdk.rst This example demonstrates how to mint new tokens. Only the token issuer can perform mint operations. This snippet includes necessary imports and client setup for the Concordium gRPC node. ```typescript /** * Mints new tokens to the issuer's account. * Only the nominated account (token issuer) can perform mint operations. * Shows how to mint tokens. * full code example using cli: https://github.com/Concordium/concordium-node-sdk-js/blob/main/examples/nodejs/plt/update-supply.ts */ import { AccountAddress, parseWallet, buildAccountSigner, TransactionSummaryType, TransactionKindString, RejectReasonTag, isKnown, serializeAccountTransactionPayload, AccountTransactionType, } from '@concordium/web-sdk'; import { TokenId, TokenAmount, Cbor, Token, TokenSupplyUpdate, TokenOperation, createTokenUpdatePayload } from '@concordium/web-sdk/plt'; import { ConcordiumGRPCNodeClient } from '@concordium/web-sdk/nodejs'; import { credentials } from '@grpc/grpc-js'; import { existsSync, readFileSync } from 'node:fs'; const client = new ConcordiumGRPCNodeClient( "grpc.testnet.concordium.com", Number(20000), credentials.createSsl() ); /** * The following example demonstrates how to mint new tokens. */ // using wallet.export file const walletFilePath = "keys/wallet.export"; ``` -------------------------------- ### Build Documentation Source: https://github.com/concordium/concordium.github.io/blob/main/README.md Execute the build script from the project root to generate the documentation. ```bash pipenv run ./script/build.sh ``` -------------------------------- ### Clone and Run Piggy Bank dApp Locally Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/piggy-bank/frontend.rst Use these console commands to clone the Piggy Bank dApp repository, install its dependencies with yarn, and start the local development server. This will launch the dApp in your default browser. ```console $ git clone https://github.com/Concordium/concordium-dapp-piggybank.git $ cd concordium-dapp-piggybank $ yarn $ yarn start ``` -------------------------------- ### Start Signature Proof Client Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/verify-account-ownership-signature-proofs/signature-proofs.rst Run the signature proof client application using npm. This command should be executed in the 'signature-proof-client' directory. ```console $ cd signature-proof-client && npm run dev ``` -------------------------------- ### Connect Two Local Nodes (Node 1) Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/nodes/run-local-chain/run-local-chain-source.rst Start the first node in a multi-node local network setup, configured to connect to a second node on port 8001. This is part of establishing a single chain with multiple validators. ```console cargo run --release -- \ --genesis-data-file /path/to/genesis.dat \ --no-bootstrap= \ --listen-port 8000 \ --grpc2-listen-port 7000 \ --grpc2-listen-addr 127.0.0.1 \ --data-dir node-0 \ --config-dir node-0 \ --validator-credentials-file /path/bakers/baker-0-credentials.json \ --connect-to 127.0.0.1:8001 \ --debug= ``` -------------------------------- ### Start Signature Proof Server Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/verify-account-ownership-signature-proofs/signature-proofs.rst Run the signature proof server application using npm. This command should be executed in the 'signature-proof-server' directory. ```console $ cd signature-proof-server && npm start ``` -------------------------------- ### Get Token Information using Web SDK Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/plt/web-sdk.rst Retrieves detailed information about a specific Protocol-Level Token, including its symbol, total supply, decimals, module state, and module reference. This example uses the ConcordiumGRPCNodeClient and requires a TokenId. ```typescript import { BlockHash } from '@concordium/web-sdk'; import { ConcordiumGRPCNodeClient } from '@concordium/web-sdk/nodejs'; import { credentials } from '@grpc/grpc-js'; import { Cbor, TokenId, TokenInfo } from '@concordium/web-sdk/plt'; const client = new ConcordiumGRPCNodeClient( "grpc.testnet.concordium.com", Number(20000), credentials.createSsl() ); // token symbol const tokenId = TokenId.fromString("TOKEN_ID"); // Replace with actual token symbol // If using a specific block hash, uncomment and replace with actual hash // Or use undefined for latest finalized block const blockHash = undefined; // const blockHash = BlockHash.fromHexString("someblockhash"); const tokenInfo: TokenInfo = await client.getTokenInfo(tokenId, blockHash); console.log('Total token supply:', tokenInfo.state.totalSupply); console.log('decimals:', tokenInfo.state.decimals); console.log('Module state:', Cbor.decode(tokenInfo.state.moduleState)); console.log('moduleRef:', tokenInfo.state.moduleRef.toString()); console.log('Token id:', tokenInfo.id); ``` -------------------------------- ### View Contract State with Example Index Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/smartContractUpgrade/smartContractUpgrade.rst An example of invoking the 'view' entrypoint using a specific smart contract index. ```bash $concordium-client contract invoke 4462 --entrypoint view --grpc-port 20000 --grpc-ip grpc.testnet.concordium.com --secure ``` -------------------------------- ### Get Protocol Level Token List using Rust SDK Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/plt/rust-sdk.rst This example retrieves a list of all Protocol Level Tokens (PLTs) on the Concordium blockchain. Optionally specify a block hash for historical token lists. Requires the concordium-rust-sdk crate. ```rust //! # Get Protocol Level Token List //! This example demonstrates how to retrieve a list of all (PLTs) on the Concordium blockchain. //! ## How to use this example: //! 1. Optionally set a specific block hash in `BLOCK_HASH` (or leave as None for latest) //! 2. Run with: `cargo run --example get_token_list` use anyhow::Context; use concordium_base::hashes::BlockHash; use concordium_rust_sdk::v2; use futures::StreamExt; use std::str::FromStr; // CONFIGURATION - Modify these values for your use case const BLOCK_HASH: Option<&str> = None; // Set to Some("blockhash") for specific block, None for latest #[tokio::main] async fn main() -> anyhow::Result<()> { let mut client = v2::Client::new(v2::Endpoint::from_str( "https://grpc.testnet.concordium.com:20000", )?) .await .context("Failed to connect to Concordium node")?; // Determine block identifier let block_ident = match BLOCK_HASH { Some(hash_str) => { let block_hash = BlockHash::from_str(hash_str).context("Invalid block hash format")?; v2::BlockIdentifier::Given(block_hash) } None => v2::BlockIdentifier::LastFinal, }; // Get token list let mut response = client .get_token_list(&block_ident) .await .context("Failed to get token list")?; println!( "Listing the Token ID of every protocol level token on chain at the time of block hash {}:", response.block_hash ); // Collect tokens while let Some(token_id) = response .response .next() .await .transpose() .context("Error while reading token from stream")? { println!(" - {}", String::from(token_id)); } Ok(()) } ``` -------------------------------- ### Get Token List using Web SDK Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/plt/web-sdk.rst Retrieves all Protocol-Level Tokens available on the network. This example uses the ConcordiumGRPCNodeClient to query the token list, optionally specifying a block hash or using the latest finalized block. It demonstrates iterating through the token stream. ```typescript import { BlockHash } from '@concordium/web-sdk'; import { ConcordiumGRPCNodeClient } from '@concordium/web-sdk/nodejs'; import { credentials } from '@grpc/grpc-js'; const client = new ConcordiumGRPCNodeClient( "grpc.testnet.concordium.com", Number(20000), credentials.createSsl() ); // If using a specific block hash, uncomment and replace with actual hash //const blockHash = BlockHash.fromHexString("fb035b994852a9e246e1f48ffd7ab83e6f0ec5fff1f3ced6e5af2373227c2733"); // Or use undefined for latest finalized block const blockHash = undefined; const tokens = await client.getTokenList(blockHash); console.log('Protocol level tokens (PLTs) that exists at the end of the given block: \n',JSON.stringify(tokens, null, 2)); for await (const token of tokens) { console.log(token.toString()); } ``` -------------------------------- ### Project Structure Overview Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/verify-access/scaffolding.rst Illustrates the expected file and directory structure after creating the folders. Placeholder files will be created later. ```text age-verification-app/ ├── src/ │ ├── app/ │ │ ├── api/ │ │ │ └── verification/ │ │ │ ├── create/ │ │ │ │ └── route.ts (we'll create this later) │ │ │ └── verify/ │ │ │ └── route.ts (we'll create this later) │ │ ├── layout.tsx (already exists) │ │ └── page.tsx (already exists) │ ├── components/ │ │ └── AgeGate.tsx (we'll create this later) │ ├── hooks/ │ │ └── useVerification.ts (we'll create this later) │ └── lib/ │ ├── config.ts (we'll create this later) │ ├── session.ts (optional, for production) │ └── verifier-service.ts (we'll create this later) ├── keys/ ├── docker-compose.yml (we'll create this next) ├── .env.local (we'll create this now) └── package.json ``` -------------------------------- ### Create Client Project and Install Dependencies Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/verify-account-ownership-signature-proofs/signature-proofs.rst Sets up a new React client project using Vite and installs necessary Concordium browser wallet API helpers and React dependencies. ```console $ mkdir signature-proof-client && cd signature-proof-client $ npm init -y $ npm install react react-dom @concordium/browser-wallet-api-helpers $ npm install -D vite @vitejs/plugin-react ``` -------------------------------- ### Get Protocol Level Token Information using Rust SDK Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/plt/rust-sdk.rst This example retrieves information about a specific Protocol Level Token (PLT). Set the token ID to query and optionally specify a block hash for historical data. Requires the concordium-rust-sdk crate. ```rust //! # Get Protocol Level Token Information //! This example demonstrates how to retrieve information about a Protocol Level Token (PLT). //! ## How to use this example: //! 1. Set the token ID to query in the `TOKEN_ID` constant below //! 2. Optionally set a specific block hash in `BLOCK_HASH` (or leave as None for latest) //! 3. Run with: `cargo run --example get_token_info` use anyhow::Context; use concordium_base::{hashes::BlockHash, protocol_level_tokens::TokenId}; use concordium_rust_sdk::v2; use std::str::FromStr; // CONFIGURATION - Modify these values for your use case const TOKEN_ID: &str = "TOKEN_ID"; // Replace with the actual token ID you want to query const BLOCK_HASH: Option<&str> = None; // Set to Some("blockhash") for specific block, None for latest #[tokio::main] async fn main() -> anyhow::Result<()> { let mut client = v2::Client::new(v2::Endpoint::from_str( ``` -------------------------------- ### Connect Two Local Nodes (Node 2) Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/nodes/run-local-chain/run-local-chain-source.rst Start the second node in a multi-node local network setup, listening on different ports (8001/7001) and connecting back to the first node on port 8000. This ensures both nodes can communicate and build a single chain. ```console cargo run --release -- \ --genesis-data-file /path/to/genesis.dat \ --no-bootstrap= \ --listen-port 8001 \ --grpc2-listen-port 7001 \ --grpc2-listen-addr 127.0.0.1 \ --data-dir node-1 \ --config-dir node-1 \ --validator-credentials-file /path/bakers/baker-1-credentials.json \ --connect-to 127.0.0.1:8000 \ --debug= ``` -------------------------------- ### Initialize Main Function and Client Source: https://github.com/concordium/concordium.github.io/blob/main/source/academy/tutorials/nft-minting/contract-interactions.rst Sets up the multi-threaded runtime, parses command-line arguments, and establishes a connection to the Concordium node. It also loads account keys and retrieves the latest account nonce. ```rust #[tokio::main(flavor = "multi_thread")] async fn main() -> anyhow::Result<()> { use base64::{engine::general_purpose, Engine as _}; let app = { let app = App::clap().global_setting(AppSettings::ColoredHelp); let matches = app.get_matches(); App::from_clap(&matches) }; let mut client = v2::Client::new(app.endpoint) .await .context("Cannot connect.")?; // load account keys and sender address from a file let keys: WalletAccount = WalletAccount::from_json_file(app.keys_path).context("Could not read the keys file.")?; // Get the initial nonce at the last finalized block. let acc_info: AccountInfo = client .get_account_info(&keys.address.into(), &v2::BlockIdentifier::Best) .await? .response; let nonce = acc_info.account_nonce; // set expiry to now + 5min let expiry: TransactionTime = TransactionTime::from_seconds((chrono::Utc::now().timestamp() + 300) as u64); ``` -------------------------------- ### Initializing a Smart Contract Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/smart-contracts/integration-test-contract.rst This example shows how to initialize a contract using `chain.contract_init`. It requires a signer, account address, energy limit, module reference, contract name, parameter, and amount. The initialization can fail, so the result is unwrapped. ```rust #[test] fn my_test() { // .. Lines omitted for brevity let initialization = chain .contract_init( Signer::with_one_key(), account_address, Energy::from(10000), InitContractPayload { mod_ref: deployment.module_reference, init_name: OwnedContractName::new_unchecked("init_my_contract".to_string()), param: OwnedParameter::from_serial(&"my_param").unwrap(), amount: Amount::zero(), } ) .unwrap(); } ``` -------------------------------- ### Install Homebrew (macOS) Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/governance/install-ledger-app.rst Installs the Homebrew package manager on macOS, which is required for installing other dependencies. ```console $/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Install Rust and Cargo Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/setup-env.rst Install the Rust programming language and its package manager, Cargo. This is a prerequisite for installing cargo-concordium. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env ``` -------------------------------- ### Example Configuration Display Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/technical-reference/concordium-client/concordium-client.rst An example output of the 'concordium-client config show' command, illustrating base configuration and account key details. ```console $concordium-client config show Base configuration: - Verbose: no - Account config dir: /var/lib/concordium/config/accounts - Account name map: default -> 3urFJGp9AaU62fQ3DEfCczqJwVt9V3F1gjE5PPBaYgqBD6rqPB Account keys: - '3urFJGp9AaU62fQ3DEfCczqJwVt9V3F1gjE5PPBaYgqBD6rqPB' { "0": { "0": { "encryptedSignKey": { ``` -------------------------------- ### App Component Setup Source: https://github.com/concordium/concordium.github.io/blob/main/source/academy/tutorials/register-data.rst Sets up the main application component, managing the connection state and rendering the Header and RegisterData components conditionally. ```typescript import "./App.css"; import Header from "./Header"; import { useState } from "react"; import { Container } from "@mui/material"; import RegisterData from "./RegisterData"; export default function App() { const [isConnected, setConnected] = useState(false); return (
setConnected(true)} onDisconnected={() => setConnected(false)} /> {isConnected && }
); } ``` -------------------------------- ### Deploy Counter Contract Source: https://github.com/concordium/concordium.github.io/blob/main/source/academy/tutorials/counter-contract.rst Example of deploying the counter contract with an initial value. ```bash concordium-client contract deploy counter.contract --init-arg 10 --sender --sign-key ``` -------------------------------- ### Deserialize Parameters using get() Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/learn/smart-contracts/develop-contracts.rst Demonstrates deserializing contract parameters into a structured type using the `get()` method from the `Get` trait. This is a straightforward way to handle parameters. ```rust use concordium_std::* type State = u32; #[derive(Serialize)] struct ReceiveParameter{ should_add: bool, value: u32, } #[init(contract = "parameter_example")] fn init( _ctx: &InitContext, _state_builder: &mut StateBuilder, ) -> InitResult { let initial_state = 0; Ok(initial_state) } #[receive(contract = "parameter_example", name = "receive", mutable)] fn receive( ctx: &ReceiveContext, host: &mut Host, ) -> ReceiveResult<()> { let parameter: ReceiveParameter = ctx.parameter_cursor().get()?; if parameter.should_add { *host.state_mut() += parameter.value; } Ok(()) } ``` -------------------------------- ### Install Pip (Ubuntu) Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/governance/install-ledger-app.rst Installs the python3-pip package on Ubuntu using apt-get. ```console $sudo apt-get install python3-pip ``` -------------------------------- ### Install Verification Web UI SDK Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/verify-access/ui-integration.rst Install the necessary SDK package using npm. This command should be run in your project's root directory. ```bash npm install @concordium/verification-web-ui ``` -------------------------------- ### Develop Documentation on Windows Source: https://github.com/concordium/concordium.github.io/blob/main/README.md Run the development server on Windows to watch for changes and automate documentation builds. Navigate to localhost:8000/mainnet after starting. ```bash pipenv run make.bat dev-mainnet ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/concordium/concordium.github.io/blob/main/CLAUDE.md Installs all necessary development dependencies using Pipenv. ```bash pipenv sync --dev ``` -------------------------------- ### Example upgrade.json with Module Reference Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/smartContractUpgrade/smartContractUpgrade.rst An example of the `upgrade.json` file populated with a specific module reference. This file is used to specify the target module for the upgrade. ```json { "migrate": { "Some": [ [ "migration", "" ] ] }, "module": "31539c983f2ee56822041230d7fd20a3516da9271837e23bb77111bb8c4c7dcd" } ``` -------------------------------- ### Install cargo-generate Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/smart-contracts/setup-contract.rst Install the cargo-generate crate, which is required for generating smart contracts from templates. ```console $cargo install --locked cargo-generate ``` -------------------------------- ### Install Ledgerblue (Ubuntu) Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/governance/install-ledger-app.rst Installs the 'ledgerblue' Python package using pip3 on Ubuntu. ```console $sudo pip3 install ledgerblue ``` -------------------------------- ### Install Python 3 (Ubuntu) Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/governance/install-ledger-app.rst Installs the python3 package on Ubuntu using apt-get. ```console $sudo apt-get install python3 ``` -------------------------------- ### Start Next.js Development Server Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/verify-access/scaffolding.rst Starts the Next.js development server to view the default welcome page. Press Ctrl+C to stop. ```bash # Start the Next.js development server npm run dev ``` -------------------------------- ### Install Ledgerblue (macOS) Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/governance/install-ledger-app.rst Installs the 'ledgerblue' Python package using pip3 on macOS. ```console $pip3 install ledgerblue ``` -------------------------------- ### Initialize Contract with Binary Parameters Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/smart-contracts/initialize-contract.rst Use this command to initialize a contract instance when parameters are provided in a binary file. Ensure the module reference and contract name are correct. ```console $concordium-client contract init \ 9eb82a01d96453dbf793acebca0ce25c617f6176bf7a564846240c9a68b15fd2 \ --contract my_parameter_contract \ --energy 10000 \ --parameter-bin my_parameter.bin ``` -------------------------------- ### Install Ledgerblue (Windows) Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/how-to/governance/install-ledger-app.rst Installs the 'ledgerblue' Python package using pip on Windows. ```console $pip install ledgerblue ``` -------------------------------- ### Initialize a New Smart Contract Project Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/hello-world/hello-world.rst Use this command to create a new smart contract project with a default template. Ensure you have cargo-concordium installed. ```console $ cargo concordium init ``` -------------------------------- ### Install Development Dependencies with Pipenv Source: https://github.com/concordium/concordium.github.io/blob/main/README.md Synchronize and install all development dependencies defined in the Pipfile. ```bash pipenv sync --dev ``` -------------------------------- ### Clone Smart Contract Upgrade Example Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/smartContractUpgrade/smartContractUpgrade.rst Clone the smart contract upgrade example repository from GitHub to your local machine. ```bash $git clone --recurse-submodules git@github.com:Concordium/concordium-rust-smart-contracts.git ``` -------------------------------- ### Example Upgrade Command with Contract Index Source: https://github.com/concordium/concordium.github.io/blob/main/source/mainnet/tutorials/smartContractUpgrade/smartContractUpgrade.rst An example of the contract update command using a specific smart contract index. This demonstrates how to execute the upgrade with concrete parameters. ```console $concordium-client contract update 4462 --entrypoint upgrade --parameter-json upgrade.json --energy 5000 --sender --grpc-port 20000 --grpc-ip grpc.testnet.concordium.com --secure ``` -------------------------------- ### Run Development Server (Linux/macOS) Source: https://github.com/concordium/concordium.github.io/blob/main/CLAUDE.md Starts a development server with auto-rebuild enabled for Linux and macOS. ```bash pipenv run make dev-mainnet ```