How to Run Binance Smart Chain Full Node Via Docker

Posted By : Kapil

Jun 30, 2021

What is Binance Smart Chain

Running a Binance Smart Chain full node is a very tricky and tedious task, but don't worry, I will make this task simple for you. But before jumping Into that let's talk about what is Binance smart chain. In the world of blockchain, Binance smart chain is a dual chain architecture that gives power to you to build your decentralized apps and digital assets on one blockchain while also taking the benefits of the fast trading performance offered on Binance DEX (decentralized exchange).

So the Binance smart chain offers one of the fastest blockchain transaction times and the minimum transaction fee structure. that's why building a decentralized finance app using Binance smart-chain is a good option and that's the reason now day's many developers are attracted to the blockchain smart-chain.

 

 

 

 

 

 

 

 

 

 

 

 

Why Binance Smart Chain

The main purpose of the Binance smart chain is that our Assets are not sent to any exchange or wallet that is controlled by a single platform. Instead, the order book and transactions take place on the blockchain. So There are no middleman fees, only network costs, and users are fully and solely in control of their assets.

so now In this blog, I will show you a Step by Step guide on How to Run Binance Smart Chain Full Node Via Docker.

Prerequisites:

The minimum requirement is to run the full node.

  • Make sure you have docker installed on your system.
  • Make Sure your machine is running on recent versions of Linux.
  • 1TB of free disk space and make sure it is a solid-state drive.
  • 8 cores of CPU & 16 GB of RAM.
  • A Good Internet connection with at least 1 megabyte per second of upload/download speeds.

Step 1: Create a Docker File

 

Dockerfile

FROM ubuntu:latest

# Update the image to the latest packages
RUN apt-get update && apt-get upgrade -y
RUN apt-get install vim -y && apt-get install git -y && \
    apt-get install curl -y && \
    apt-get install wget -y && \
    apt-get install unzip

# Define working directory.
WORKDIR /var/binance/

# Installing Go Lang
RUN wget https://golang.org/dl/go1.16.5.linux-amd64.tar.gz && \
    tar -C /usr/local -xzf go1.16.5.linux-amd64.tar.gz
RUN export PATH=$PATH:/usr/local/go/bin

# downloading the pre-build binaries
RUN wget https://github.com/binance-chain/bsc/releases/download/v1.1.0-beta/geth_linux && \
    chmod +x geth_linux

# Download genesis.json and config.toml and Writing the genesis state locally
RUN wget https://github.com/binance-chain/bsc/releases/download/v1.1.0-beta/mainnet.zip && \
    unzip mainnet.zip &&\
    ./geth_linux --datadir node init genesis.json

# start a full node
CMD ./geth_linux --config ./config.toml --datadir ./node  --cache 18000 --rpc.allow-unprotected-txs --txlookuplimit 0

 

Step 2: Create a docker-compose

  • I have created a docker-compose file you can simply copy this code and paste it into the new file.

 

docker-compose.yml

version: '3'
services:
    binance:
      build: .
      container_name: binance-node
      volumes:
        - data:/var/binance/node
      ports:
        - 80:80
      networks:
        - net

          
volumes:
  data:
networks:
   net:
     driver: bridge

 

After creating Dockerfile and docker-compose your file structure is look like this now simply start the docker container.

Now after started the docker container, check your node syncing. and also verified the highest block with Binance Explorer. In our case our node syncing is perfectly started, Yeah we did it cheers.

Thanks for reading our blog, Have a great day.

 

 

Leave a

Comment

Name is required

Invalid Name

Comment is required

Recaptcha is required.

blog-detail

November 21, 2024 at 11:34 am

Your comment is awaiting moderation.

By using this site, you allow our use of cookies. For more information on the cookies we use and how to delete or block them, please read our cookie notice.

Chat with Us
Telegram Button
Youtube Button

Contact Us

Oodles | Blockchain Development Company

Name is required

Please enter a valid Name

Please enter a valid Phone Number

Please remove URL from text