Add a preliminary, probably somewhat broken set of setup instructions.
[?]
May 26, 2015, 9:25 PM
DLZRD7VBR2KY2D4CLOJDHENA47AJ527TFOCNC6EZJLM36ENPX5RQCDependencies
- [2]
AXKKXBWNInitial attempt at writing down my ideas for a company based on trust.
Change contents
- file addition: INSTALL.md[2.2]
First, you'll need a local install of postgres. This is because thepostgresql-simple package requires some of the postgres command-line toolsand/or libraries in order to build.You'll want to create a new postgres database for the aftok project, and auser with superuser permissions on that database. Then, you can use thescript sql/aftok-pg.sql to create the initial state of your database.psql -h localhost -f sql/aftok-pg.sql aftok aftokThen, the usual setup steps apply:cabal sandbox initcabal configurecabal install --only-dependencies --enable-testscabal buildcabal testIf using nix, instead you can do the following:cd <project_root>cabal2nix --shell . > shell.nixnix-shell -I ~ --command 'cabal configure --enable-tests'To start the server, you'll need to create an SSL X509 certificate that'sused for encryption of cookies and so forth:mkdir localcd localopenssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365 -nodescd <project_root>echo 'sslCert = "local/cert.pem"' > aftok.cfgecho 'siteKey = "local/key.pem"' >> aftok.cfgIf you want to run on a port other than 8000, you can set 'port = 12345' in thataftok.cfg file.Next, we'll want to run the server in order to autogenerate the files that needto be edited to configure postgres:cabal run aftok-serverI can't remember whether this will succeed or fail to start, but in any caseonce it has run you should be able to find the filesnaplets/postgresql-simple/devel.cfgEdit this file to set the database connection information:host = "localhost"port = 5432user = "aftok"pass = "???"db = "aftok"Now, when you do 'cabal run aftok-server' it should actually start up and run.There are a few shell scripts in <project_root>/scripts that provide basicfunctionality for creating a project, creating a user, and starting andstopping your clock. Right now these are hardcoded with project identifiers anda bitcoin address that are local to a test blockchain on my system. Speaking ofwhich, you'll also eventually want to install bitcoind, although at the momentbasically nothing related to the bitcoin infrastructure is working anyway soit's not immediately necessary.