Skip to content

Bitcoin-Calendar/nostr-bot

Repository files navigation

⚡️zapmeacoffee

Bitcoin Calendar Bot

Archiving and relaying every Bitcoin milestone

bitcal-structure

Overview

The Bitcoin Calendar Bot is a Go-based application that fetches historical Bitcoin event data from the Bitcoin Historical Events API and publishes these events to Nostr relays. This bot automates the posting of calendar events about Bitcoin history.

Key functionalities include:

  • Fetching events from a configurable API endpoint.
  • Publishing events as Nostr Kind 1 (text-based) notes.
  • NEW: Publishing events as Nostr NIP-68 Kind 20 (picture-based) notes for events with associated images.
  • Support for English, configurable at runtime.
  • Metrics collection for monitoring event posting success and failures.

The project has recently undergone a significant refactoring to improve modularity and maintainability. Core functionalities such as configuration management, API interaction, logging, metrics collection, and Nostr event publishing have been moved into dedicated packages within an internal directory.

Getting Started

The recommended way to run the bot is with Docker and Docker Compose. For detailed setup instructions, please see the Installation Guide.

A typical workflow involves:

  1. Cloning the repository.
  2. Configuring your API and Nostr keys in a .env file.
  3. Building the Docker image with docker-compose build.
  4. Running the test bot with docker-compose run --rm nostr-bot-en-test to verify your setup.
  5. Setting up a cron job to run the production bot (nostr-bot-en) daily.

Project Structure

The main application logic is organized within the internal directory:

  • internal/config: Handles loading and validation of application configuration.
  • internal/api: Contains the client for interacting with the Bitcoin Calendar events API.
  • internal/logging: Manages logger setup and configuration.
  • internal/metrics: Provides a collector for tracking application-specific metrics.
  • internal/models: Defines shared data structures like APIEvent.
  • internal/nostr: Handles all Nostr-related operations, including event creation and publishing.

The main.go file serves as the entry point, orchestrating these components.

Documentation

License

This project is licensed under the MIT License. See the LICENSE.txt file for details.

Contributing

Contributions are welcome! Please see our Contributing Guide for details.

Support

Support Bitcoin Calendar via Coinos

  • Bitcoin Calendar EN ⚡️ bitcal@coinos.io 🔗 Coinos page

Support Bitcoin Calendar on Geyser

...or 👇

⚡️zapmeacoffee

About

A bot relaying historical Bitcoin and FOSS milestones to Nostr

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published