Skip to content

Instantly share code, notes, and snippets.

@decent-dev
Last active February 21, 2018 16:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save decent-dev/a5f221d46de0a85abdee87cf0905328c to your computer and use it in GitHub Desktop.
Save decent-dev/a5f221d46de0a85abdee87cf0905328c to your computer and use it in GitHub Desktop.
Instructions to setup a local Rinkeby node and run Decent.bet's Slots Testnet

Decent.bet Slots Testnet Instructions

The decent.bet slots runs on the Rinkeby test network. Users are given options to use Infura's mainnet nodes or their local Geth node.

You can access the testnet by visiting the following URL: https://slots-testnet.decent.bet/

If you'd like to use your own local Geth node, follow the instructions below. For Mac OSX, you could follow our tutorial video. Otherwise, skip to the usage instructions

Setting up a local Rinkeby node

  • Follow Step 1 from these instructions to download Geth. Make sure you use the latest stable version (1.7.3 at the time of writing) to avoid any issues related to running unstable versions such as erroneous function calls and other unintended behavior.

  • To run geth with an open WS and RPC api, run the following in your terminal/command line

    geth --rinkeby --fast --rpc --rpcapi db,eth,net,web3,personal --ws --wsorigins "*" --wsapi "db,eth,net,web3,personal,web3" --cache=1024 --rpc --rpcport 8545 --rpccorsdomain "*" --rpcaddr "0.0.0.0"
    

    If this is your first run, wait for the initial sync to complete. It may take a few hours or more depending on your internet connection.

    Also read, this section of the previous instructions for security considerations when running a local node.

  • Once your node has synced, you will need to access it's console by running geth attach. You would need to do this in a separate terminal. Run the following command

    geth attach ipc:$HOME/.ethereum/rinkeby/geth.ipc
    

    You should now see the geth javascript console show up.

  • Generate private keys from the Slots Testnet login page by clicking on Generate Private key. Save the keys safely and use it solely for testing purposes. Import the keys into your running geth node by running the following commands in the geth console

    personal.importRawKey("<YOUR GENERATED PRIVATE KEY WITHOUT THE LEADING 0x>","<PASSWORD OF YOUR CHOICE>")
    

    This step is necessary to use your generated private key to sign/send transactions on the network.

  • Copy the address that is displayed in the output of the previous command or alternatively login to the slots testnet page and copy the private key's corresponding address by clicking on the address displayed on the top right of the page.

    Use this address to unlock your account on your running Geth node. Note This step has to be repeated anytime you restart your local node.

    personal.unlockAccount("<YOUR ADDRESS>", "<PASSWORD USED EARLIER>", 0)
    

    You should now be able to send transactions on Rinkeby from your local node using the logged in account.

  • You will now need Rinkeby ether to send transactions on the network, follow Step 4 from the previous instructions to claim your testnet ether.

Using the Slots Testnet

Once you have your local node setup and imported your private keys/unlocked your accounts, you should be able to login to the platform and not see a "Not connected" error dialog. To use the slots, you will need to perform the following steps

  • Claim Faucet

    The faucet allows you to set your DBET balance to 10,000 DBETs with the click of a button which allows you to create multiple channels for testing purposes.

    Simply navigate to the top right of your screen and click on the claim faucet button. If you see an error message, please make sure you've imported/unlocked your logged in account within your local node and have ether in your account balance.

    You should see your balance update to 10,000 DBETs after the transaction gets confirmed on the network.

  • Getting slot chips

    Head over to the slots page and click on the Get Slots Chips button. Enter the amount of chips you'd like to receive. Make sure that the amount is lesser or equal to your current DBET balance. You should see your slots chips update after the transaction gets confirmed on the network.

  • Creating a channel

    To create a channel, click on the Crypto Chaos slot machine and enter the amount of DBETs (Between 100-1000) you'd like to initially deposit into the channel. Click on create channel and you should see the game show up under Available games after the transaction gets confirmed on the network.

  • Depositing to a channel

    Once the channel shows up in your available games list, click on the deposit button to deposit your chips to open the channel.

    Once the transaction gets confirmed on the network you should see the status change to **User deposited, waiting for house activation".

  • Playing slots

    Once the house activates the channel, you should see the Play button light up. Click on it to begin playing!

  • Closing a channel

    After you're done playing, you will need to close the channel before claiming your DBETs from the channel. First click the Close Channel button and wait for the transaction to get confirmed on the network.

    You will not be able to spin at this point in time. Once the transaction gets confirmed on the network, you should see the game get hidden and a message displaying "The channel has been finalized. Please wait a minute before the channel closes and claiming your DBETs."

  • Claiming your DBETs

    You will need to wait a time period of 1 minute on testnet before the channel status switches from finalized to closed. On mainnet this would be a larger time period for security purposes for each channel.

    Once a minute passes after the transaction gets confirmed, you will be able to claim your DBETs from the channel.

    Simply hit refresh and the button should light up, click on it and wait for the transaction to get confirmed on the network.

    To view your updated slot chip balances, head over to the previous slots page and you should see the balances updated based on the closed channel's game.

For instructions to try out Decent.bet's Sportsbook testnet, click here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment