Install from release

You can install from release, it offers some releases for 3 main operating system.

Examples:

  • bytom-1.0.3-darwin_386.tgz
  • bytom-1.0.3-darwin_amd64.tgz
  • bytom-1.0.3-linux_386.tgz
  • bytom-1.0.3-linux_amd64.tgz
  • bytom-1.0.3-windows_386.zip
  • bytom-1.0.3-windows_amd64.zip

Install from source

Requirements

  • Go version 1.8 or higher, with $GOPATH set to your preferred directory

Installation

Ensure Go with the supported version is installed properly:

$ go version
$ go env GOROOT GOPATH

Get the source code

$ git clone https://github.com/Bytom/bytom.git $GOPATH/src/github.com/bytom

Build

$ cd $GOPATH/src/github.com/bytom
$ make bytomd    # build bytomd
$ make bytomcli  # build bytomcli

When successfully building the project, the bytom and bytomcli binary should be present in cmd/bytomd and cmd/bytomcli directory, respectively.

Running in Docker

Build the image

docker build -t bytom .

Init bytom

docker run -v <Bytom/data/directory/on/host/machine>:/root/.bytom bytom:latest bytomd init --chain_id <chainId>

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

  • Mac: ~/Library/Bytom
  • Linux: ~/.bytom
  • Windows: %APPDATA%\Bytom

Enter the iterative mode

docker run -it -p 9888:9888 -v <Bytom/data/directory/on/host/machine>:/root/.bytom bytom:latest

Then you can use bytomd and bytomcli following Readme

Use exit to exit Docker's iterative mode

Daemon mode

For example,

docker run -d -p 9888:9888 -v <Bytom/data/directory/on/host/machine>:/root/.bytom bytom:latest bytomd node --web.closed --auth.disable

To list the running containners and check their container id, image, corresponding command, created time, status, name and ports being used:

docker container ls

or

docker ps

To execute a command inside a containner, for example:

docker exec -it <containerId> bytomcli create-access-token <tokenId>

To stop a running containner:

docker stop <containerId>

To remove a containner:

docker rm <containerId>