@@ -28,18 +28,16 @@ See [instructions](./docker/README.md)
## Building from Source
<ol>
<li>Install [Go environment](https://golang.org/doc/install). The installation instructions below are for Go 1.16 and newer.</li>
1. Install [Go environment](https://golang.org/doc/install). The installation instructions below are for Go 1.16 and newer.
<li>OPTIONAL only if you intend to modify the code: Install [protobuf](https://developers.google.com/protocol-buffers/) and [gRPC](https://grpc.io/docs/languages/go/quickstart/) including [code generator](https://developers.google.com/protocol-buffers/docs/reference/go-generated) for Go.</li>
2.OPTIONAL only if you intend to modify the code: Install [protobuf](https://developers.google.com/protocol-buffers/) and [gRPC](https://grpc.io/docs/languages/go/quickstart/) including [code generator](https://developers.google.com/protocol-buffers/docs/reference/go-generated) for Go.
<li>Make sure one of the following databases is installed and running:
3.Make sure one of the following databases is installed and running:
* MySQL 5.7 or above. MySQL 5.6 or below **will not work**.
* MongoDB 4.0 or above.
* RethinkDB.
</li>
<li>Fetch, build Tinode server and tinode-db database initializer:
4.Fetch, build Tinode server and tinode-db database initializer:
-**MySQL**:
```
go install -tags mysql github.com/tinode/chat/server@latest
...
...
@@ -59,8 +57,9 @@ See [instructions](./docker/README.md)
```
go install -tags "mysql rethinkdb mongodb" github.com/tinode/chat/server@latest
go install -tags "mysql rethinkdb mongodb" github.com/tinode/chat/tinode-db@latest
```
<p>
Note the required **`-tags rethinkdb`**, **`-tags mysql`** or **`-tags mongodb`** build option.
You may also optionally define `main.buildstamp` for the server by adding a build option, for instance, with a timestamp:
...
...
@@ -74,18 +73,17 @@ See [instructions](./docker/README.md)
go get -tags mysql github.com/tinode/chat/server && go build -tags mysql -o $GOPATH/bin/tinode github.com/tinode/chat/server
```
Building with Go 1.13 or below **will fail**!
</li>
</p>
<li>Open `tinode.conf`. Check that the database connection parameters are correct for your database. If you are using MySQL make sure [DSN](https://github.com/go-sql-driver/mysql#dsn-data-source-name) in `"mysql"` section is appropriate for your MySQL installation. Option `parseTime=true` is required.
5.Open `tinode.conf`. Check that the database connection parameters are correct for your database. If you are using MySQL make sure [DSN](https://github.com/go-sql-driver/mysql#dsn-data-source-name) in `"mysql"` section is appropriate for your MySQL installation. Option `parseTime=true` is required.