Skip to content

Tip: Running Local Crypton Server

Ken Manheimer edited this page Jan 10, 2014 · 7 revisions

Using a public crypton server is a hassle for development, because e.g. you don't have the option to clear it at will. Running the crypton server locally is not trivial, but not hard, provided you know what to do. Here's some tips on getting it going:

Prerequisites

  • Local crypton clone fetched and built - follow the instructions in the README.md
  • Redis installed locally (or remote access to a redis server, but then you're depending again)
  • Postgresql installed locally (or remote access to a postgresql server, but...)

Starting the whole shebang

  • Start the redis server: /usr/local/bin/redis-server &
  • Start postegresql. (I use it on the mac, start it using spotlight.)
  • Start the crypton server - from the crypton repo clone root dir: sudo server/bin/cli.js

Clearing state for sparkling fresh crypton server sessions

  • Stop the crypton server process - cleaning the test db fails if the crypton server is running
  • Make sure the postgresql server is running
  • from the crypton clone root dir (one or both uses sudo, so be prepared to authenticate):
    cd integration_tests
    make clean-test-db
    make setup-test-environment

(Note that this doesn't clear the redis db. At time of writing, use of it is half-implemented, and it's intended just for messaging feature state. If it ever becomes useful/necessary, you can clear those keys using the redis-cli, like this: redis-cli keys "crypton.*" | xargs redis-cli del.)

Clone this wiki locally