Juggling the various versions of CypherPoker can be a little tricky at times.

In the early days it was much easier ensuring that all the versions were synched up but now that the code base has expanded I’ve decided to start with the lowest hanging fruit — the native desktop version — and move on to the more challenging implementations.

The web version of CypherPoker was one of these more challenging updates because of the (understandable) limits imposed on web browsers. Unlike native desktop software, for example, the browser can’t access your device’s files willy-nilly or launch native processes (other programs). This means that there’s far less control over accompanying software such as the Ethereum client (Geth).

Luckily, however, the Ethereum development team was forward-thinking enough to provide a variety of external access mechanisms to the client API and with a number of source code modifications and additions to the CypherPoker JavaScript library I was able to incorporate most of the the existing desktop functionality into the game software.

So while the web version is unable to launch the Ethereum client it does have nearly complete access to all of its functions via its API, meaning that as long as you can launch the client yourself, or connect to a running client over the network, you can play CypherPoker on the web.

Playing in the browser is fairly straightforward but will require a little extra setup. First, let’s load the game:

Ensure that you have the latest Flash Player installed for your browser by visiting: https://get.adobe.com/flashplayer/ Load CypherPoker by visiting: http://www.cypherpoker.org/play

(give it a few moments … I haven’t added a loading screen yet)

You should now see the Lounge interface and a small dialog box asking your permission to store data locally on your computer. This will allow CypherPoker to save any changes you make to the default settings — if you deny this option then the default settings will always be used.

If you see nothing at this point you may just need to enable Flash in your browser…

Enable Flash in Microsoft Edge

Open the Settings panel and select View advanced settings:

Ensure that Use Adobe Flash Player is enabled:

Refresh the site.

Enable Flash in Chrome

Type “chrome://settings/content” into the address bar or go to the Settings panel, click on Show advanced settings… (at the bottom), then click the Content settings… button in the Privacy section.

Scroll down to the Flash section and select Allow sites to run Flash (you can also add an exception specifically for cypherpoker.org if you wish):

Refresh the site.

Enable Flash in Firefox

Click on the Settings button and select Add-ons:

Select the Plugins category and find the Shockwave Flash plugin. In the pulldown on the right select either Ask to Activate or Always Activate.

Refresh the site.

The Ethereum client you may soon not need

Unfortunately, the following section is somewhat lengthy as it involves a full installation and manual launch of the Ethereum client, something that’s handled almost entirely by the desktop version of CypherPoker. Because I’m striving to make the software as close to a one-or-two-click solution, I don’t mind admitting that this irks me.

However, I do want to point out that what I’m describing here is a do-it-nearly-all-yourself approach that should soon be mostly redundant. This is because the Ethereum client can just as readily run as a remote web service as local PC software and this remote web service is in the works now. Effectively this will mean simply loading up the website and off you go!

So with that in mind, and in the meantime, let’s go the whole hog and set up the Ethereum client to run from your computer.

Installing the Ethereum client

Windows users can find installation instructions here: https://github.com/ethereum/go-ethereum/wiki/Installation-instructions-for-Windows

MacOS users can find installation instructions here: https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Mac

Ubuntu Linux users can find installation instructions here: https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Ubuntu

Arch Linux users can find installation instructions here: https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Arch

FreeBSD users can find installation instructions here: https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-FreeBSD

Running the Ethereum client

Once you’ve installed and set up Geth you’ll need to start it with special command line instructions in order to allow CypherPoker to interact with it.

On all operating systems, Geth can be started with the following command (the “ — “ are a double dashes/hyphens):

geth — verbosity=3 — ipcdisable — rpc — rpcport=8546 — rpcaddr=”127.0.0.1" — rpcapi=”db,eth,net,web3,admin,personal,miner,debug,shh,txpool” — rpccorsdomain=”http://cypherpoker.org,127.0.0.1,localhost” — datadir=”./data/” — lightkdf — fast — testnet — networkid=3 console

Here are the individual switches and what they mean:

verbosity: This is the level of information that Geth reports; the higher the number, the more detail you get. Just for fun some time you should try the maximum verbosity level of 6.

ipcdisable: This disables the IPC API interface, another way to control Geth that’s not used by CypherPoker.

rpc: This enables the RPC API interface which is the way that CypherPoker controls Geth.

rpcport: This specifies which port the RPC API interface will be accessible through (also specified in the CypherPoker interface below). The default is 8545 but I was feeling rebellious. Plus, this way you can run another Ethereum client (e.g. Mist), without having to worry about port collisions and other unfriendliness.

rpcapi: This enables various parts of the RPC API so that they can be accessed by CypherPoker. This, along with the rpc switch, is very important otherwise Geth will effectively lock out access to some very important functionality.

rpccorsdomain: This specifies which domains or IPs are allowed to use the RPC API, each allowed domain being separated by a comma. Here we’re allowing only “http://cypherpoker.org”, “127.0.0.1”, and “localhost” (these last two are your own computer only); any other connection attempt from any other source will be refused.

datadir: This is the directory in which Geth will store all of its information such as the blockchain data and accounts. In this case we’re storing everything alongside the geth program in a folder named “data”.

lightkdf: This reduces CPU and RAM usage by Geth when encrypting local account data, the wallet. This reduces the security of the wallet somewhat but frees up some resources for other processes like CypherPoker. You can try not including this switch to see how it affects performance.

fast: This switch allows for a significantly faster blockchain sync by downloading only certain data. If you don’t mind waiting you can omit this switch.

testnet: This causes Geth to sync with the Ropsten “revival” testnet rather than with the main Ethereum network. Since the CypherPoker smart contracts haven’t been deployed on the Ethereum mainnet yet you’ll want to make sure that this is set.

networkid: This is an alternative way to specify which network or blockchain you want to sync to; the id 3 is the Ropsten testnet. I suspect that this switch might be redundant but I include it for good measure.

console: This enables the interactive JavaScript console so that you can type commands into Geth. Without this it’ll be a one-way communication. Initially it’ll probably be fine to omit this but eventually you might want to test a few commands with Geth directly. Note that this switch is not preceded by a double-hyphen.