diff --git a/basice2e/clients.goldoutput/client12.out b/basice2e/clients.goldoutput/client12.out
index 71f22f1d1417a0d2d8fd5a08ab2e3916b791551b..5bdaeebb599373f6f485d02c21027662d8514ca9 100755
--- a/basice2e/clients.goldoutput/client12.out
+++ b/basice2e/clients.goldoutput/client12.out
@@ -2,3 +2,5 @@ Sending Message to 2, Jim: Hello, 2
 Message from 31, #General Received: Channel, Hello
 Sending Message to 2, Jim: Hello, 2
 Message from 4, Rick Received: Hello, 1
+Sending Message to 2, Jim: Hello, 2
+Message from 4, Rick Received: Hello, 1
diff --git a/basice2e/clients.goldoutput/client23.out b/basice2e/clients.goldoutput/client23.out
index 97b0607064970ed2963871daac286d5bc8ef5025..48ab196be71fc7f90eba54132089335318d2db98 100755
--- a/basice2e/clients.goldoutput/client23.out
+++ b/basice2e/clients.goldoutput/client23.out
@@ -2,3 +2,5 @@ Sending Message to 3, Ben: Hello, 3
 Message from 31, #General Received: Channel, Hello
 Sending Message to 3, Ben: Hello, 3
 Message from 1, David Received: Hello, 2
+Sending Message to 3, Ben: Hello, 3
+Message from 1, David Received: Hello, 2
diff --git a/basice2e/clients.goldoutput/client34.out b/basice2e/clients.goldoutput/client34.out
index ec71365c33217483b8a17abfeb273717bcc318ca..840020ed94e1cb86cacf7784220efcd38f20e872 100755
--- a/basice2e/clients.goldoutput/client34.out
+++ b/basice2e/clients.goldoutput/client34.out
@@ -2,3 +2,5 @@ Sending Message to 4, Rick: Hello, 4
 Message from 31, #General Received: Channel, Hello
 Sending Message to 4, Rick: Hello, 4
 Message from 2, Jim Received: Hello, 3
+Sending Message to 4, Rick: Hello, 4
+Message from 2, Jim Received: Hello, 3
diff --git a/basice2e/clients.goldoutput/client41.out b/basice2e/clients.goldoutput/client41.out
index e1b61091593e16f619e7fa0531a498bc069d4347..1b1ce0f55bddd11810d15c5e1afbfb99db1f0a10 100755
--- a/basice2e/clients.goldoutput/client41.out
+++ b/basice2e/clients.goldoutput/client41.out
@@ -2,3 +2,5 @@ Sending Message to 1, David: Hello, 1
 Message from 31, #General Received: Channel, Hello
 Sending Message to 1, David: Hello, 1
 Message from 3, Ben Received: Hello, 4
+Sending Message to 1, David: Hello, 1
+Message from 3, Ben Received: Hello, 4
diff --git a/basice2e/gateway.yaml b/basice2e/gateway.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..6681b96db88147c35dc925b4ae90f92cfbb8d40c
--- /dev/null
+++ b/basice2e/gateway.yaml
@@ -0,0 +1,36 @@
+################################################################################
+## Copyright © 2018 Privategrity Corporation                                   #
+##                                                                             #
+## All rights reserved.                                                        #
+################################################################################
+
+##
+# Sample Gateway Configuration
+##
+
+# Output log file
+log: "results/gateway.log"
+
+# The cMix nodes in the network
+cMixNodes:
+ - "localhost:50000"
+ - "localhost:50001"
+ - "localhost:50002"
+ - "localhost:50003"
+ - "localhost:50004"
+# The index to which this Gateway is attached in the cMixNodes list
+GatewayNodeIndex: 4
+
+# The listening address of this gateway
+GatewayAddress: "localhost:8443"
+
+# The number of seconds a message should remain in the globals before being
+# deleted from the user's message queue
+MessageTimeout: 60
+
+### Anything below this line is to be deprecated ###
+
+# Number of nodes in the cMix Network
+
+# Batch size of the cMix Network (to be deprecated)
+batchSize: 4
diff --git a/basice2e/run.sh b/basice2e/run.sh
index 35f2291be8512deac8931caf12d9ef6a0f30b1cf..b407fc59958e9b0e81d9373f31e8092272ffb541 100755
--- a/basice2e/run.sh
+++ b/basice2e/run.sh
@@ -12,6 +12,7 @@ CLIENTOUT=results/clients
 CHANNELOUT=results/channelbot.console
 DUMMYOUT=results/dummy.console
 UDBOUT=results/udb.console
+GATEWAYOUT=results/gateway.console
 
 mkdir -p $SERVERLOGS
 mkdir -p $CLIENTOUT
