chain sync support, unit tests started
completed unit tests for sync