Coder Social home page Coder Social logo

dogecoin-arcade-fullstack's Introduction

Dogecoin Arcade Full-stack

NOTE: This is a work-in-progress and not for PRODUCTION! This is only a proof of concept purely for testing. It is highly discouraged to use this in a production manner because of security and efficiency issues.

How to run

NOTE: The dev server runs the database in memory, so all data will be LOST when server is restarted. Update .env files to use a different MongoDB server.

Setting up config files

Setting up client-server and dogecoind

Set up the client-server config by copying client-server/env.sample to client-server/.env and changing the values based on how dogecoind is setup.

Here are the default values:

MONOGODB_DATABASE_TYPE=memory
# If using server above, then you need to set the below settings
MONGODB_URI=mongodb://127.0.0.1:6000/
MONGODB_DB=arcade

ZMQ_PORT=9000
WEBSOCKET_PORT=7000
MONGODB_MEM_PORT=6000

RPC_USER='doge'
RPC_PASS='dogecoin'
RPC_HOST='127.0.0.1'
RPC_PORT='8000'
RPC_PROTOCOL='http'

USE_MEMPOOL_TX_ONLY=true
MIN_TX_CONF=1

VERBOSE_TX_LOG=false

USE_CACHE_ADDRESSES_ONLY=true

Change values accordingly in your dogecoin.conf and .env

The setup below would be run like this (running in regtest):

$ dogecoind -regtest -server=1 -rpcport=8000 -rpcuser=doge -rpcpassword=dogecoin -zmqpubrawtx=tcp://127.0.0.1:9000

Setting up frontend server

Set up the frontend-server config by copying frontend-server/env.sample to frontend-server/.env and changing the values based on how you setup MongoDB in client-server.

Here are the default values:

MONGODB_URI=mongodb://127.0.0.1:6000/
MONGODB_DB=arcade

Starting up frontend and backend

npm run install-deps # install deps (one time only)
npm run dev # start up frontend and backend

Starting up client

There is a python-based client (clients/python/client.py) and C++ based client (clients/cpp/client.cpp) (WIP).

Python

Setup

Edit the config vars in the python script (clients/python/client.py).

NOTE: These values will be overridden if found from database.

Example config vars:

# Config
arcade_cost = 5.0 # Default value
arcade_name = "Arcade Test #1" # Default value
arcade_id = "arcade_test_1" # This must unique
arcade_address = "momQpL2WzeQ97yHT4HaUVX4gByDomRQBnS" # Fallback address

Make any changes to python script to support your current setup.

Running
python clients/python/client.py

C++

NOTE: Linux support only (for now)

Setup

Edit the config vars in the C++ code (clients/cpp/client.cpp).

NOTE: These values will be overridden if found from database.

Example config vars:

// Config
double arcade_cost = 5.0; // Default value
std::string arcade_name = "Arcade Test #2"; // Default value
std::string arcade_id = "arcade_test_2"; // This must unique
std::string arcade_address = "momQpL2WzeQ97yHT4HaUVX4gByDomRQBnS"; // Fallback address

Make any changes to C++ code to support your current setup.

Running
npm run test-cpp # testing

Using the frontend

The frontend will run as localhost by default, look in your terminal (output of npm run dev) to find the URL.

In the Arcade Machines tab you can add a new arcade machine. If you put the same address as your client's config, it will get its cost and name from it, overriding the default values.

Created by Shafil Alam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.