Compile then run from the command line.
Parameters:
--reset
: deletetinode
database if one exists, then re-create it in a blank state;--data=FILENAME
: filltinode
database with sample data from the provided file--config=FILENAME
: load configuration from FILENAME. Example config:
{
"db_adapter": "rethinkdb",
"adapter_config": {
"worker_id": 1,
"uid_key": "la6YsO+bNX/+XIkOqc5Svw==",
"params": {
"database": "tinode",
"addresses": "localhost:28015"
}
}
}
RethinkDB adapter uses snowflake to generate object IDs. The worker_id
and uid_key
parameters are used to initialize snowflake and only used when sample data is loaded.
worker_id
is the snowflake ID of the host running this utility, integer in the range 0 - 1023uid_key
is a base64-encoded 16 byte XTEA encryption key to (weakly) encrypt snowflake-generated IDs so they don't appear to be sequential.params.database
is the name of database to generateparams.addresses
is RethinkDB's host and port number to connect to. An array of hosts can be provided as well["host1", "host2"]
The uid_key
and worker_id
are only used if the sample data is being loaded. In such a case they should match those of a production server (and uid_key should be kept private), otherwise uniqueness of object keys is not guaranteed.
The default data.json
file creates five users with user names alice
, bob
, carol
, dave
, frank
. Passwords are the same as the user name with 123 appended, e.g. user alice
has password alice123
. It will also create three group topics, and multiple peer to peer topics. Users will be subscribed to topics and each other. All topics will be randomly filled with messages.
Avatar photos curtesy of https://www.pexels.com/ under CC0 license.
See database schema