### Start PostgreSQL Server Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide Starts the PostgreSQL database server using either the `pg_ctl` command or Homebrew services, depending on the system setup. ```shell pg_ctl -D /usr/local/var/postgres start # or brew services start postgresql ``` -------------------------------- ### Install Libtool on Linux Source: https://docs.blockscout.com/setup/requirements/requirements Provides an example installation script for Libtool on Linux. This script is part of a Blockscout deployment setup and ensures Libtool is correctly installed. ```bash # Example from blockscout-terraform # ... other setup commands ... # Install Libtool sudo apt-get update sudo apt-get install -y libtool # ... other setup commands ... ``` -------------------------------- ### Install Automake on Linux Source: https://docs.blockscout.com/setup/requirements/requirements Provides an example installation script for Automake on Linux. This script is part of a Blockscout deployment setup and ensures Automake is correctly installed. ```bash # Example from blockscout-terraform # ... other setup commands ... # Install Automake sudo apt-get update sudo apt-get install -y automake # ... other setup commands ... ``` -------------------------------- ### Install and Configure ASDF for Runtimes Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide/ubuntu-setup Installs the ASDF version manager and adds plugins for Erlang, Elixir, and Node.js. It also guides through updating the profile to make ASDF available and installs additional prerequisites for these runtimes. ```bash git clone https://github.com/asdf-vm/asdf.git ~/.asdf nano .profile . $HOME/.asdf/asdf.sh source ~/.profile asdf version asdf plugin add erlang asdf plugin add elixir asdf plugin add nodejs sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk ``` -------------------------------- ### Install and Run Prometheus Source: https://docs.blockscout.com/setup/configuration-options/untitled-2 Steps to install Prometheus using Homebrew, start the BlockScout Elixir server, and launch the Prometheus server with a specified configuration file. ```shell brew install prometheus ``` ```elixir iex -S mix phx.server ``` ```shell prometheus --config.file=prometheus.yml ``` -------------------------------- ### Install Postgres on Linux Source: https://docs.blockscout.com/setup/requirements/requirements Provides an example installation script for PostgreSQL on Linux. This script is part of a Blockscout deployment setup and ensures the correct PostgreSQL version is installed. ```bash # Example from blockscout-terraform # ... other setup commands ... # Install PostgreSQL sudo apt-get update sudo apt-get install -y postgresql # ... other setup commands ... ``` -------------------------------- ### Install Erlang on Linux Source: https://docs.blockscout.com/setup/requirements/requirements Provides an example installation script for Erlang/OTP on Linux. This script is part of a Blockscout deployment setup and ensures Erlang is correctly installed. ```bash # Example from blockscout-terraform # ... other setup commands ... # Install Erlang/OTP curl -fsSL https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb | sudo dpkg -i - sudo apt-get update sudo apt-get install -y esl-erlang # ... other setup commands ... ``` -------------------------------- ### Install Rustup and Cargo Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide/ubuntu-setup Installs Rustup, the toolchain installer for Rust, and Cargo, the Rust package manager. This is a prerequisite for compiling the Blockscout backend. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### Install Elixir on Linux Source: https://docs.blockscout.com/setup/requirements/requirements Provides an example installation script for Elixir 1.15.x on Linux. This script is part of a Blockscout deployment setup and ensures Elixir is correctly installed. ```bash # Example from blockscout-terraform # ... other setup commands ... # Install Elixir wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb \ && sudo dpkg -i erlang-solutions_2.0_all.deb \ && rm erlang-solutions_2.0_all.deb sudo apt-get update sudo apt-get install -y elixir # ... other setup commands ... ``` -------------------------------- ### Blockscout LLM Installation Parameters Source: https://docs.blockscout.com/setup/deployment/ansible-deployment/aws-marketplace/aws-marketplace-installation Provides a comprehensive list of installation parameters for Blockscout LLM. Each parameter includes its purpose, expected value format, constraints, and usage examples. This documentation is crucial for setting up the application correctly. ```APIDOC Stack Name: Description: An identifier for the stack, used to find it in a list of stacks. Constraints: Must start with an alphabetic character and cannot be longer than 128 characters. Example: "my-blockscout-stack" ARNCertificate: Description: SSL certificate ARN from AWS Certificate Manager (ACM). Reference: https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html Example: "arn:aws:acm:us-east-1:123456789012:certificate/1156aa0c-daa3-4cb1-af6d-6f16202ebf2c" CognitoCallbackDomain: Description: Domain(s) where Blockscout will be accessed, with "oauth2/idpresponse" appended. Leave blank if no domain is set; it will be populated by the LoadBalancerDNS. Example: "https://your.domain/oauth2/idpresponse" CognitoUserEmail: Description: An email address to receive a temporary password after deployment. Example: "youremail@email.com" DBPassword: Description: A secure password for database access. Constraints: Must contain only letters and numbers, and be 8 characters or more. Record this password. Example: "SecureP@ssw0rd123" EthereumJsonRPCHttpURL: Description: The HTTP URL of the Ethereum node used for fetching blocks, transactions, receipts, and tokens. Example: "http://node.ip.address:8545" EthereumJsonRPCTraceURL: Description: The URL for fetching internal transactions and block traces. Typically the same as EthereumJsonRPCHttpURL. Example: "http://node.ip.address:8545" EthereumJsonRPCWsURL: Description: The WebSocket RPC endpoint for the Ethereum network. Example: "ws://localhost:8545" GraphiQLTransaction: Description: A transaction hash used to provide a sample query in the GraphiQL Playground. Constraints: Must begin with "0x…". Example: "0x9415741aa80cacb3e2a9f48506010a3f31fddc7e7a00421381b4e4679d5eba20" ``` -------------------------------- ### Install and Configure Grafana Source: https://docs.blockscout.com/setup/configuration-options/untitled-2 Instructions for installing Grafana via Homebrew, adding the Pie Chart panel plugin using the Grafana CLI, and starting the Grafana service. ```shell brew install grafana ``` ```shell grafana-cli plugins install grafana-piechart-panel ``` ```shell brew services start grafana ``` -------------------------------- ### Install Core Prerequisites with Homebrew Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide/macos-setup Installs essential development tools like Node.js, nvm, and build utilities using Homebrew. These are foundational for subsequent steps. ```sh brew update brew install node brew install nvm brew install automake brew install libtool brew install gcc brew install gmp ``` -------------------------------- ### Install and Manage PostgreSQL-14 Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide/macos-setup Installs PostgreSQL version 14 using Homebrew and starts the database service. This ensures a local database is available for Blockscout. ```sh brew install postgresql@14 brew services start postgresql@14 ``` -------------------------------- ### Install Node.js on Linux Source: https://docs.blockscout.com/setup/requirements/requirements Provides an example installation script for Node.js (version 18.x.x) on Linux. This script is part of a Blockscout deployment setup and ensures Node.js is correctly installed. ```bash # Example from blockscout-terraform # ... other setup commands ... # Install Node.js curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt-get install -y nodejs # ... other setup commands ... ``` -------------------------------- ### Install GCC Compiler on Linux Source: https://docs.blockscout.com/setup/requirements/requirements Provides an example installation script for the GCC compiler on Linux. This script is part of a Blockscout deployment setup and ensures GCC is correctly installed. ```bash # Example from blockscout-terraform # ... other setup commands ... # Install GCC Compiler sudo apt-get update sudo apt-get install -y gcc # ... other setup commands ... ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide/macos-setup Clones the Blockscout backend repository, navigates into the directory, and installs project-specific Erlang, Elixir, and Node.js versions using asdf. ```sh git clone https://github.com/blockscout/blockscout blockscout-backend cd blockscout-backend asdf install ``` -------------------------------- ### Install Ubuntu System Requirements Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide/ubuntu-setup Installs essential system packages required for Blockscout and its dependencies. This includes tools like git, make, g++, libudev-dev, and libraries for GMP and build essentials. ```bash sudo apt-get update sudo apt-get install inotify-tools && sudo apt install make && sudo apt install g++ sudo apt-get install libudev-dev zip unzip build-essential cmake -y sudo apt-get install git \ automake \ libtool inotify-tools \ libgmp-dev \ libgmp10 \ build-essential \ cmake -y ``` -------------------------------- ### Install GMP Devel on Linux Source: https://docs.blockscout.com/setup/requirements/requirements Provides an example installation script for GMP development files on Linux. This script is part of a Blockscout deployment setup and ensures GMP is correctly installed. ```bash # Example from blockscout-terraform # ... other setup commands ... # Install GMP Devel sudo apt-get update sudo apt-get install -y libgmp-dev # ... other setup commands ... ``` -------------------------------- ### Clone Blockscout and Install ASDF Dependencies Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide/ubuntu-setup Clones the Blockscout backend repository and installs the Erlang, Elixir, and Node.js versions specified in the repository's `.tool-versions` file using ASDF. ```bash git clone https://github.com/blockscout/blockscout blockscout-backend cd blockscout-backend asdf install ``` -------------------------------- ### Clone Blockscout Repository Source: https://docs.blockscout.com/setup/deployment/manual-old-ui Initializes the deployment by cloning the Blockscout project from its GitHub repository. This is the first step to obtain the project files. ```shell git clone https://github.com/blockscout/blockscout ``` -------------------------------- ### Navigate to Frontend Directory Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide Changes the current working directory to the newly cloned 'blockscout-frontend' directory. All subsequent commands for setup and execution should be run from within this directory. ```shell cd blockscout-frontend ``` -------------------------------- ### Run Frontend Development Server Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide Starts the frontend development server, typically using Next.js. This command compiles the frontend code and makes it available at a specified local address, usually http://localhost:3000, allowing for live development and testing. ```shell yarn dev ``` -------------------------------- ### Install Make and G++ Compiler (Debian 9) Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide Provides specific commands for installing the 'make' utility and the G++ compiler on Debian 9 systems, which are crucial for the build process. ```shell # Debian 9 - Install Make sudo apt install make ``` ```shell # Debian 9 - Install G++ Compiler sudo apt install g++ ``` -------------------------------- ### Create and Migrate Database Source: https://docs.blockscout.com/setup/deployment/manual-old-ui Initializes the application's database by creating the necessary tables and applying migrations. This ensures the database schema is up-to-date with the application's requirements. ```shell mix do ecto.create, ecto.migrate ``` -------------------------------- ### Example ERC-1155 Token Transfer Request Source: https://docs.blockscout.com/devs/apis/rpc/account An example GET request URL to fetch ERC-1155 token transfer events from the Blockscout API. ```javascript https://instance_base_url/api ?module=account &action=token1155tx &address={addressHash} &page=1 &offset=10 &sort=asc ``` -------------------------------- ### Install Libtool Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide Installs Libtool, a library-building tool that simplifies the process of creating and managing shared libraries. Includes installation commands for macOS and Linux. ```shell brew install libtool ``` ```shell # Linux Install Example (referencing script) # Example command might look like: # sudo apt-get install libtool ``` -------------------------------- ### Install PostgreSQL 14 on Ubuntu Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide/ubuntu-setup Installs PostgreSQL version 14 on Ubuntu using the official PostgreSQL APT repository. This involves adding the GPG key, configuring the repository source, updating package lists, and installing the postgresql-14 package. ```bash curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' sudo apt update sudo apt install postgresql-14 sudo systemctl status postgresql ``` -------------------------------- ### Install asdf for Version Management Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide/macos-setup Installs the asdf version manager via Homebrew and adds plugins for Erlang, Elixir, and Node.js to manage different language versions. ```sh brew install asdf asdf plugin add erlang asdf plugin add elixir asdf plugin add nodejs ``` -------------------------------- ### Install Node.js Dependencies and Build Assets Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide Installs Node.js dependencies for frontend assets and builds them using Webpack for production. This involves navigating into specific directories. ```shell cd apps/block_scout_web/assets; npm install && node_modules/webpack/bin/webpack.js --mode production; cd - cd apps/explorer && npm install; cd - ``` -------------------------------- ### Python Requests Example Source: https://docs.blockscout.com/devs/integrate-merits Illustrates how to fetch partner balance information using the Python 'requests' library. This example demonstrates making a GET request and handling the JSON response. ```Python import requests response = requests.get( "https://merits-staging.blockscout.com/partner/api/v1/balance", headers={"Accept":"*/*"}, ) data = response.json() ``` -------------------------------- ### Install Elixir 1.15.x Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide Installs Elixir version 1.15.x, essential for developing and running Elixir-based components of the project. Includes instructions for macOS and Linux. ```shell brew install elixir ``` ```shell # Linux Install Example (referencing script) # Example command might look like: # apt-get install elixir # Or using a version manager like asdf: # asdf install elixir 1.15.x ``` -------------------------------- ### OpenAPI: GET /main-page/blocks Endpoint Source: https://docs.blockscout.com/api-reference/get-main-page-blocks Defines the GET endpoint for retrieving a list of blocks from the Blockscout API. It includes server URLs for various networks and a detailed schema for the Block object, along with an example response. ```APIDOC paths: path: /main-page/blocks method: get servers: - url: https://eth.blockscout.com/api/v2/ description: Ethereum mainnet - url: https://optimism.blockscout.com/api/v2/ description: Optimism mainnet - url: https://base.blockscout.com/api/v2/ description: Base mainnet - url: https://eth-sepolia.blockscout.com/api/v2/ description: Ethereum testnet request: security: [] parameters: path: {} query: {} header: {} cookie: {} body: {} response: '200': application/json: schemaArray: - type: array items: allOf: - $ref: '#/components/schemas/Block' examples: example: value: - base_fee_per_gas: '26618801760' burnt_fees: '261263193229977120' burnt_fees_percentage: 85.19028810863084 difficulty: '0' extra_data: TODO gas_limit: '30000000' gas_target_percentage: -34.56675333333333 gas_used: '9814987' gas_used_percentage: 32.71662333333333 hash: >- 0xf569ec751152b2f814001fc730f7797aa155e4bc3ba9cb6ba24bc2c8c9468c1a height: 17615720 miner: hash: '0xEb533ee5687044E622C69c58B1B12329F56eD9ad' implementation_name: implementationName name: contractName ens_domain_name: domain.eth metadata: slug: tag_slug name: Tag name tagType: name ordinal: 0 meta: {} is_contract: true private_tags: - address_hash: '0xEb533ee5687044E622C69c58B1B12329F56eD9ad' display_name: name to show label: label watchlist_names: - display_name: name to show label: label public_tags: - address_hash: '0xEb533ee5687044E622C69c58B1B12329F56eD9ad' display_name: name to show label: label is_verified: true nonce: '0x0000000000000000' parent_hash: >- 0xd464e02d81e2bdf6bc5fa9b8e33f0b564c464a82d821a3e56531f8636dc00dfa priority_fee: '45418705646601378' rewards: - reward: 123 type: >- Miner Reward | Emission Reward | Chore Reward | Uncle Reward size: 49997 state_root: TODO timestamp: '2023-07-03T20:09:59.000000Z' total_difficulty: '58750003716598352816469' transaction_count: 120 transaction_fees: '306681898876578498' type: block uncles_hashes: - >- 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 withdrawals_count: 16 description: blocks deprecated: false type: path components: schemas: Block: type: object required: - base_fee_per_gas - burnt_fees - burnt_fees_percentage - difficulty - extra_data - gas_limit - gas_target_percentage - gas_used - gas_used_percentage - hash - height - miner - nonce - parent_hash - priority_fee - rewards - size - state_root - timestamp - total_difficulty - transaction_count - transaction_fees - type - uncles_hashes - withdrawals_count properties: base_fee_per_gas: type: string example: '26618801760' burnt_fees: type: string example: '261263193229977120' burnt_fees_percentage: type: number example: 85.19028810863084 difficulty: type: string example: '0' extra_data: type: string example: TODO gas_limit: type: string example: '30000000' gas_target_percentage: type: number example: -34.56675333333333 gas_used: type: string example: '9814987' gas_used_percentage: type: number example: 32.71662333333333 hash: type: string example: '0xf569ec751152b2f814001fc730f7797aa155e4bc3ba9cb6ba24bc2c8c9468c1a' height: type: integer example: 17615720 miner: $ref: '#/components/schemas/AddressParam' nonce: type: string ``` -------------------------------- ### Install GCC Compiler Source: https://docs.blockscout.com/setup/deployment/manual-deployment-guide Installs the GNU Compiler Collection (GCC), a fundamental tool for compiling C, C++, and other languages. Provides installation commands for macOS and Linux. ```shell brew install gcc ``` ```shell # Linux Install Example (referencing script) # Example command might look like: # sudo apt-get install build-essential ``` -------------------------------- ### Install Catapulta CLI Source: https://docs.blockscout.com/devs/verification/automate-verifications-catapulta Installs the Catapulta command-line interface globally using npm. This is the primary method to get the tool on your Linux or macOS machine, enabling subsequent deployment and verification commands. ```sh npm i -g catapulta ``` -------------------------------- ### Install Rust on Linux Source: https://docs.blockscout.com/setup/requirements/requirements Provides a link to the official installation guide for Rust on Linux. Rust is a systems programming language that may be required for older Blockscout versions. ```shell curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ```