- Blogchain Client, powered by Next.js
- Blogchain Client, powered by Sevelte
- Blogchain Server, powered by Rust
- Docker Compose (Blogchain Compose)
- Native
go run ./cmd/api/main.go \
--bind-address 0.0.0.0:3001 \ // if listener == 1
--listener 1
--bind-socket /tmp/blogchain.sock \ // if listener == 2
--database-host @ \
--database-user blogchain \
--database-password 123456 \
--database-name blogchain \
--database-dialect mysql \
--clickhouse-address localhost \
--clickhouse-user default \
--clickhouse-password ***** \
--clickhouse-database database_name \
--clickhouse-alt-hosts <optional hosts> \
--container-secret secret
- Docker
docker run -d --net=host \
-e BIND_ADDRESS='0.0.0.0:3001' \
-e BIND_SOCKET='/tmp/blogchain.sock' \
-e LISTENER=1 \
-e DATABASE_HOST='<database host: @>' \
-e DATABASE_USER='<database username>' \
-e DATABASE_PASSWORD='<database password>' \
-e DATABASE_NAME='<database name>' \
-e DATABASE_DIALECT='<database dialect: mysql>' \
-e CLICKHOUSE_ADDRESS='' \
-e CLICKHOUSE_USER='default' \
-e CLICKHOUSE_PASSWORD='' \
-e CLICKHOUSE_DATABASE='database_name' \
-e CLICKHOUSE_ALT_HOSTS='optional hosts' \
-e CDN_HOST='https://fileserver:1338' \
-e CDN_USER='user' \
-e CDN_PASSWORD='pass' \
-e CONTAINER_SECRET='<application secret>' \
--name golang-blogchain-server qwx1337/blogchain-server:latest
-e CLICKHOUSE_ALT_HOSTS='host2:1234,host3,host4:5678
In example above on every new connection driver will use following sequence of hosts if previous host is unavailable:
- host1:9000;
- host2:1234;
- host3:9000;
- host4:5678.
All queries within established connection will be sent to the same host.
Template: /srv/bc_secret/<secret_name_with_underscore>
Examples:
CLICKHOUSE_ALT_HOSTS
or--clickhouse-alt-hosts
to/srv/bc_secret/clickhouse_alt_hosts
DATABASE_PASSWORD
to/srv/bc_secret/database_password
etc
For a complete list of secrets, see the file main.go
.
$ make tests
$ golangci-lint run --config ./.golangci.yml