diff --git a/doc/build-from-source.md b/doc/build-from-source.md index 67751fe82..d7701a445 100644 --- a/doc/build-from-source.md +++ b/doc/build-from-source.md @@ -1,5 +1,7 @@ # Build From Source +## Install Go SDK + Go to the Go official website to download the Go SDK . An example installation looks like this: @@ -28,12 +30,18 @@ Make sure your `go` is successfully installed: go version ``` +## Install go-sqlite + If you need to use go-sqlite, you will need to enable CGO first: ``` CGO_ENABLED=1 go get github.com/mattn/go-sqlite3 ``` +## Install + +### Install bbgo via go install + Install bbgo: ```sh @@ -64,6 +72,34 @@ export GOPATH=~/mygo Then your bbgo will be installed at `~/mygo/bin/bbgo`. +### Install via git clone + +```shell +mkdir -p ~/go/src/github.com/c9s +git clone git@github.com:c9s/bbgo.git ~/go/src/github.com/c9s/bbgo +cd ~/go/src/github.com/c9s/bbgo +go mod download +``` + +And then you should be able to run bbgo with `go run` + +```shell +go run ./cmd/bbgo run +``` + +You can also use the makefile to build bbgo: + +```shell +cd frontend && yarn install +make bbgo +``` + +If you don't need the web interface, you can build the slim version of bbgo: + +```shell +make bbgo-slim +``` + ## Build inside a Alpine container Starts a docker container with the alpine image: