GitHub - DataLayerHost/txms-server: TxMS server (original) (raw)

Utilize this server to develop your unique TxMS webhook, securely deployed with Caddy and Let's Encrypt powered by Hono API.

Services

This server provides the following services:

Installation

Requirements

Setting Up Environment Variables

Create a .env file or use Docker Compose to set environment variables.

The necessary environment variables are:

Docker Deployment

This project includes a Docker setup using Caddy as a reverse proxy and Let's Encrypt for HTTPS.

sudo docker run -d
-e LETS_ENCRYPT_EMAIL=txms@onion.email
-e DOMAIN_NAME=main-ep1.txms.info
-e MMS=false
-e PORT=8080
-e PROVIDER=https://blockindex.net
-e ENDPOINT=api/v2/sendtx/
-e LOG_LEVEL=info
-p 80:80
-p 443:443
-v $(pwd)/caddy_data:/data/caddy
-v $(pwd)/caddy_config:/config/caddy
--name txms-main-server
ghcr.io/datalayerhost/txms-server:{version}

Note: Customize your setup and replace {version} with the latest release version.

We are providing customized Docker images for the server. You can use the following images:

Docker Compose Example

Create a docker-compose.yml file in the project root:

version: '3.9'

services: txms-server: image: ghcr.io/datalayerhost/txms-server:latest container_name: txms-server restart: always environment: - LETS_ENCRYPT_EMAIL=user@onion.email - DOMAIN_NAME=main-ep1.domain.lol - MMS=false - PORT=8080 - PROVIDER=https://blockindex.net - ENDPOINT=api/v2/sendtx/ - LOG_LEVEL=info ports: - "443:443" - "80:80" volumes: - ./caddy_data:/data/caddy - ./caddy_config:/config/caddy

Replace the placeholders with your actual values:

Building and Pushing Docker Image

To automate the Docker image build and push process upon creating a release, GitHub Actions is configured.

The workflow file .github/workflows/release-docker-image.yml handles:

Firewall Rules

Ensure the following ports are open:

sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw reload

Enable and test the firewall:

sudo ufw enable sudo ufw status

Endpoints

Connectors

The server is designed to connect with the following blockchain providers:

Blockbook can be substituted by connecting directly to a Blockchain node. However, streaming transactions is only possible after the node is fully synchronized, which significantly increases the server's resource requirements. To avoid this, we opted to use external services. If you require a node-based solution, please consider using RPC connector.

Free and Paid Plans

This service is 100% free for everyone and lifetime.

However you can decide to make it as a paid service, you can do it by:

To do so, you can modify the code and create database of numbers, which paid for the service. We will be happy to help you with that or you can contribute to the codebase.

SMS and MMS

The server can handle both SMS and MMS messages. To enable MMS, set the MMS environment variable to true.

MMS messages can contain attachments (content type: text/plain), which are fetched and forwarded to the blockchain provider. Ideally set extension as .txms.txt. You can generate them using the TxMS Encoder and function downloadMessage.

Pricing for SMS and MMS services may vary depending on the provider. Please check with your provider for more information.

Contributing

We welcome contributions from the community. To contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes.
  4. Commit your changes.
  5. Push your changes to your fork.
  6. Create a pull request.

Please ensure your code is well-documented and follows the project's coding standards.

Respect the license and do not close the code for public (there is no need for it).

License

This project is licensed under the CORE License.