26
Jul
written by cail.cn • posted in How-To • 2,617 views 5 comments

19B6AEF9-CAF8-4E55-984A-7117EEB06DCB.jpg

As part of Google Wave Federation Day, we have open sourced the Operational Transformation (OT) implementation, which is the primary algorithm that manages the collaborative experience inside Google Wave, as well as the underlying wave model. To encourage early experimentation with the federation protocol, we also built a basic open source client/server. Check out the source code and get started with the introductory documentation.

It was Friday. Finally, I got it working. Thanks to jjgod and many other comments on the Installation page.

Basically I follow what has been described on the Installation page.

  1. Install Java 6 by
    sudo apt-get install sun-java6-jre sun-java6-fonts
  2. Install openfire by
    wget http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_3.6.4_all.deb
    sudo dpkg -i openfire_3.6.4_all.deb
    sudo /etc/init.d/openfire restart
  3. Configure the openfire server by entering http://remotecomputer:9090. It is a remote computer, but I confiure it as ‘localhost’.

    97665893-9A98-4C41-BD36-9822788662C2.jpg
    replace “acmewave.com” with “localhost”

    2DF1670A-4846-4617-8961-A619F1BFA9E8.jpg

    C4A2C53E-456B-4EC5-81B5-0E7F0D198386.jpg

    3AD224B9-EA00-48BB-A4AB-A52BC948F94F.jpg
    it is “admin@localhost” as the Email

  4. Restart the openfire by
    sudo /etc/init.d/openfire restart
  5. Login openfire with admin and new password. Configure openfire as

    A3119493-BE1A-4044-80E9-A6339D80B609.jpg
    my shared secret for wave subdomain is “foobar”

    3859171B-8C79-46E8-894B-A4E58014BBB6.jpg

    Go to Server -> Server Settings

    -> Registration and Login.
    * Disable “Inband Account Registration”.
    * Disable “Change Password”.
    * Disable “Anonymous Login”

    -> Compression Settings
    * Enable server-server compression

    -> File Transfer Settings
    * Disable file proxy transfer

  6. Set up certification files (Instruction is here.)
    make-cert.sh

    #!/bin/sh
    NAME=$1
    if [ "$NAME" == '' ]
    then
      echo "$0 <certificate name>" 1>&2
      exit 1
    fi
    openssl genrsa 1024 | openssl pkcs8 -topk8 -nocrypt -out $NAME.key
    openssl req -new -x509 -nodes -sha1 -days 365 -key $NAME.key -out $NAME.cert

    execute it as ./make-cert.sh testwave
    check the certificate and key match by

    openssl x509 -modulus -in testwave.cert -noout
    openssl rsa -in testwave.key -modulus -noout

    same modulus value shown up

    I did not get the certificate.

  7. Download wave-protocol from the source
    hg clone https://wave-protocol.googlecode.com/hg/ wave-protocol

    Copy the testwave.cert and testwave.key files into wave-protocol folder.

  8. Edit the run-server.sh file. Mine is like
    #!/bin/sh
    PRIVATE_KEY_FILENAME=testwave.key
    CERTIFICATE_FILENAME_LIST=testwave.cert
    CERTIFICATE_DOMAIN_NAME=localhost
    XMPP_SERVER_HOSTNAME=$CERTIFICATE_DOMAIN_NAME
    XMPP_SERVER_IP=$XMPP_SERVER_HOSTNAME
    XMPP_SERVER_SECRET="foobar"
    java -jar dist/fedone-0.2.jar \
      --client_frontend_hostname=127.0.0.1 \
      --client_frontend_port=9876 \
      --xmpp_component_name=wave \
      --xmpp_server_hostname=$XMPP_SERVER_HOSTNAME \
      --xmpp_server_ip=$XMPP_SERVER_IP \
      --xmpp_server_port=5275 \
      --xmpp_server_secret $XMPP_SERVER_SECRET \
      --xmpp_server_ping="" \
      --certificate_private_key=$PRIVATE_KEY_FILENAME \
      --certificate_files=$CERTIFICATE_FILENAME_LIST \
      --certificate_domain=$CERTIFICATE_DOMAIN_NAME \
      --waveserver_disable_verification=false
  9. Compile the protocol
    ant dist

    Run the server

    ./run-server.sh

    The very first screen outputs are

    Jul 26, 2009 3:02:37 PM org.waveprotocol.wave.examples.fedone.waveserver.WaveServerImpl <init>
    INFO: Wave Server configured to host local domains: [localhost]
    Jul 26, 2009 3:02:37 PM org.waveprotocol.wave.examples.fedone.ServerMain$RpcInetSocketAddressFactory <init>
    INFO: Starting client frontend on host: 127.0.0.1 port: 9876
    Jul 26, 2009 3:02:38 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent initialize
    INFO: initializing with JID: wave.localhost
    Jul 26, 2009 3:02:38 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent start
    INFO: connected to XMPP server with JID: wave.localhost
    Jul 26, 2009 3:02:38 PM org.waveprotocol.wave.examples.fedone.ServerMain run
    INFO: Starting server
    Jul 26, 2009 3:02:38 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent processPacket
    INFO: received XMPP packet:
    <iq type="get" id="154-5" from="component.localhost" to="wave.localhost">
      <query xmlns="http://jabber.org/protocol/disco#info"/>
    </iq>
    Jul 26, 2009 3:02:38 PM org.waveprotocol.wave.examples.fedone.federation.xmpp.WaveXmppComponent sendPacket
    INFO: sent XMPP packet:
    <iq type="result" id="154-5" from="wave.localhost" to="component.localhost">
      <query xmlns="http://jabber.org/protocol/disco#info">
        <identity category="collaboration" type="google-wave" name="Google Prototype Wave Server - FedOne"/>
        <feature var="http://waveprotocol.org/protocol/0.2/waveserver"/>
      </query>
    </iq>
  10. Edit run-client.sh (I noticed an update today of this file, using which I succeeded). Mine is like
    #!/bin/sh
    WAVE_SERVER_DOMAIN_NAME=localhost
    WAVE_SERVER_HOSTNAME=127.0.0.1
    WAVE_SERVER_PORT=9876
    if [[ $# != 1 ]]; then
      echo "usage: ${0} <username EXCLUDING DOMAIN>"
    else
      USER_NAME=$1@$WAVE_SERVER_DOMAIN_NAME
      echo "running client as user: ${USER_NAME}"
      java -jar dist/fedone-client-0.2.jar $USER_NAME $WAVE_SERVER_HOSTNAME $WAVE_SE
    RVER_PORT
    fi
  11. Ready to go!

    connect user user to the server by

    ./run-client.sh user

    connect user good to the server by

    ./run-client.sh good

    they are making noise …
    wave protocol trial 1.png
    wave protocol trial 2.png

Issues:
* shutdown the server by ctrl+c, lose all the waves generated; really?
* any method to embed the wave to an html webpage?

Good starting point!

Leave a Reply

 

En.dogeno.us - CaiLog © cail.cn | Licensed under a Creative Commons License