Update, upgrade, clean the system, and apply firewall management (ufw).
# Update, upgrade and clean systemsudoaptupdate-y&&sudoaptupgrade-y&&sudoaptauto-remove-y
# Set explicit default UFW rulessudoufwdefaultdenyincoming&&sudoufwdefaultallowoutgoing# Allow SSH, HTTP and HTTPSsudoufwallow22/tcpsudoufwallow80sudoufwallow443
Install Docker & Docker Compose
The following code will install Docker & Docker Compose, both are necessary requirements to run Blast.
# Add Docker's official GPG key:sudoapt-getupdatesudoapt-getinstallca-certificatescurlsudoinstall-m0755-d/etc/apt/keyringssudocurl-fsSLhttps://download.docker.com/linux/ubuntu/gpg-o/etc/apt/keyrings/docker.ascsudochmoda+r/etc/apt/keyrings/docker.asc# Add the repository to Apt sources:echo \"deb [arch=$(dpkg--print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(./etc/os-release&&echo "$VERSION_CODENAME") stable"| \sudotee/etc/apt/sources.list.d/docker.list>/dev/nullsudoapt-getupdate# Install Docker Packagessudoapt-getinstalldocker-cedocker-ce-clicontainerd.iodocker-buildx-plugindocker-compose-plugin# Verify Docker Installation is Successfulsudodockerrunhello-world# Install Docker-Composesudoapt-getupdatesudoapt-getinstalldocker-compose-plugin# Verify Docker-Compose installation by checking the versiondockercomposeversion# Expected outputDockerComposeversionvN.N.N
Create Blast Directory
The command "mkdir blast" will create a directory named "blast" within your current working directory. The second command will alter your current working directory to the newly created "blast" directory.
mkdirblast&&cdblast
Clone Blast-IO Deployment Repository
The Blast deployment repository contains the necessary Docker Compose Configurations. We will obtain the Deployment repository while within our "blast" directory.
The commands "git clone git@github.com:blast-io/deployment.git" or
"git clone https://github.com/blast-io/deployment.git" will download the repository.
The command "cd deployment" will change your current working directory to the deployment directory.
# Download Deployment Repository using SSHgitclonegit@github.com:blast-io/deployment.gitcddeployment# If you receive errors running "git clone git@github.com:blast-io/deployment.git"# You can download it this way insteadgitclonehttps://github.com/blast-io/deployment.gitcddeployment
Create .env file
sudonano.env
Paste the following into your newly created .env file.
# NETWORK should be mainnet or sepoliaNETWORK={YOUR_NETWORK}# Set to either mainnet or sepoliaGETH_DATA_DIR=blast-get-data# The path where you want to store blockchain dataL1_RPC_URL={YOUR_RPC_ENDPOINT_URL}# L1 node RPC endpoint URLL1_RPC_KIND={YOUR_RPC_KIND}# Type of RPC provider (alcehmy, infura, any, etc)OP_NODE_L1_BEACON={YOUR_L1_BEACON_API}# Your L1 Beacon api endpoint
Start Docker Containers
dockercomposeup-d
This pulls the latest version of the pre-built Docker images and starts the necessary containers.
Query Blast Node
curl-H"Content-Type: application/json"-XPOST--data'{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'http://localhost:8545# The response should resemble the following:{"jsonrpc":"2.0","id":1,"result":"0xcab5ab"}