Run Local
To run server run the following command on repository root
export TREDS_PORT=7997
go run main.go -port 7997
Using docker
docker run -p 7997:7997 absolutelightning/treds
For CLI run the following command in the client
folder in the repo
cd ./client
export TREDS_PORT=7997
go run main.go -port 7997
Default Port of Treds is 7997
If port is set in env variable as well as flag, flag takes the precedence.
Generating Binaries
To build the binary for the treds server, run following command in repo root -
Binary named treds
will be generated in repo root.
make build
GOOS=linux GOARCH=arm64 make build
To build the binary for the treds cli, run following command in repo root -
Binary named treds-cli
will be generated in repo root.
make build-cli
GOOS=linux GOARCH=arm64 make build-cli
Run Production
It is advised to run Treds cluster on production. To bootstrap a 3 node cluster, lets say we have 3 servers
Sever 1, Server 2 and Server 3
On Server 1 run
./treds -bind 0.0.0.0 -advertise ip-server-1 -servers 'uuid-server-2:ip-server-2:8300,uuid-server-3:ip-server-3:8300' -id uuid-server-1
On Server 2 run
./treds -bind 0.0.0.0 -advertise ip-server-2 -servers 'uuid-server-1:ip-server-1:8300,uuid-server-3:ip-server-3:8300' -id uuid-server-2
On Server 3 run
./treds -bind 0.0.0.0 -advertise ip-server-3 -servers 'uuid-server-1:ip-server-1:8300,uuid-server-2:ip-server-2:8300' -id uuid-server-3