@@ -68,7 +69,7 @@ runclients() {
             nid=$((($cid % 4) + 1))
             eval NICK=\${NICK${cid}}
             # Send a regular message
-            CLIENTCMD="timeout 60s ../bin/client -f blob$cid --numnodes 5 -s $LASTNODE -i $cid -d $nid -m \"Hello, $nid\" --noratchet"
+            CLIENTCMD="timeout 60s ../bin/client -f blob$cid --numnodes 5 $GATEWAY -s $LASTNODE -i $cid -d $nid -m \"Hello, $nid\" --noratchet"
             eval $CLIENTCMD >> $CLIENTOUT/client$cid$nid.out 2>&1 &
             PIDVAL=$!
             eval CLIENTS${CTR}=$PIDVAL
@@ -106,6 +107,13 @@ PIDVAL=$!
 echo $PIDVAL >> results/serverpids
 echo "$DUMMYCMD -- $PIDVAL"
 
+# Start a gateway
+GATEWAYCMD="../bin/gateway --config gateway.yaml"
+$GATEWAYCMD >> $GATEWAYOUT 2>&1 &
+PIDVAL=$!
+echo $PIDVAL >> results/serverpids
+echo "$GATEWAYCMD -- $PIDVAL"
+
 # Send a registration command
 cat registration-commands.txt | while read LINE
 do
@@ -129,6 +137,9 @@ echo "RUNNING CLIENTS..."
 runclients
 echo "RUNNING CLIENTS (2nd time)..."
 runclients
+echo "RUNNING CLIENTS THROUGH GATEWAY..."
+GATEWAY="-g localhost:8443"
+runclients
 
 # HACK HACK HACK: Remove the ratchet warning from client output
 for F in $(find results/clients -type f)
@@ -148,6 +159,10 @@ diff -ruN results/channel-errors.txt noerrors.txt
 cat $DUMMYOUT | grep "ERROR" > results/dummy-errors.txt || true
 cat $DUMMYOUT | grep "FATAL" >> results/dummy-errors.txt || true
 diff -ruN results/dummy-errors.txt noerrors.txt
+cat $GATEWAYOUT | grep "ERROR" > results/gateway-errors.txt || true
+cat $GATEWAYOUT | grep "FATAL" >> results/gateway-errors.txt || true
+diff -ruN results/gateway-errors.txt noerrors.txt
+
 
 
 echo "SUCCESS!"
diff --git a/build.sh b/build.sh
index c9c9f7148b17a77f1553dc379039c91d33e73e1e..3faffc819f1d3bdf4b18690380de900dc41c0b0a 100755
--- a/build.sh
+++ b/build.sh
@@ -4,6 +4,8 @@
 # and assumes that you've cloned the Go repos to your GOPATH and updated them
 # with Glide.
 
+mkdir -p bin
+
 pushd $GOPATH/src/gitlab.com/privategrity/client
 go generate cmd/version.go
 go build
@@ -29,3 +31,8 @@ popd
 go build -o udb $UDBPATH
 mv ./udb bin
 
+pushd $GOPATH/src/gitlab.com/privategrity/gateway
+go generate cmd/version.go
+go build
+popd
+mv $GOPATH/src/gitlab.com/privategrity/gateway/gateway bin
diff --git a/update.sh b/update.sh
index 32db2e7db60d26551cb26e5dc192f17ec38431d6..d173a60468b9077124e94fe8fa5a6823923026c0 100755
--- a/update.sh
+++ b/update.sh
@@ -6,30 +6,47 @@
 git pull
 rm -fr ~/.glide
 
+update() {
+    git clean -ffdx
+#    git checkout master
+    git pull
+    glide cc
+    glide up
+}
+
 pushd $GOPATH/src/gitlab.com/privategrity/client
-git clean -ffdx
-git pull
-glide cc
-glide up
+update
 popd
 
 pushd $GOPATH/src/gitlab.com/privategrity/server
-git clean -ffdx
-git pull
-glide cc
-glide up
+update
 popd
 
 pushd $GOPATH/src/gitlab.com/privategrity/channelbot
-git clean -ffdx
-git pull
-glide cc
-glide up
+update
 popd
 
 pushd $GOPATH/src/gitlab.com/privategrity/user-discovery-bot
-git clean -ffdx
-git pull
-glide cc
-glide up
+update
+popd
+
+pushd $GOPATH/src/gitlab.com/privategrity/gateway
+update
 popd
+
+#pushd $GOPATH/src/gitlab.com/privategrity/comms
+#update
+#popd
+
+#pushd $GOPATH/src/gitlab.com/privategrity/crypto
+#update
+#popd
+
+#pushd $GOPATH/src/gitlab.com/privategrity/client-consoleUI
+#update
+#popd
+
+pushd ..
+go test ./...
+popd
+