   connectDocument:  ->
     @doc.on 'replicate-change', (event) =>
       @stampEvent(event)
+      console.log "sending replication event", event
       @channel.broadcast('document-changed', event)
 
     @channel.on 'document-changed', (event) =>
+      console.log "receiving replication event", event
       @verifyEvent(event)
       @doc.applyRemoteChange(event)
 

  getClientIdToSiteIdMap: -> @doc.get('collaborationState.clientIdToSiteId')

  subscribe: (name) ->
    token = keytar.getPassword('github.com', 'github')
    channel = new WsChannel({name, @host, @port, @secure, token})
    {@clientId} = channel


      @connectDocument()
      @channel.one 'channel:subscribed', (participantStates) =>
        console.log "subscribed to #{@id} as leader"
        @setParticipantStates(participantStates)
        @listening = true
        @trigger 'started', @getParticipants()
