sa8ab / xmrchat

Message and Tip with Monero
https://xmrchat.com
Apache License 2.0
8 stars 2 forks source link


XMRChat
XMRChat

A Complete SaaS for Online Tipping Solution on Monero Cryptocurrency Network (XMR).

Overview

XMRChat is a tip-for-chat application. Users can set up a page and have others send chat messages in exchange for XMR. The application is built with a focus on privacy and security.

Table of Contents 🀸

Technology Stack πŸš€

Business Strategy: Payment

The service uses a one-time payment strategy. During the deployment setup process, you will need to provide your Monero wallet address and set the service price. After clients register, they will configure their page by specifying details such as name and unique URL path. Once the service price is paid, their page is now public, and they can share their page links with their audience to receive tips.

Requirements πŸ“

Project Structure πŸ“

Install & Build πŸ› οΈ

1. Traefik

First of all you must create network that containers communicate over it.

docker network create traefik

then setup the env

cd traefik
cp .env.example .env

Now change the .env with yours and run the container.

[!WARNING]
The password must be Hashed in the env and also if you add that in compose file the "$" characters must be doubled to not recognized as variable by docker engine.

docker compose up -d

2.1. Monero

Create and run a monero node. If you already have a synced node with zmq enabled skip to next step.

mkdir monero && cd monero
git clone https://github.com/monero-project/monero.git

In last line of Dockerfile comment out CMD Command.

# CMD ["--p2p-bind ...

2.2 Monero-LWS

Clone Monero-lws repository on branch release-v0.3_0.18:

git clone -b release-v0.3_0.18 https://github.com/vtnerd/monero-lws

From last line of Dockerfile remove ENTRYPOINT and CMD and replace it with only ENTRYPOINT ["monero-lws-daemon"]

Final Dockerfile will be ending like this:

...
EXPOSE 8443

ENTRYPOINT ["monero-lws-daemon"]

2.3. Run Monero and Monero-LWS

Add following docker-compose.yml to /monero directory we created on step 2.1 considering monero project ( step 2.1 ) is inside ./monero/monero folder and monero lws ( step 2.2 ) is on ./monero/monero-lws directory

services:
  monero:
    container_name: monero
    build:
      context: ./monero
    restart: always
    user: root
    ports:
      # - :80
      - :18080
      - :18081
      - :18082
      - :18083
      - :18084
    command:
      - --p2p-bind-ip=0.0.0.0
      - --p2p-bind-port=18080
      - --rpc-bind-ip=0.0.0.0
      - --rpc-bind-port=18081
      - --non-interactive
      - --rpc-ssl=disabled
      - --rpc-access-control-origins=monero
      - --disable-rpc-ban
      - --confirm-external-bind
      - --zmq-pub=tcp://0.0.0.0:18084
      - --zmq-rpc-bind-port=1882
      - --zmq-rpc-bind-ip=0.0.0.0

    volumes:
      - bitmonero:/root/.bitmonero
    networks:
      - traefik

  lws:
    depends_on:
      - monero
    container_name: lws
    user: root
    build:
      context: ./monero-lws
    restart: always
    ports:
      # - :80
      - :8443
    command:
      - --db-path=/home/monero-lws/.bitmonero/light_wallet_server
      - --daemon=tcp://monero:1882
      - --sub=tcp://monero:18084
      - --log-level=4
      - --webhook-ssl-verification=none
      - --disable-admin-auth
      - --admin-rest-server=http://0.0.0.0:8443/admin
      - --rest-server=http://0.0.0.0:8443/basic
      - --access-control-origin=lws:8443
      - --confirm-external-bind
    volumes:
      - monerolws:/home/monero-lws
    networks:
      - traefik

volumes:
  bitmonero: {}
  monerolws: {}

networks:
  traefik:
    name: traefik
    external: true

Run the container :

docker compose up -d

Because the Monero daemon must sync with the network, it may take a long time. You can monitor this process by checking the logs:

docker compose logs -f

After it is synced and ready, go next.

3. Server

cd server
cp .env.example .env

Change .env file with yours.

docker compose up -d

4. Client

cd client
cp .env.example .env

Change .env file with yours.

docker compose up -d

Development

For development you might not need monero or monero-lws if you don't make tips or create new pages ( any payments related to monero ). If you need lws instance access or can't run yours please contact us.

Server

Add your .env file based on .env.example.

Run backend locally with docker-compose.dev.yml file

docker compose -f docker-compose.dev.yml up -d

Then run the Nest project itself use node version more than 20.x.x

npm i
npm run start:dev

Client

Add your .env based on .env.example, then run the project:

npm i
npm run dev

License

This project is licensed under the Apache License 2.0. For the full license text, please see the LICENSE file in the root of this repository.

Notice

A NOTICE file has been included in the root of this repository. This file contains acknowledgments and notices required by the Apache License 2.0.

Pursuant to the terms of the Apache License 2.0, the NOTICE file must be included in redistributions of this software.