### Example Installation Output Source: https://www.anchor-lang.com/docs/installation This is an example of the output you should expect after a successful installation, showing the versions of installed tools. It indicates that Rust, Solana CLI, Anchor CLI, Node.js, and Yarn have been installed and prompts you to restart your terminal. ```text Installed Versions: Rust: rustc 1.85.0 (4d91de4e4 2025-02-17) Solana CLI: solana-cli 2.1.15 (src:53545685; feat:3271415109, client:Agave) Anchor CLI: anchor-cli 0.32.1 Node.js: v23.9.0 Yarn: 1.22.1 Installation complete. Please restart your terminal to apply all changes. ``` -------------------------------- ### Connect to Ethereum using MetaMask (JavaScript) Source: https://docs.ethers.org/v6/getting-started This snippet demonstrates how to connect to the Ethereum network using MetaMask, a browser extension. It handles cases where MetaMask is not installed by defaulting to a read-only provider. It also shows how to obtain a Signer for authenticated write operations. ```javascript let signer = null; let provider; if (window.ethereum == null) { // If MetaMask is not installed, we use the default provider, // which is backed by a variety of third-party services (such // as INFURA). They do not have private keys installed, // so they only have read-only access console.log("MetaMask not installed; using read-only defaults"); provider = ethers.getDefaultProvider(); } else { // Connect to the MetaMask EIP-1193 object. This is a standard // protocol that allows Ethers access to make all read-only // requests through MetaMask. provider = new ethers.BrowserProvider(window.ethereum); // It also provides an opportunity to request access to write // operations, which will be performed by the private key // that MetaMask manages for the user. signer = await provider.getSigner(); } ``` -------------------------------- ### Query Blockchain State (JavaScript) Source: https://docs.ethers.org/v6/getting-started This code demonstrates how to query read-only data from the Ethereum blockchain using a Provider. It includes examples for retrieving the current block number, an account's balance, and the transaction count for an address. ```javascript // Look up the current block number (i.e. height) await provider.getBlockNumber(); // 22823520 // Get the current balance of an account (by address or ENS name) const balance = await provider.getBalance("ethers.eth"); // 4085267032476673080n // Since the balance is in wei, you may wish to display it // in ether instead. formatEther(balance); // '4.08526703247667308' // Get the next nonce required to send a transaction await provider.getTransactionCount("ethers.eth"); // 2 ``` -------------------------------- ### Install Ethers.js via NPM Source: https://docs.ethers.org/v6/getting-started This command installs the Ethers.js library using npm, a package manager for Node.js. Ensure you have Node.js and npm installed on your system. This is the standard way to add Ethers.js to a project for server-side or build-tool-based development. ```bash # Install ethers /home/ricmoo/test-ethers> npm install ethers ``` -------------------------------- ### Install Project Dependencies with Yarn (Example Output) Source: https://www.anchor-lang.com/docs/installation This snippet shows the expected output after running the `yarn --version` command, indicating the version of Yarn installed on your system. ```shell 1.22.1 ``` -------------------------------- ### Define and Instantiate Contract with ABI (JavaScript) Source: https://docs.ethers.org/v6/getting-started Shows how to define a simplified ERC-20 ABI and instantiate a Contract object using the ABI, contract address, and a provider. This is useful for interacting with deployed contracts. ```javascript abi = [ "function decimals() view returns (string)", "function symbol() view returns (string)", "function balanceOf(address addr) view returns (uint)" ] contract = new Contract("dai.tokens.ethers.eth", abi, provider) ``` -------------------------------- ### Connect to Custom RPC Backend (JavaScript) Source: https://docs.ethers.org/v6/getting-started This code shows how to connect to a custom Ethereum RPC backend, such as a local Geth node or a third-party service like Infura. It utilizes the JsonRpcProvider and demonstrates how to obtain a Signer for write operations. ```javascript // If no %%url%% is provided, it connects to the default // http://localhost:8545, which most nodes use. provider = new ethers.JsonRpcProvider(url); // Get write access as an account by getting the signer signer = await provider.getSigner(); ``` -------------------------------- ### Send Transaction with Ether Value (JavaScript) Source: https://docs.ethers.org/v6/getting-started Demonstrates sending a transaction with a specified Ether value, converting it to Wei using parseEther. It also shows how to wait for the transaction receipt after mining. ```javascript tx = await signer.sendTransaction({ to: "ethers.eth", value: parseEther("1.0") }); receipt = await tx.wait(); ``` -------------------------------- ### Install Solana Dependencies (Bash Script) Source: https://solana.com/docs/intro/installation This command downloads and executes a script to install Rust, Solana CLI, and Anchor Framework. It's designed for quick setup on WSL, Linux, and Mac. Ensure you have `curl` installed. ```bash curl --proto '=https' --tlsv1.2 -sSfL https://solana-install.solana.workers.dev | bash ``` -------------------------------- ### Build Solana Project with Anchor Source: https://www.anchor-lang.com/docs/installation Command to build a Solana project using Anchor. The `--force-tools-install` flag ensures necessary tools are installed, which can be useful for initial setup or resolving toolchain issues. This command is typically run in the project's root directory. ```shell cargo build-sbf --force-tools-install ``` -------------------------------- ### Read Read-Only Contract Methods (JavaScript) Source: https://docs.ethers.org/v6/getting-started Illustrates how to read data from a contract using its ABI and a provider. It fetches the token symbol, decimals, and balance for a given address, then formats the balance for display. ```javascript abi = [ "function decimals() view returns (uint8)", "function symbol() view returns (string)", "function balanceOf(address a) view returns (uint)" ] contract = new Contract("dai.tokens.ethers.eth", abi, provider) sym = await contract.symbol() decimals = await contract.decimals() balance = await contract.balanceOf("ethers.eth") formatUnits(balance, decimals) ``` -------------------------------- ### Sign and Verify Messages (Ethers.js) Source: https://docs.ethers.org/v6/getting-started This snippet illustrates how to use a private key (Wallet) in Ethers.js to sign arbitrary messages and then verify the signature. This is useful for proving ownership of an account for authentication purposes or authorizing other actions. ```javascript // Our signer; Signing messages does not require a Provider const signer = new Wallet(id("test")); const message = "sign into ethers.org?"; // Signing the message const sig = await signer.signMessage(message); console.log(sig); // '0xefc6e1d2f21bb22b1013d05ecf1f06fd73cdcb34388111e4deec58605f3667061783be1297d8e3bee955d5b583bac7b26789b4a4c12042d59799ca75d98d23a51c' // Validating a message; notice the address matches the signer console.log(verifyMessage(message, sig)); // '0xC08B5542D177ac6686946920409741463a15dDdB' ``` -------------------------------- ### Simulate State-Changing Method Call (JavaScript) Source: https://docs.ethers.org/v6/getting-started Shows how to simulate a state-changing method call without actually executing it on the blockchain using `staticCall`. This can be useful for preflighting transactions. It also demonstrates simulating the call as a different account. ```javascript abi = [ "function transfer(address to, uint amount) returns (bool)" ] contract = new Contract("dai.tokens.ethers.eth", abi, provider) amount = parseUnits("1.0", 18) await contract.transfer.staticCall("ethers.eth", amount) other = new VoidSigner("0x643aA0A61eADCC9Cc202D1915D942d35D005400C") contractAsOther = contract.connect(other.connect(provider)) await contractAsOther.transfer.staticCall("ethers.eth", amount) ``` -------------------------------- ### Install Rust Programming Language Source: https://www.anchor-lang.com/docs/installation Installs the Rust toolchain using rustup, the recommended installer. Rust is the primary language for developing Solana programs. ```bash curl --proto '=https' --tlsv1.2 -sSF https://sh.rustup.rs | sh ``` -------------------------------- ### Install Rust using rustup Source: https://www.anchor-lang.com/docs/installation Installs the Rust programming language and its package manager, cargo, using the recommended rustup installer. This is a prerequisite for Solana development. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ``` -------------------------------- ### Install Solana CLI Source: https://www.anchor-lang.com/docs/installation Installs the Solana Command Line Interface (CLI) tool suite, which is necessary for building, deploying, and managing Solana programs. It uses a script from the Anza release repository. ```bash sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" ``` -------------------------------- ### Install Solana CLI using curl Source: https://www.anchor-lang.com/docs/installation This command downloads and executes the Solana CLI installation script. It supports specifying a release tag or using predefined channels like 'stable', 'beta', or 'edge'. Ensure you have curl installed. ```bash curl -sSfL https://release.anza.xyz/stable/install) | sh ``` -------------------------------- ### Getting Started with CoinGecko API Source: https://apiguide.coingecko.com/getting-started/getting-started Guides and information to help you get started with the CoinGecko API, including setup, error handling, and API status. ```APIDOC ## Getting Started with CoinGecko API ### Description This section provides essential information for new users of the CoinGeck API. It covers introduction, API key setup, common errors, rate limits, and API status. ### Method N/A (Documentation Reference) ### Endpoint N/A (Documentation Reference) ### Parameters N/A ### Request Example N/A ### Response N/A **Guides Available:** - **Introduction:** [/](/) - **Setting Up Your API Key:** [/docs/setting-up-your-api-key](/docs/setting-up-your-api-key) - **Common Errors & Rate Limit:** [/docs/common-errors-rate-limit](/docs/common-errors-rate-limit) - **API Status:** [/docs/api-status](/docs/api-status) - **CoinGecko SDK (Beta):** [/docs/sdk](/docs/sdk) - **CoinGecko MCP Server (Beta):** [/docs/mcp-server](/docs/mcp-server) ``` -------------------------------- ### Install and Use Latest Anchor CLI with AVM Source: https://www.anchor-lang.com/docs/installation Installs the latest available version of the Anchor CLI using AVM and then sets it as the active version for the current session. This is a convenient way to get started with the most recent features. ```shell avm install latest avm use latest ``` -------------------------------- ### Geth: Use Configuration File Source: https://github.com/ethereum/go-ethereum This command demonstrates how to start the geth binary using a configuration file. It's an alternative to passing numerous flags directly. The configuration file path is specified with the --config flag. ```shell $ geth --config /path/to/your_config.toml ``` -------------------------------- ### Clone and Setup Wormhole LLMs Demo Project Source: https://github.com/wormhole-foundation/demo-basic-connect Clones the demo-basic-connect repository from GitHub and installs its dependencies using npm. This is the initial setup step for running the project locally. ```bash git clone https://github.com/wormhole-foundation/demo-basic-connect.git cd demo-basic-connect npm install ``` -------------------------------- ### Solana CLI Installation Guide Metadata (HTML) Source: https://solana.com/docs/intro/installation This snippet defines metadata for a webpage about installing the Solana CLI and Anchor. It includes the page title, description, and robot directives, optimizing it for search engines and users. ```html