### Manual Installation - Install Dependencies and Start Dev Server Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/xion-quick-start/zero-to-dapp-in-5-minutes/launch-a-user-map-dapp-on-xion-in-5-minutes.md Installs project dependencies and starts the local development server. ```bash npm install npm run dev ``` -------------------------------- ### Running Examples Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/backend-app/xion-backend-using-cosmjs.md Command to execute the JavaScript examples file. ```bash node examples.js ``` -------------------------------- ### Clone the Starter Pack Source: https://github.com/burnt-labs/docs/blob/main/developers/verification/internet-verification/verifying-api-data-with-zero-knowledge-zkfetch.md Clones the zkfetch-client repository, installs dependencies, and runs a post-install script for zkFetch setup. ```bash git clone https://github.com/burnt-labs/zkfetch-client.git cd zkfetch-client npm install npm run postinstall npm start ``` -------------------------------- ### Verify Go Installation Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Command to verify the Go installation. ```bash go version ``` -------------------------------- ### Install Go on Arch Linux Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Command to install Go on Arch Linux. ```bash sudo pacman -S go ``` -------------------------------- ### Install Dependencies Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/integrations/token-factory/building-a-react-dapp-to-interact-with-token-factory-tokens.md Install the Abstraxion SDK. ```sh npm install @burnt-labs/abstraxion ``` -------------------------------- ### Verify Rust Installation Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Command to check if Rust is installed correctly. ```bash rustc --version ``` -------------------------------- ### Install cargo-generate Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Command to install the cargo-generate tool. ```bash cargo install cargo-generate ``` -------------------------------- ### Install dependencies Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/xion-quick-start/zero-to-dapp-in-5-minutes/build-a-todo-app-using-the-collection-document-storage-smart-contract.md Installs the necessary dependencies for the frontend application. ```bash cd todo-app-frontend npm install ``` -------------------------------- ### Install Dependencies Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/xion-quick-start/zero-to-dapp-in-5-minutes/react-native-mobile-dapp-on-xion-in-5-minutes.md Install the project dependencies using npm. ```bash npm install ``` -------------------------------- ### Start the Development Server Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/integrations/token-factory/building-a-react-dapp-to-interact-with-token-factory-tokens.md Start the development server to view the application. ```sh npm run dev ``` -------------------------------- ### Verify cargo-generate Installation Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Command to verify the installation of cargo-generate. ```bash cargo generate --version ``` -------------------------------- ### macOS Installation Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Instructions for installing xiond on macOS using Homebrew. ```bash brew tap burnt-labs/xion brew install xiond xiond version ``` -------------------------------- ### Install Dependencies Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/backend-app/build-restapi-with-account-abstraction-and-backend-session.md Installs core and development dependencies for backend session management. ```bash # Core dependencies pnpm add @burnt-labs/abstraxion-core @burnt-labs/constants pnpm add @prisma/client prisma zod pnpm add next-auth @auth/prisma-adapter bcryptjs # Development dependencies pnpm add -D @types/bcryptjs @types/node tsx jest @testing-library/jest-dom ``` -------------------------------- ### Execute Transaction with Treasury Granter Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/getting-started/treasury-contracts.md Example of executing a transaction where the granter is set to the Treasury contract's address. ```typescript return client.execute( sender, contract, msg, { amount: [{ amount: "1", denom: "uxion" }], gas: "500000", granter: TREASURY.treasury }, "", [] ); ``` -------------------------------- ### Manual Installation - Clone Repository Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/xion-quick-start/zero-to-dapp-in-5-minutes/launch-a-user-map-dapp-on-xion-in-5-minutes.md Clones the frontend project from the Git repository and navigates into the project directory. ```bash git clone https://github.com/burnt-labs/xion-user-map-json-store-frontend cd xion-user-map-json-store-frontend ``` -------------------------------- ### Verify xiond installation Source: https://github.com/burnt-labs/docs/blob/main/developers/tools/xiond-cli.md Run this command to verify that xiond is installed correctly. A successful installation will display command output similar to the example. ```sh xiond ``` -------------------------------- ### Install UUID Dependency Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/integrations/websockets/websockets-with-xion-real-time-communication.md Installs the 'uuid' package, used for generating unique IDs in more complex examples. ```bash npm install uuid ``` -------------------------------- ### Get Current User Information Request Example Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/oauth2-app.md Example of how to fetch current user information using the `/api/v1/me` endpoint. ```typescript const response = await fetch('https://oauth2.testnet.burnt.com/api/v1/me', { headers: { 'Authorization': `Bearer ${accessToken}`, }, }) const userInfo = await response.json() ``` -------------------------------- ### Query Transaction Status Request Example Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/oauth2-app.md Example of how to query the status of a previously submitted transaction using the `GET /api/v1/transaction/{txHash}/status` endpoint. ```typescript const txHash = 'ABC123...' const response = await fetch( `https://oauth2.testnet.burnt.com/api/v1/transaction/${txHash}/status`, { headers: { 'Authorization': `Bearer ${accessToken}`, }, } ) const status = await response.json() ``` -------------------------------- ### Install Go on Red Hat-based Linux Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Command to install Go on Red Hat-based Linux distributions. ```bash sudo dnf install -y golang ``` -------------------------------- ### Install Go on Debian-based Linux Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Command to install Go on Debian-based Linux distributions. ```bash sudo apt update && sudo apt install -y golang ``` -------------------------------- ### AbstraxionProvider Configuration Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/getting-started/treasury-contracts.md Configuring the AbstraxionProvider with Treasury contract details. ```typescript const treasuryConfig = { treasury: `CONTRACT_ADDRESS`, // optional (only for mainnet) // rpcUrl: ``, // restUrl: `` } export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( {children} ) } ``` -------------------------------- ### Install Go on macOS Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Command to install Go on macOS using Homebrew. ```bash brew install go ``` -------------------------------- ### Fee Grant Allowance Types Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/getting-started/treasury-contracts.md Explains the different types of fee allowances available for covering gas fees. ```plaintext /cosmos.feegrant.v1beta1.BasicAllowance /cosmos.feegrant.v1beta1.PeriodicAllowance /cosmos.feegrant.v1beta1.AllowedMsgAllowance ``` -------------------------------- ### Install Rust using rustup (Red Hat-based Linux) Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Installs required dependencies and then Rust using rustup. ```bash sudo dnf install -y curl gcc-c++ make curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Set up Go Environment Variables Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Commands to set up Go environment variables for GOPATH and PATH, and source the bashrc file. ```bash echo 'export GOPATH=$HOME/go' >> ~/.bashrc echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc source ~/.bashrc ``` -------------------------------- ### Install Dependencies and Configure Environment Source: https://github.com/burnt-labs/docs/blob/main/developers/payments/credit-debit-cards/crossmint-digital-collectibles-checkout-via-credit-card.md After cloning the repository, navigate into the directory and install project dependencies using npm. Then, copy the example environment file and set the necessary variables for treasury address, RPC URL, REST URL, and Crossmint API key. ```bash cd xion-crossmint-hosted-checkout-frontend npm install ``` ```javascript NEXT_PUBLIC_TREASURY_ADDRESS=your_treasury_contract_address NEXT_PUBLIC_RPC_URL="https://rpc.xion-testnet-2.burnt.com:443" NEXT_PUBLIC_REST_URL="https://api.xion-testnet-2.burnt.com" NEXT_PUBLIC_CROSSMINT_API_KEY=your_crossmint_api_key ``` -------------------------------- ### Usage Examples Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/backend-app/xion-backend-using-cosmjs.md This JavaScript file demonstrates various functions for interacting with the Xion blockchain, including getting chain height, wallet addresses, balances, sending tokens, and interacting with smart contracts. ```javascript // examples.js const fs = require('fs'); const { getMyAddress } = require('./xion-wallets'); const { getBalance, getAccount, queryContract, getChainHeight } = require('./xion-queries'); const { sendTokens, executeContract, uploadContract, instantiateContract } = require('./xion-transactions'); // Main function to run all examples async function runExamples() { try { // Get blockchain height to verify connection const height = await getChainHeight(); console.log(`Connected to XION blockchain at height: ${height}`); // Get your wallet address from the environment mnemonic const myAddress = await getMyAddress(); console.log(`Your wallet address: ${myAddress}`); // Check your balance const balance = await getBalance(myAddress); console.log(`Your balance: ${balance} uxion`); // Example: Send tokens if (parseInt(balance) > 1000) { console.log("\n--- Token Transfer Example ---"); // For testing, you could create a recipient address // In production, you'd use a real recipient address const { address: recipientAddress } = await require('./xion-wallets').generateWallet(); console.log(`Generated test recipient address: ${recipientAddress}`); // Send a small amount of tokens const sendResult = await sendTokens(recipientAddress, "1000"); console.log(`Transfer complete! Transaction hash: ${sendResult.transactionHash}`); console.log(`Gas used: ${sendResult.gasUsed}`); } else { console.log("Insufficient balance for transfer example"); } // Example: Query a contract (replace with an actual contract address) /* console.log("\n--- Contract Query Example ---"); const contractAddress = "your_contract_address"; const queryMsg = { get_count: {} }; // Example for a counter contract const queryResult = await queryContract(contractAddress, queryMsg); console.log("Contract query result:", queryResult); // Example: Execute a contract function console.log("\n--- Contract Execution Example ---"); const executeMsg = { increment: {} }; // Example for a counter contract const executeResult = await executeContract(contractAddress, executeMsg); console.log(`Contract execution complete! Transaction hash: ${executeResult.transactionHash}`); */ // Example: Upload and instantiate a contract /* console.log("\n--- Contract Deployment Example ---"); const wasmBinary = fs.readFileSync('./counter.wasm'); const uploadResult = await uploadContract(wasmBinary); console.log(`Contract uploaded with code ID: ${uploadResult.codeId}`); const initMsg = { count: 0 }; const instantiateResult = await instantiateContract( uploadResult.codeId, initMsg, "My Counter Contract" ); console.log(`Contract instantiated at address: ${instantiateResult.contractAddress}`); */ } catch (error) { console.error("Error running examples:", error); console.error(error.stack); } } // Execute the examples runExamples(); ``` -------------------------------- ### Install Rust using rustup (Debian-based Linux) Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Installs required dependencies and then Rust using rustup. ```bash sudo apt update && sudo apt install -y curl build-essential curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Install make if not already installed Source: https://github.com/burnt-labs/docs/blob/main/nodes-and-validators/run-a-node/build-the-xion-daemon.md Installs make on Debian-based systems if it's not already present. ```bash sudo apt update && sudo apt install coreutils # check if make is already installed make --version # if it's not installed run sudo apt install make ``` -------------------------------- ### Clone the Xion repository and build xiond Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Clones the Xion repository from GitHub, checks out the main branch, and installs the xiond binary. ```bash git clone https://github.com/burnt-labs/xion.git cd xion git checkout main make install ``` -------------------------------- ### Install Cargo on macOS Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Command to install Cargo on macOS if Rust is installed via rustup. ```bash rustup component add cargo ``` -------------------------------- ### Run the App Locally Source: https://github.com/burnt-labs/docs/blob/main/developers/payments/ach-and-bank-transfers/build-a-brale-ach-on-off-ramp-app-on-xion.md Starts the Next.js development server on localhost. ```bash pnpm dev --hostname 127.0.0.1 ``` -------------------------------- ### Backup Treasury Setup Source: https://github.com/burnt-labs/docs/blob/main/developers/tools/xion-toolkit.md Command to export the Treasury setup. ```bash xion-toolkit treasury export ``` -------------------------------- ### Install Rust using Pacman (Arch Linux) Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Installs Rust using Pacman and initializes the default stable toolchain. ```bash sudo pacman -S rustup rustup default stable ``` -------------------------------- ### Install Build Essentials and Development Tools Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/setting-up-your-xion-smart-contract-development-environment-on-windows-wsl2-+-ubuntu.md Command to install essential build tools and development utilities. ```bash sudo apt install -y build-essential pkg-config libssl-dev curl git jq unzip wget ``` -------------------------------- ### Installation Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/oauth2-app.md Install the @cosmjs/stargate package using npm, pnpm, yarn, or bun. ```bash # npm npm install @cosmjs/stargate # pnpm pnpm install @cosmjs/stargate # yarn yarn add @cosmjs/stargate # bun bun add @cosmjs/stargate ``` -------------------------------- ### Start the Xion Daemon Source: https://github.com/burnt-labs/docs/blob/main/nodes-and-validators/run-a-node/join-the-xion-network/README.md Command to start the Xion daemon and synchronize the node. ```bash $ xiond start --x-crisis-skip-assert-invariants --home /home/xiond/.xiond ``` -------------------------------- ### Add Executable Permissions Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Make the extracted binary executable. ```shell chmod +x ``` -------------------------------- ### Install Rust using Homebrew (macOS) Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Installs Rust using Homebrew and initializes the Rust environment. ```bash brew install rustup rustup-init ``` -------------------------------- ### One-off mainnet command example Source: https://github.com/burnt-labs/docs/blob/main/developers/tools/xion-toolkit.md Example of running a single command on the mainnet. ```bash xion-toolkit --network mainnet status ``` -------------------------------- ### Example Instantiate Output Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/deploy-a-cosmwasm-smart-contract.md Example output from the contract instantiation transaction. ```text gas estimate: 217976 code: 0 txhash: 09D48FE11BE8D8BD4FCE11D236D80D180E7ED7707186B1659F5BADC4EC116F30 ``` -------------------------------- ### Interact with xiond in Docker Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Example commands to interact with xiond once inside the Docker container. ```bash xiond version xiond version --long xiond --help ``` -------------------------------- ### Install skills for AI agents Source: https://github.com/burnt-labs/docs/blob/main/developers/tools/xion-toolkit.md Installs skills for AI agents using npx. ```bash npx skills add burnt-labs/xion-agent-toolkit -g ``` -------------------------------- ### List keys to verify persistence Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/local-development/setting-up-env/installation-prerequisites-setup-local-environment.md Lists existing keys after restarting the container with the same volume to confirm data persistence. ```bash xiond keys list ``` -------------------------------- ### Install Java SE Development Kit on Windows Source: https://github.com/burnt-labs/docs/blob/main/developers/accounts/mobile-app/set-up-your-xion-mobile-development-environment.md Installs the Microsoft OpenJDK 17 using Chocolatey. ```bash choco install -y microsoft-openjdk17 ``` -------------------------------- ### Persist default network example Source: https://github.com/burnt-labs/docs/blob/main/developers/tools/xion-toolkit.md Example of setting the default network to mainnet persistently. ```bash xion-toolkit config set-network mainnet ``` -------------------------------- ### Form Submissions Example Source: https://github.com/burnt-labs/docs/blob/main/developers/computation/use-cases/building-a-per-user-data-storage-dapp.md Example JSON structure for form submissions. ```json { "survey": { "question1": "answer", "question2": 5 } } ```