Thursday, July 25, 2019

CypherPoker.JS Guide: Setting Up A Private Home Game

Hi everyone,

I've finally put together the first CypherPoker.JS guide that describes how to set up the Services Server (i.e. how to run your own private / home game).

I know that it looks long but most of the content consists of screencaps and much of those simply describe what to look for (as opposed to illustrating how to do something).

I've tried to make it as non-technical and simple as possible but that's from my own skewed perspective so I would greatly appreciate your feedback to help me improve this and future guides:

  • Is something not clear or not fully explained?
  • Did you encounter a problem or gotten stuck?
  • Was something too complex or convoluted (i.e. could it have been explained more succinctly)?
  • Were you expecting something based on a header/title that turned out to be something different?

Here's the guide, as found on the CypherPoker.JS wiki: https://github.com/monicanagent/cypherpoker.js/wiki/Setting-up-a-private-home-game

This document will guide you through the process of setting up the CypherPoker.JS Services Server to host private home games.

1. Download and unzip the CypherPoker.JS Windows binary

https://i.redd.it/g5b7eqacbkc31.png

  • Scroll down to the latest / newest release and download the .zip file ...

https://i.redd.it/98s0b24gbkc31.png

... to your desktop.

https://i.redd.it/oujs2etjbkc31.png

  • Find the downloaded file on your desktop and unzip it.

https://i.redd.it/1vyam2upbkc31.png

2. Make sure that blockchain functionality is enabled

  • Find the server folder inside the unzipped files. The full path is: ...\Desktop\CypherPokerJS_win64_0.5.1\CypherPokerJS\resources\app\server

https://i.redd.it/ek2piibtbkc31.png

  • Using your favourite text editor (e.g. Notepad, Atom, etc.), open the config.json file in the server folder.

https://i.redd.it/q65fn89wbkc31.png

  • Scroll down to the handlers section and make sure that the "Blockstream API Bitcoin Handler" and "Bitcoin.com API Bitcoin Cash Handler" are enabled ("enabled": true).
    • The "CryptoAPIs Bitcoin Cash Handler". "BlockCypher API Cryptocurrency Handler", "Native Bitcoin Core (bitcoind) Handler", and "Native Bitcoin Cash (bitcoind) Handler" handlers should be disabled ("enabled": false).

https://i.redd.it/cxxehz5zbkc31.png

3. Configure the HD wallets

  • Now scroll down to the wallets section. Note the bitcoin, test3, bitcoincash, and bchtest sections; these contain HD wallet information for Bitcoin, Bitcoin testnet (test3), Bitcoin Cash, and Bitcoin Cash testnet respectively. We will update these in the next step.

https://i.redd.it/wxyzz513ckc31.png

https://i.redd.it/n544bib6ckc31.png

  • For extra security it's recommended that you disconnect from any network you're connected to and generate new wallets by clicking the GENERATE NEW WALLETS button at the bottom of the page. MAKE SURE TO SAVE THIS INFORMATION TO A SECURE LOCATION! With these keys CypherPoker.JS can re-create all deposit addresses and associated accounts; without it, any deposits may be lost (inaccessible) forever. Seriously ... back it up now!

https://i.redd.it/vky333dbckc31.png

  • Now replace each "xprv" and "tprv" values in the config.json file's wallets section with ones generated using the HD Wallet generator.
    • Make sure that you're updating both the correct cryptocurrency as well as its associated network (mainnet or testnet). Recall that "bitcoin" is the Bitcoin mainnet, "test3" is the Bitcoin testnet, "bitcoincash" is the Bitcoin Cash mainnet, and "bchtest" is the Bitcoin Cash testnet.
    • Also make sure that the "xprv..." and "tprv..." values are surrounded by quotes.

https://i.redd.it/ba9os00eckc31.png

4. Configure the Services fees

  • Scroll farther down the config.json file to the bitcoin and bitcoincash sections. Each contains a sub-section named defaults where you'll find a main (mainnet) and test3 or test section (testnet). Here you can specify both the minerFee and the depositfee for each cryptocurrency and their sub-types (networks).
    • Note that each fee is in satoshis and must be enclosed in quotes.

https://i.redd.it/67jroiuickc31.png

https://i.redd.it/k7ymzaqyckc31.png

  • Save and close the config.json file.

5. Start the Services server

  • Go back up a few folders to the main CypherPokerJS folder. Find the cypherpokerjs.exe file and run it.

https://i.redd.it/2r6fb0l4dkc31.png

  • In CypherPoker.JS' main menu, select CONNECTIVITY.

https://i.redd.it/kamdk2s7dkc31.png

  • In the pulldown labeled "Enable external access to API / P2P services using", select the type of tunnel connection to open for players to connect to. Use "WSSTunnel" for universal connectivity (web and desktop), or select "SSHTunnel" if all players are using the desktop version.

https://i.redd.it/wuasdi8adkc31.png

  • Click the toggle button next to the pulldown to enable external access. The SDB connection string will appear in the text box below. Click on the COPY TO CLIPBOARD button to copy the SDB to your system clipboard.

https://i.redd.it/ddxvdinddkc31.png

  • Send the SDB (via email, IM, etc.), to players who want to connect to and use your services. To connect, they will need to open the CONNECTIVITY panel from the MAIN MENU, paste the provided SDB into the "Connect using Services Descriptor Bundle (SDB)" field, and click CONNECT.
    • Note that the web version of CypherPoker.JS doesn't include the Services control portion of the CONNECTIVITY interface, only the desktop version does.

https://i.redd.it/mrsfdi0hdkc31.png

  • Your CypherPoker.JS Services Server can now be used to create and manage accounts, play and settle games, etc. You don't have to play (although you can), just remember to keep the application running while there are players connected!


No comments:

Post a Comment