diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a5b87d9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+.lock-waf_darwin_build
+.waf*
+build/
+chronoshare.db
diff --git a/src/main.cc b/src/main.cc
new file mode 100644
index 0000000..f8338c4
--- /dev/null
+++ b/src/main.cc
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ *         Chaoyi Bian <bcy@pku.edu.cn>
+ *	   Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "sqlite-helper.h"
+
+int
+main (int argc, char **argv)
+{
+  DbHelper db ("./");
+  return 0;
+}
diff --git a/src/sqlite-helper.cc b/src/sqlite-helper.cc
new file mode 100644
index 0000000..c9c508b
--- /dev/null
+++ b/src/sqlite-helper.cc
@@ -0,0 +1,189 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#include "sqlite-helper.h"
+// #include "sync-log.h"
+
+// Other options: VP_md2, EVP_md5, EVP_sha, EVP_sha1, EVP_sha256, EVP_dss, EVP_dss1, EVP_mdc2, EVP_ripemd160
+#define HASH_FUNCTION EVP_sha256
+
+#include <boost/throw_exception.hpp>
+typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str; 
+// typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int; 
+
+
+const std::string INIT_DATABASE = "\
+CREATE TABLE                                                    \
+    SyncNodes(                                                  \
+        device_id       INTEGER PRIMARY KEY AUTOINCREMENT,      \
+        device_name     TEXT NOT NULL,                          \
+        description     TEXT,                                   \
+        seq_no          INTEGER NOT NULL,                       \
+        last_known_tdi  TEXT,                                   \
+        last_update     TIMESTAMP                               \
+    );                                                          \
+                                                                \
+CREATE INDEX SyncNodes_device_name ON SyncNodes (device_name);  \
+                                                                \
+CREATE TABLE SyncLog(                                           \
+        state_hash  BLOB NOT NULL PRIMARY KEY,                  \
+        last_update TIMESTAMP NOT NULL                          \
+    );                                                          \
+                                                                \
+CREATE TABLE                                                    \
+    SyncStateNodes(                                             \
+        id          INTEGER PRIMARY KEY AUTOINCREMENT,          \
+        state_hash  BLOB NOT NULL                                       \
+            REFERENCES SyncLog (state_hash) ON UPDATE CASCADE ON DELETE CASCADE, \
+        device_id   INTEGER NOT NULL                                    \
+            REFERENCES SyncNodes (device_id) ON UPDATE CASCADE ON DELETE CASCADE, \
+        seq_no      INTEGER NOT NULL                                    \
+    );                                                                  \
+                                                                        \
+CREATE INDEX SyncStateNodes_device_id ON SyncStateNodes (device_id);    \
+CREATE INDEX SyncStateNodes_state_hash ON SyncStateNodes (state_hash);  \
+CREATE INDEX SyncStateNodes_seq_no ON SyncStateNodes (seq_no);          \
+                                                                        \
+CREATE TRIGGER SyncLogGuard_trigger                                     \
+    BEFORE INSERT ON SyncLog                                            \
+    FOR EACH ROW                                                        \
+    WHEN (SELECT state_hash                                             \
+            FROM SyncLog                                                \
+            WHERE state_hash=NEW.state_hash)                            \
+        IS NOT NULL                                                     \
+    BEGIN                                                               \
+        DELETE FROM SyncLog WHERE state_hash=NEW.state_hash;            \
+    END;                                                                \
+";
+
+DbHelper::DbHelper (const std::string &path)
+{
+  int res = sqlite3_open((path+"chronoshare.db").c_str (), &m_db);
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Cannot open/create dabatabase: [" + path + "chronoshare.db" + "]"));
+    }
+  
+  res = sqlite3_create_function (m_db, "hash", 2, SQLITE_ANY, 0, 0,
+                                     DbHelper::hash_xStep, DbHelper::hash_xFinal);
+  if (res != SQLITE_OK)
+    {
+      BOOST_THROW_EXCEPTION (Error::Db ()
+                             << errmsg_info_str ("Cannot create function ``hash''"));
+    }
+
+  // Alex: determine if tables initialized. if not, initialize... not sure what is the best way to go...
+  // for now, just attempt to create everything
+
+  char *errmsg = 0;
+  res = sqlite3_exec (m_db, INIT_DATABASE.c_str (), NULL, NULL, &errmsg);
+  // if (res != SQLITE_OK && errmsg != 0)
+  //   {
+  //     std::cerr << "DEBUG: " << errmsg << std::endl;
+  //     sqlite3_free (errmsg);
+  //   }
+
+  res = sqlite3_exec (m_db, "INSERT INTO SyncLog (state_hash, last_update) SELECT hash(device_name, seq_no), datetime('now') FROM SyncNodes ORDER BY device_name",
+                          NULL, NULL, &errmsg);
+  if (res != SQLITE_OK && errmsg != 0)
+    {
+      std::cerr << "DEBUG: " << errmsg << std::endl;
+      sqlite3_free (errmsg);
+    }
+}
+
+DbHelper::~DbHelper ()
+{
+  int res = sqlite3_close (m_db);
+  if (res != SQLITE_OK)
+    {
+      // complain
+    }
+}
+
+void
+DbHelper::hash_xStep (sqlite3_context *context, int argc, sqlite3_value **argv)
+{
+  if (argc != 2)
+    {
+      // _LOG_ERROR ("Wrong arguments are supplied for ``hash'' function");
+      sqlite3_result_error (context, "Wrong arguments are supplied for ``hash'' function", -1);
+      return;
+    }
+  if (sqlite3_value_type (argv[0]) != SQLITE_TEXT ||
+      sqlite3_value_type (argv[1]) != SQLITE_INTEGER)
+    {
+      // _LOG_ERROR ("Hash expects (text,integer) parameters");
+      sqlite3_result_error (context, "Hash expects (text,integer) parameters", -1);
+      return;
+    }
+  
+  EVP_MD_CTX **hash_context = reinterpret_cast<EVP_MD_CTX **> (sqlite3_aggregate_context (context, sizeof (EVP_MD_CTX *)));
+
+  if (hash_context == 0)
+    {
+      sqlite3_result_error_nomem (context);
+      return;
+    }
+
+  if (*hash_context == 0)
+    {
+      *hash_context = EVP_MD_CTX_create ();
+      EVP_DigestInit_ex (*hash_context, HASH_FUNCTION (), 0);
+    }
+  
+  int nameBytes = sqlite3_value_bytes (argv[0]);
+  const unsigned char *name = sqlite3_value_text (argv[0]);
+  sqlite3_int64 seqno = sqlite3_value_int64 (argv[1]);
+
+  EVP_DigestUpdate (*hash_context, name, nameBytes);
+  EVP_DigestUpdate (*hash_context, &seqno, sizeof(sqlite3_int64));
+}
+
+void
+DbHelper::hash_xFinal (sqlite3_context *context)
+{
+  EVP_MD_CTX **hash_context = reinterpret_cast<EVP_MD_CTX **> (sqlite3_aggregate_context (context, sizeof (EVP_MD_CTX *)));
+
+  if (hash_context == 0)
+    {
+      sqlite3_result_error_nomem (context);
+      return;
+    }
+
+  if (*hash_context == 0) // no rows
+    {
+      sqlite3_result_null (context);
+      return;
+    }
+  
+  unsigned char *hash = new unsigned char [EVP_MAX_MD_SIZE];
+  unsigned int hashLength = 0;
+
+  int ok = EVP_DigestFinal_ex (*hash_context,
+			       hash, &hashLength);
+
+  sqlite3_result_blob (context, hash, hashLength, SQLITE_TRANSIENT); //SQLITE_TRANSIENT forces to make a copy
+  delete [] hash;
+  
+  EVP_MD_CTX_destroy (*hash_context);
+}
diff --git a/src/sqlite-helper.h b/src/sqlite-helper.h
new file mode 100644
index 0000000..6874259
--- /dev/null
+++ b/src/sqlite-helper.h
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#ifndef SQLITE_HELPER_H
+#define SQLITE_HELPER_H
+
+#include <sqlite3.h>
+#include <openssl/evp.h>
+#include <boost/exception/all.hpp>
+#include <string>
+
+// temporarily ignoring all potential database errors
+
+class DbHelper
+{
+public:
+  DbHelper (const std::string &path);
+  ~DbHelper ();
+
+  
+  
+private:
+  static void
+  hash_xStep (sqlite3_context*,int,sqlite3_value**);
+
+  static void
+  hash_xFinal (sqlite3_context*);
+  
+private:
+  sqlite3 *m_db;
+};
+
+namespace Error {
+struct Db : virtual boost::exception, virtual std::exception { };
+}
+
+
+#endif // SQLITE_HELPER_H
diff --git a/src/sync-log.h b/src/sync-log.h
new file mode 100644
index 0000000..267a08d
--- /dev/null
+++ b/src/sync-log.h
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2012 University of California, Los Angeles
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ *	   Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ */
+
+#ifndef SYNC_LOG_H
+#define SYNC_LOG_H
+
+#define INIT_LOGGER(name)
+#define _LOG_FUNCTION(x)
+#define _LOG_FUNCTION_NOARGS
+#define _LOG_TRACE(x)
+#define INIT_LOGGERS(x)
+
+#ifdef _DEBUG
+
+#include <boost/thread/thread.hpp>
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <iostream>
+#include <string>
+
+#define _LOG_DEBUG(x) \
+  std::clog << boost::get_system_time () << " " << boost::this_thread::get_id () << " " << x << std::endl;
+
+#else
+#define _LOG_DEBUG(x)
+#endif
+
+#define _LOG_ERROR(x) \
+  std::clog << boost::get_system_time () << " " << boost::this_thread::get_id () << " " << x << std::endl;
+
+#endif // SYNC_LOG_H
diff --git a/waf b/waf
new file mode 100755
index 0000000..7195638
--- /dev/null
+++ b/waf
Binary files differ
diff --git a/wscript b/wscript
new file mode 100644
index 0000000..8300acc
--- /dev/null
+++ b/wscript
@@ -0,0 +1,55 @@
+# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+VERSION='0.1'
+APPNAME='chronoshare'
+
+from waflib import Build, Logs
+
+def options(opt):
+    opt.load('compiler_cxx boost ccnx')
+    opt.add_option('--debug',action='store_true',default=False,dest='debug',help='''debugging mode''')
+    opt.add_option('--yes',action='store_true',default=False) # for autoconf/automake/make compatibility
+
+def configure(conf):
+    conf.load("compiler_cxx boost ccnx")
+
+    conf.check_cfg(package='sqlite3', args=['--cflags', '--libs'], uselib_store='SQLITE3', mandatory=True)
+
+    if not conf.check_cfg(package='openssl', args=['--cflags', '--libs'], uselib_store='SSL', mandatory=False):
+        Logs.error ("bla")
+        conf.check_cc(lib='crypto',
+                      header_name='openssl/crypto.h',
+                      define_name='HAVE_SSL',
+                      uselib_store='SSL')
+    else:
+        conf.define ("HAVE_SSL", 1)
+    
+    if not conf.get_define ("HAVE_SSL"):
+        conf.fatal ("Cannot find SSL libraries")
+
+    conf.check_boost(lib='system iostreams regex')
+
+    boost_version = conf.env.BOOST_VERSION.split('_')
+    if int(boost_version[0]) < 1 or int(boost_version[1]) < 46:
+        Logs.error ("Minumum required boost version is 1.46")
+        return
+
+    conf.check_ccnx (path=conf.options.ccnx_dir)
+
+    if conf.options.debug:
+        conf.define ('_DEBUG', 1)
+        conf.env.append_value('CXXFLAGS', ['-O0', '-g3'])
+    else:
+        conf.env.append_value('CXXFLAGS', ['-O3', '-g'])
+
+    conf.write_config_header('src/config.h')
+
+def build (bld):
+    chronoshare = bld (
+        target=APPNAME,
+        features=['cxx', 'cxxprogram'],
+        # source = bld.path.ant_glob(['src/**/*.cc']),
+        source = ['src/main.cc', 'src/sqlite-helper.cc'],
+        use = 'BOOST BOOST_IOSTREAMS BOOST_REGEX CCNX SSL SQLITE3',
+        includes = ['include', 'src'],
+        )
