Microservices and containers are quite popular at present. I believe many friends are familiar with Docker. If you are not familiar with it, you can check the docker learning manual. How to use Docker to build the node of Bytom?

Before the operation, install the Docker yourself. Then enter CMD on your terminal (Windows) :

docker
Copy the code

You have installed docker successfully:

Get the Docker image of ByTom

docker pull bytom/bytom:latest


Copy the code

Use Docker Images to view your downloaded ByTom images

docker images


Copy the code

Then the following image appears to indicate that the image has been obtained:

Initialize:

Docker run -v < Bytom/data/directory/on/host/machine > : /root/.byTom Bytom: latest bytomd init --chain_id < chainId >Copy the code

The default Bytom data directory (on the host) is:

Mac: ~ / Library/Bytom

Linux: ~ /. Bytom

Windows: % APPDATA % \ Bytom

ChainId has three options:

Mainnet: Connects to the main network

Testnet: Connects to the test network

Solonet: single node

The following is an example (MAC /testnet) :

docker run -v ~/Library/Bytom:/root/.bytom bytom/bytom:latest bytomd init --chain_id testnet


Copy the code

# Enable Docker terminal interaction mode:

docker run -it -p 9888:9888 -v ~/Library/Bytom:/root/.bytom bytom/bytom:latest


Copy the code

# enable daemon mode:

docker run -d -p 9888:9888 -v ~/Library/Bytom:/root/.bytom bytom/bytom:latest bytomd node --web.closed --auth.disable
Copy the code

View a running container:

docker ps
Copy the code

Here we can see the container we are running:

Finally in the browser request: http://0.0.0.0:9888, you can view our wallet.