Skip to content

Latest commit

 

History

History
62 lines (51 loc) · 2.02 KB

Installation.md

File metadata and controls

62 lines (51 loc) · 2.02 KB

Installation

Start a TimescaleDB server

docker run -d --name timescaledb -p 5432:5432 -e POSTGRES_PASSWORD=rFcLGNkgsNtksg6Pgtn9CumL4xXBQ7 --restart unless-stopped timescale/timescaledb:latest-pg12

Setup a database

./bin/colonies database create --dbhost localhost --dbport 5432 --dbuser postgres --dbpassword=rFcLGNkgsNtksg6Pgtn9CumL4xXBQ7

In case, you would like to clear the database

./bin/colonies database drop --dbhost localhost --dbport 5432 --dbuser postgres --dbpassword=rFcLGNkgsNtksg6Pgtn9CumL4xXBQ7

Generate Server Private Key

./bin/colonies keychain generate

Output:

Id: 9289dfccedf27392810b96968535530bb69f90afe7c35738e0e627f3810d943e
PrvKey: 09545df1812e252a2a853cca29d7eace4a3fe2baad334e3b7141a98d43c31e7b

Start a Colonies server

export TZ=Europe/Stockholm
./bin/colonies server start --serverid=125bf9408553e32e18d30472af4982fbdb7e1d85084eb13f9594d491fb3364b0 --port=50080 --tlscert=./cert/cert.pem --tlskey=./cert/key.pem --dbhost localhost --dbport 5432 --dbuser postgres --dbpassword=rFcLGNkgsNtksg6Pgtn9CumL4xXBQ7

Or alternatively:

export TZ=Europe/Stockholm
export COLONIES_SERVERID="9289dfccedf27392810b96968535530bb69f90afe7c35738e0e627f3810d943e"
export COLONIES_SERVERPORT=50080
export COLONIES_TLS true 
export COLONIES_DBHOST=localhost
export COLONIES_DBUSER=postgres
export COLONIES_DBPORT=5432
export COLONIES_DBPASSWORD=rFcLGNkgsNtksg6Pgtn9CumL4xXBQ7
export COLONOES_TLSCERT=...colonyos/colonies/cert/cert.pem
export COLONIES_TLSKEY=...colonyos/colonies/cert/key.pem
export COLONIES_VERBOSE=true

./bin/colonies server start

Managing private keys

To simplify key management, all keys generated by the Colonies CLI are stored in ~/.colonies. It is possible to lookup a private key given a certain Id, for example:

./bin/colonies keychain get --id 9289dfccedf27392810b96968535530bb69f90afe7c35738e0e627f3810d943e

Output:

09545df1812e252a2a853cca29d7eace4a3fe2baad334e3b7141a98d43c31e7b