Use when setting up or verifying the NEAR development environment -- installing Rust, near-cli, cargo-near, near-sdk-js, py-near, or any NEAR toolchain dependencies.
echo "=== Node ===" && node --version && npm --version && \
echo "=== Rust ===" && (rustc --version 2>/dev/null || echo "NOT INSTALLED") && \
echo "=== WASM ===" && (rustup target list --installed 2>/dev/null | grep wasm32 || echo "NOT INSTALLED") && \
echo "=== NEAR CLI ===" && (near --version 2>/dev/null || echo "NOT INSTALLED") && \
echo "=== cargo-near ===" && (cargo near --version 2>/dev/null || echo "NOT INSTALLED") && \
echo "=== Python ===" && python3 --version
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
rustup target add wasm32-unknown-unknown
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.sh | sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh
npm init -y && npm install near-sdk-js
pip3 install py-near
# Create testnet account with faucet
near account create-account fund-later use-auto-generation save-to-folder ~/.near-credentials/testnet/
# Import existing account
near account import-account using-seed-phrase "<SEED_PHRASE>" --networkId testnet
export NEAR_ENV=testnet
export NEAR_AI_API_KEY="" # get from human at hackathon start