Public Repository

Last pushed: a year ago
Short Description
Official GameCredits Wallet client Docker image.
Full Description

GameCredits on the Docker Hub

GameCredits are a new and exciting gaming currency that will revolutionize in-game purchases and bring developers a monetization based on fair-play rules. Read more: https://onlinegames.credit/, https://wallet.gamecredits.org

What is this?

This is a container for the wallet client daemon. It helps developers setup their development environment easier and faster for making GameCredits powered apps.

How to run this container

  1. Start the container by entering this in your terminal:

    docker run -Pd -p 8332:8332 -v <datadir_location>:/root/.gamecredits thedivic/gamecredits /bin/gamecreditsd
    

    Replace the <datadir_location> with the absolute path to the folder where you want the client to download the blockchain. The wallet will start and then terminate because there it can't find the configuration file.

  2. Check if the <datadir_location> is not empty, it should contain the wallet files.

  3. Create a configuration file called gamecredits.conf inside your <datadir_location> with the following contents:

    rpcuser=<choose_a_username>
    rpcpassword=<choose_a_password>
    rpcallowip=*.*.*.*
    rpcport=8332
    server=1
    

    WARNING: these are development settings you should never use an IP wildcard *.*.*.* in production.

  4. Re-run the container by entering the same command from Step 1.

  5. Check if the container is running by running: sudo docker ps. The output should look something like this:

    CONTAINER ID    IMAGE   ...
    8820439d20d8    thedivic/gamecredits  ...
    

How to test if it works

  1. Install the python-bitcoinrpc module version 0.1 (it won't work with newer versions): pip install python-bitcoinrpc.

  2. Run the following script:

from __future__ import print_function
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import sys

# The USERNAME you set in your gamecredits.conf file
WALLET_RPC_USER = "gamecreditsrpc"    

# The PASSWORD you set in your gamecredits.conf file
WALLET_RPC_PASSWORD ="gamecreditsrocks" 

# If you are using Docker on OS X or Windows you should 
# replace localhost with your Docker Machine IP
WALLET_RPC_HOST = "localhost:8332" 


if __name__ == "__main__":
    connection = AuthServiceProxy(
        "http://%s:%s@%s" % (WALLET_RPC_USER, WALLET_RPC_PASSWORD, WALLET_RPC_HOST)
    )

    try:
        print(connection.getinfo())
    except JSONRPCException as er:
        print("%s" % er, file=sys.stderr)

The output should be some basic information about your wallet, like this:

{u'connections': 0, u'errors': u'', u'blocks': 0, u'paytxfee': Decimal('0E-8'), u'keypoololdest': 1465471767, u'walletversion': 60000, u'difficulty': Decimal('0E-8'), u'testnet': False, u'version': 90404, u'proxy': u'', u'protocolversion': 80006, u'timeoffset': 0, u'balance': Decimal('0E-8'), u'relayfee': Decimal('0.00001000'), u'keypoolsize': 101}

Running the wallet in regtest mode

For development purposes you should run the wallet in regression testing mode (let's you play around with fake money).

  1. First stop the wallet container process if it's already running. Run sudo docker ps, read the container_id and then run sudo docker stop <container_id>
  2. Run the container with the -regtest argument:
    docker run -Pd -p 8332:8332 -v <datadir_location>:/root/.gamecredits thedivic/gamecredits /bin/gamecreditsd -regtest
    
Docker Pull Command
Owner
thedivic

Comments (0)