Stripe CTF 2014
Go Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


I was fortunate enough to reach this level early, and pass it before Stripe improved octopus. As such I passed it with my first attempt, simply by removing the failover (node0 becomes Single Point of Failure) and forwarding requests from the secondaries to the primary.

The remaining commits are my futile attempts to pass this level after the SPOF check was added to the tests. Looking at the code for successful solutions, I can see I was on the right path but needed to invest more time into making my command forwarding more robust.


SQLCluster makes your SQLite highly-available.

Getting started

To run this level, you'll need a working Go installation. If you don't have one yet, it's quite easy to obtain. Just grab the appropriate installer from:

Then set your GOPATH environment variable:

It'll probably be convenient to check this code out into $GOPATH/src/ (that way, go build will know how to compile it without help). However, you can use the provided regardless of where you happened to check this level out.

Building and running

Run ./ to build the SQLCluster binary.

As always, you can run test cases via test/harness. This will automatically fetch and compile Octopus, download your test cases, and score your level for you.

Octopus will print out your score, together with how it arrived at said score.


SQCluster communicates with the outside world over HTTP. The public interface is simple:

POST /sql:

input:  A raw SQL body

output: A message with the form "SequenceNumber: $n", followed
        by the output of that SQL command.

Run ./ to build SQLCluster and have it print out some example usage (including curls you can run locally).

Supported platforms

SQLCluster has been tested on Mac OSX and Linux. It may work on other platforms, but we make no promises. If it's not working for you, see for advice on getting a development environment similar to our own.