### Start Curio Guided Setup Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/pdp/install-and-run-pdp.md Initiate the interactive guided setup process for Curio. This utility assists in configuring a new miner. ```sh curio guided-setup ``` -------------------------------- ### Example Curio Version Output Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/pdp/install-and-run-pdp.md This is an example of the expected output when verifying the Curio installation with `curio --version`. ```sh curio version 1.24.4+calibnet+git_f954c0a_2025-04-06T15:46:32-04:00 ``` -------------------------------- ### Lite Node Daemon Output Example Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/nodes/lite-nodes/spin-up-a-lite-node.md Example output when starting a lite node daemon. Note the repository path and potential warnings about API token limitations. ```plaintext 2023-01-26T11:18:54.251-0400 INFO main lotus/daemon.go:219 lotus repo: /Users/johnny/.lotus 2023-01-26T11:18:54.254-0400 WARN cliutil util/apiinfo.go:94 API Token not set and requested, capabilities might be limited ... ``` -------------------------------- ### Install Go on Ubuntu Source: https://github.com/filecoin-project/filecoin-docs/blob/main/networks-and-tools/networks/local-testnet/README.md Downloads and installs Go version 1.18.8 on Ubuntu. The installation path is /usr/local/go. ```shell wget -c https://golang.org/dl/go1.18.8.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local ``` -------------------------------- ### Fork, Clone, and Install Dependencies Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/filecoin-pin/dapp-demo.md Follow these commands to set up the project locally. Ensure you have Node.js 24+ and npm 9+ installed. This process involves forking the repository, cloning it, and installing necessary npm packages. ```bash # Fork the repo using the command below # or visit [https://github.com/filecoin-project/filecoin-pin-website/fork](https://github.com/filecoin-project/filecoin-pin-website/fork) gh repo fork filecoin-project/filecoin-pin-website git clone https://github.com/YOUR-USERNAME/filecoin-pin-website.git cd filecoin-pin-website npm install ``` -------------------------------- ### MsigGetVestingSchedule Response Example Source: https://github.com/filecoin-project/filecoin-docs/blob/main/reference/json-rpc/msig.md This is an example response from the MsigGetVestingSchedule method, detailing the initial balance, start epoch, and unlock duration. ```json { "InitialBalance": "0", "StartEpoch": 10101, "UnlockDuration": 10101 } ``` -------------------------------- ### Install Go (v1.24.0) Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/pdp/install-and-run-pdp.md Installs Go version 1.24.0. It removes any existing Go installation, downloads the specified version, extracts it to /usr/local, and updates the PATH environment variable. The Go version is then verified. ```sh sudo rm -rf /usr/local/go wget https://go.dev/dl/go1.24.0.linux-amd64.tar.gz sudo tar -C /usr/local -xzf go1.24.0.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc source ~/.bashrc go version ``` -------------------------------- ### Install Rust and Source Environment (Ubuntu) Source: https://github.com/filecoin-project/filecoin-docs/blob/main/networks-and-tools/networks/local-testnet/README.md Installs Rust using the official script and configures the current shell session to recognize the installation. ```shell curl https://sh.rustup.rs -sSf | sh -s -- -y source "$HOME/.cargo/env" ``` -------------------------------- ### Install Go on Ubuntu Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/nodes/lite-nodes/spin-up-a-lite-node.md Downloads and installs Go version 1.21.7 on Ubuntu and adds it to the system's PATH. ```shell wget https://go.dev/dl/go1.21.7.linux-amd64.tar.gz sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.21.7.linux-amd64.tar.gz echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc && source ~/.bashrc ``` -------------------------------- ### Setup Filecoin Pin Payments Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/filecoin-pin/getting-started.md Initiates the interactive payment setup process for Filecoin Pin. The CLI guides users through authorizing contracts and depositing USDFC. ```bash filecoin-pin payments setup ``` -------------------------------- ### Install Foundry Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/filecoin-pin/erc-8004-agent-registration.md Installs the Foundry Ethereum development toolkit. Ensure you have curl installed. ```bash curl -L https://foundry.paradigm.xyz | bash foundryup ``` -------------------------------- ### Install YugabyteDB Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/pdp/install-and-run-pdp.md Downloads, extracts, and performs post-installation setup for YugabyteDB version 2.25.1.0. ```bash wget https://software.yugabyte.com/releases/2.25.1.0/yugabyte-2.25.1.0-b381-linux-x86_64.tar.gz tar xvfz yugabyte-2.25.1.0-b381-linux-x86_64.tar.gz cd yugabyte-2.25.1.0 ./bin/post_install.sh ``` -------------------------------- ### Install Dependencies Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/advanced/contract-automation.md Navigate to the cloned template directory and install the necessary project dependencies using yarn. ```bash cd web3-functions-template && yarn install ``` -------------------------------- ### Install Lassie CLI Source: https://github.com/filecoin-project/filecoin-docs/blob/main/getting-started/how-retrieval-works/basic-retrieval.md Install the Lassie command-line tool using the Go package manager. Ensure Go is installed and GOPATH is set up. ```shell go install github.com/filecoin-project/lassie/cmd/lassie@latest ``` -------------------------------- ### Example Deployment Output Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/advanced/contract-automation.md This is an example of the output you can expect after successfully deploying a Web3 Function to IPFS. ```text ✓ Web3Function deployed to IPFS. ✓ CID: ``` -------------------------------- ### Install Lassie and go-car CLI Tools Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/retrieve-data.md Installs the command-line interface tools for Lassie and go-car using Go. Ensure Go is installed and your Go binary directory is on your PATH. ```shell go install github.com/filecoin-project/lassie/cmd/lassie@latest go install github.com/ipld/go-car/cmd/car@latest ``` -------------------------------- ### Install Ubuntu Dependencies Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/nodes/lite-nodes/spin-up-a-lite-node.md Installs essential software packages for building a lite node on Ubuntu. ```shell sudo apt update -y sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y ``` -------------------------------- ### Install Dependencies for Filecoin Docs Source: https://github.com/filecoin-project/filecoin-docs/blob/main/README.md Installs necessary dependencies to set up the local development environment for the Filecoin documentation. ```bash npm install ``` -------------------------------- ### Install Rust Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/pdp/install-and-run-pdp.md Installs Rust using the official installation script. It prompts the user to proceed with a standard installation. After installation, the environment is sourced and the Rust compiler version is verified. ```sh curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` ```sh source $HOME/.cargo/env rustc --version ``` -------------------------------- ### Build and Install Lotus Binaries (Calibration) Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/nodes/lite-nodes/spin-up-a-lite-node.md Compile the Lotus binaries specifically for the Calibration network and install them. ```shell make clean && make calibrationnet sudo make install ``` -------------------------------- ### Install Curio Binary Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/pdp/install-and-run-pdp.md Install the compiled Curio binary to your system. This command typically places the executable in /usr/local/bin. ```sh sudo make install ``` -------------------------------- ### Build and Install Lotus Binaries (Mainnet) Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/nodes/lite-nodes/spin-up-a-lite-node.md Compile the Lotus binaries for the Mainnet and install them system-wide. ```shell make clean all sudo make install ``` -------------------------------- ### Example: Retrieve and Extract Data Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/retrieve-data.md An example demonstrating how to fetch content using Lassie and pipe it to go-car for extraction, using a specific CID. ```shell lassie fetch -o - bafybeic56z3yccnla3cutmvqsn5zy3g24muupcsjtoyp3pu5pm5amurjx4 | car extract - ``` -------------------------------- ### Install Dependencies Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/development-frameworks/hardhat.md Install the project's dependencies using Yarn. ```shell yarn install ``` -------------------------------- ### Install jq on Ubuntu/Debian Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/filecoin-pin/erc-8004-agent-registration.md Installs the jq JSON processor using apt-get on Ubuntu/Debian systems. ```bash # Ubuntu/Debian sudo apt-get install jq ``` -------------------------------- ### Install Rust (macOS) Source: https://github.com/filecoin-project/filecoin-docs/blob/main/networks-and-tools/networks/local-testnet/README.md Installs Rust, the systems programming language, using the official installation script. This is a prerequisite for building certain Filecoin components. ```shell curl https://sh.rustup.rs -sSf | sh -s -- -y # ... # Rust is installed now. Great! # ... ``` -------------------------------- ### Build and Install Lotus Daemon for Mainnet Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/pdp/install-and-run-pdp.md Build and install the Lotus daemon for the mainnet. This command cleans previous builds, compiles the daemon, and installs it. ```sh make clean && make lotus sudo make install-daemon lotus --version ``` -------------------------------- ### Import Snapshot and Start Daemon Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/pdp/install-and-run-pdp.md Import a downloaded snapshot and start the Lotus daemon. This command imports the snapshot, removes any existing chain data, and halts after import. It then starts the daemon in the background. ```sh lotus daemon --import-snapshot snapshot.car.zst --remove-existing-chain --halt-after-import nohup lotus daemon > ~/lotus.log 2>&1 & ``` -------------------------------- ### Install OpenZeppelin Contracts Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/developing-contracts/solidity-libraries.md Install the OpenZeppelin contracts library using npm. This is the first step to using their pre-built smart contract templates. ```shell npm install @openzeppelin/contracts ``` -------------------------------- ### Build Contracts and Install Dependencies Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/development-frameworks/foundry.md Compile your Solidity contracts and install necessary npm packages for your project. ```shell forge build npm install ``` -------------------------------- ### Start the Lotus Daemon Source: https://github.com/filecoin-project/filecoin-docs/blob/main/getting-started/community/ways-to-contribute.md Use this command to start the Lotus daemon, which is the main implementation of Filecoin. ```shell lotus daemon ``` -------------------------------- ### Verify Curio Installation Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/pdp/install-and-run-pdp.md Check if Curio has been installed correctly by running the version command. This confirms the binary is accessible and reports its version. ```sh curio --version ``` -------------------------------- ### Install filecoin-solidity-api via npm Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/developing-contracts/call-built-in-actors.md Install the Filecoin Solidity API package using npm. This is the recommended method for importing the library into your project. ```shell npm install filecoin-solidity-api ``` -------------------------------- ### Install Ubuntu Dependencies Source: https://github.com/filecoin-project/filecoin-docs/blob/main/networks-and-tools/networks/local-testnet/README.md Installs essential development packages and libraries on Ubuntu using the apt package manager. ```shell sudo apt update -y sudo apt install mesa-opencl-icd ocl-icd-opencl-dev gcc git bzr jq pkg-config curl clang build-essential hwloc libhwloc-dev wget -y ``` -------------------------------- ### Install Filecoin Pin CLI Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/filecoin-pin/getting-started.md Install the Filecoin Pin CLI globally using npm. This command fetches the latest version. ```sh npm install -g filecoin-pin@latest ``` -------------------------------- ### Set Up Environment Variables Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/development-frameworks/hardhat.md Copy the example environment file and replace the placeholder private key with your actual private key. Be cautious with your private key. ```shell cp .env.example .env ``` ```shell PRIVATE_KEY=your_private_key_here ``` -------------------------------- ### Verify Lotus Installation (Mainnet) Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/nodes/lite-nodes/spin-up-a-lite-node.md Check the installed Lotus version to confirm successful Mainnet setup. ```shell lotus --version ``` -------------------------------- ### Create and Configure Environment File Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/development-frameworks/foundry.md Copy the example environment file and populate it with your private key and Calibration RPC URL. ```bash cp .env.example .env ``` ```bash PRIVATE_KEY=your_private_key_here CALIBRATIONNET_RPC_URL=https://api.calibration.node.glif.io/rpc/v1 ``` -------------------------------- ### Create a Test File Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/filecoin-pin/getting-started.md Create a simple text file named 'demo.txt' for testing purposes. ```sh echo "Hello Filecoin Pin @ $(date)!" > demo.txt ``` -------------------------------- ### Get Deal Term (Start and End Epochs) Source: https://github.com/filecoin-project/filecoin-docs/blob/main/reference/built-in-actors/protocol-api.md Returns the start and end epochs for a deal proposal identified by its CID. This indicates the active period of the deal. ```go func GetDealTerm(params GetDealTermParams) GetDealTermReturn {} ``` -------------------------------- ### Preview Existing Filecoin Docs Build Source: https://github.com/filecoin-project/filecoin-docs/blob/main/README.md Serves the pre-built static files from the `_book/` directory without performing a new build. ```bash npm run preview ``` -------------------------------- ### Get Chain Head Example Source: https://github.com/filecoin-project/filecoin-docs/blob/main/reference/json-rpc/README.md An example using Curl to retrieve the current chain head from a public Glif node. This demonstrates calling the `Filecoin.ChainHead` method with no parameters. ```APIDOC ## Filecoin.ChainHead ### Description Retrieves the current head of the Filecoin blockchain. This method does not require any input parameters. ### Method POST ### Endpoint `https://api.node.glif.io/rpc/v1` ### Parameters #### Request Body - **jsonrpc** (string) - Required - Specifies the JSON-RPC protocol version, typically "2.0". - **method** (string) - Required - The API method to call, which is "Filecoin.ChainHead". - **params** (array) - Required - An empty array `[]` as this method requires no parameters. - **id** (integer) - Required - A unique identifier for the request. ### Request Example ```json { "jsonrpc":"2.0", "id":1, "method":"Filecoin.ChainHead", "params":[] } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version. - **result** (object) - An object containing information about the chain head, including Cids and Blocks. - **id** (integer) - The identifier for the request. #### Response Example ```json { "jsonrpc": "2.0", "result": { "Cids": [ { "/": "bafy2bzaceayoigaf3v5muqmknpjfkguse43jp4t2zxhpmykhqynqhkdgpgybc" }, ... ], "Blocks": [ { "Miner": "f0693008", "Ticket": { "VRFProof": "uLR0LHfNBAfQzyYUVBiIEXzyblPv3yPIEsJQGTpaAvO1ZriPZ7wC2IFpw7mrz1RvDQEfsgRXGxb6APTRvrPiFEAe35RFNLKC9SYb64PNcDYwGY4de5LdlHfyUv+Ovwg5" } }, ... } }, "id": 1 } ``` ``` -------------------------------- ### Interact with Deployed Contract Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/development-frameworks/hardhat.md Interact with a deployed contract, for example, by getting the balance of the 'simple-coin' contract. Ensure CONTRACT_ADDRESS and ACCOUNT_ADDRESS are set. ```shell export CONTRACT_ADDRESS=0xYourDeployedSimpleCoinAddress export ACCOUNT_ADDRESS=0xYourEthereumStyleAccountAddress yarn hardhat get-balance --contract "$CONTRACT_ADDRESS" --account "$ACCOUNT_ADDRESS" ``` -------------------------------- ### Filecoin Smart Contract to Ethereum Address Example Source: https://github.com/filecoin-project/filecoin-docs/blob/main/core-concepts/filecoin-evm-runtime/address-types.md Demonstrates the conversion between a Filecoin smart contract address (starting with t410) and its corresponding Ethereum address. ```plaintext # A Filecoin smart contract address. t410fl5qeigmkcytz7b6sqoojtcetqwf37dm4zv4aijq # The corresponding Ethereum smart contract address. 0x5f6044198a16279f87d2839c998893858bbf8d9c ``` -------------------------------- ### Example Data Set Details Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/filecoin-pin/getting-started.md An example output showing the details of a live Filecoin data set, including status, pieces, and payment information. ```text Data Set #279 • live Managed by Warm Storage: yes Pieces stored: 2 Total size: 672.0 B PDP rail ID: 631 Payer: 0xYOUR_WALLET_ADDRESS Payee: 0xPROVIDER_ADDRESS Provider Provider: (ID ) Provider Service Service URL: https:// Min proving period: 30 epochs Pieces #0 CommP: bafkzcib... Root CID: bafybei... ``` -------------------------------- ### Start Lotus Miner Source: https://github.com/filecoin-project/filecoin-docs/blob/main/storage-providers/nodes/full-nodes/basic-setup.md Initiates the Lotus miner process, enabling participation in the Filecoin mining process. This command is optional and should also be run from the Lotus installation directory. ```sh ./lotus-miner run ``` -------------------------------- ### Get Block Information via JSON-RPC Source: https://github.com/filecoin-project/filecoin-docs/blob/main/networks-and-tools/networks/mainnet/explorers.md This cURL command fetches details for a specific block using its CID from a Filecoin node's RPC. Replace the example CID with the desired block's identifier. ```shell curl --location --request POST 'https://api.node.glif.io/rpc/v1' \ --header 'Content-Type: application/json' \ --data-raw '{ "jsonrpc":"2.0", "method":"Filecoin.ChainGetBlock", "params": [{"/": "bafy2bzacebpgpa7elb5uwqxbiljlzgbmpenv4yw2e3gpcjk7ssxv2ijv3ecv2"}], "id":1 }' | jq ``` -------------------------------- ### Navigate to libs directory Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/developing-contracts/call-built-in-actors.md Move into the newly created 'libs' directory. ```shell cd libs ``` -------------------------------- ### Start Client Node Daemon Source: https://github.com/filecoin-project/filecoin-docs/blob/main/networks-and-tools/networks/local-testnet/README.md Initiate the client node daemon with specific genesis and template configurations. This command should be left running in its terminal. ```shell ./lotus daemon --lotus-make-genesis=devgen.car --genesis-template=localnet.json --bootstrap=false ``` -------------------------------- ### Install Goldsky CLI Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/advanced/fevm-indexers.md Installs the Goldsky CLI tool. Ensure you have curl installed. ```shell curl https://goldsky.com | sh ``` -------------------------------- ### Check Xcode Installation (macOS) Source: https://github.com/filecoin-project/filecoin-docs/blob/main/networks-and-tools/networks/local-testnet/README.md Confirm that Xcode command-line tools are installed on your macOS system. If not, instructions are provided to install Xcode. ```shell xcode-select -p # /Library/Developer/CommandLineTools ``` -------------------------------- ### Configure Private Key using .env file Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/filecoin-pin/getting-started.md Set up your private key for the Filecoin Pin CLI by creating and sourcing a .env file. Ensure the .env file is added to .gitignore and has restricted permissions. ```sh export PRIVATE_KEY="0xYOUR_PRIVATE_KEY_HERE" ``` ```sh printf '.env\n' >> .gitignore chmod 600 .env source .env ``` -------------------------------- ### Serve Filecoin Docs Locally Source: https://github.com/filecoin-project/filecoin-docs/blob/main/README.md Builds and serves the Filecoin documentation site with live reload enabled. The default port is 4000. ```bash npm run serve ``` -------------------------------- ### Install jq on macOS Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/cookbook/filecoin-pin/erc-8004-agent-registration.md Installs the jq JSON processor using Homebrew on macOS. ```bash # macOS brew install jq ``` -------------------------------- ### Build Static Filecoin Docs Site Source: https://github.com/filecoin-project/filecoin-docs/blob/main/README.md Builds the static version of the Filecoin documentation, outputting the files to the `_book/` directory. ```bash npm run build ``` -------------------------------- ### Deploy DealClient Contract to Calibrationnet Source: https://github.com/filecoin-project/filecoin-docs/blob/main/build/development-frameworks/foundry.md Deploy the example DealClient contract to the Filecoin Calibration testnet using your private key and RPC URL. Record the deployed address for future interactions. ```shell forge create \ --rpc-url "$CALIBRATIONNET_RPC_URL" \ --private-key "$PRIVATE_KEY" \ --broadcast \ src/basic-deal-client/DealClient.sol:DealClient ``` -------------------------------- ### Install macOS Dependencies Source: https://github.com/filecoin-project/filecoin-docs/blob/main/networks-and-tools/networks/local-testnet/README.md Installs necessary development tools and libraries on macOS using Homebrew. ```shell brew install go bzr jq pkg-config hwloc coreutils ``` -------------------------------- ### Filecoin EVM Gas Fee Calculation Example Source: https://github.com/filecoin-project/filecoin-docs/blob/main/core-concepts/filecoin-evm-runtime/how-gas-works.md An example demonstrating the step-by-step calculation of the total gas fee using provided gas parameters: GasUsage, BaseFee, GasLimit, and GasPremium. ```plaintext 1000 x 20 = 20000 2000 x 5 = 10000 20000 + 10000 = 30000 attoFIL ``` -------------------------------- ### MsigGetPending Response Example Source: https://github.com/filecoin-project/filecoin-docs/blob/main/reference/json-rpc/msig.md This is an example response from the MsigGetPending method, showing a pending transaction with its details. ```json [ { "ID": 9, "To": "f01234", "Value": "0", "Method": 1, "Params": "Ynl0ZSBhcnJheQ==", "Approved": ["f01234"] } ] ```