Skip to content

Aptos Hackathon 2023: GoingOn is a Go application that leverages the power of NATS messaging system and Telegram bot API to process and send real-time notifications for Aptos transactions. The application listens for messages on a specific NATS topic, extracts relevant transaction data, and sends notifications via Telegram bot to specified chat ID.

Notifications You must be signed in to change notification settings

mikz0rz/aptos-hackathon-2023

Repository files navigation

GoingOn

Aptos Hackathon 2023

GoingOn is a Go application that leverages the power of NATS messaging system and Telegram bot API to process and send real-time notifications for Aptos transactions. The application listens for messages on a specific NATS topic, extracts relevant transaction data, and sends notifications via Telegram bot to specified chat ID.

Workshop Steps

To follow along with the workshop and see the code changes made in each step, you can refer to the following subrepositories:

  1. Step 0: Empty Boilerplate from Go SDK
  2. Step 1: Basic NATS Connecrtion Established
  3. Step 2: Added Stream
  4. Step 3: Added Filtering
  5. Step 4: Added Telegram Bot

Features

  • Listens for Aptos transaction messages on a NATS topic.
  • Extracts sender address, receiver address, withdrawal amount, and deposit amount from the transaction data.
  • Sends real-time notifications with transaction details to a specified Telegram chat ID.
  • Handles different types of events within the transaction, including deposit and withdrawal events.
  • Provides error handling and logging for improved reliability and troubleshooting.

Installation

To install and run the GoingOn application, follow these steps:

  1. Clone the repository:

    git clone [email protected]:SyntropyNet/aptos-hackathon-2023.git
  2. Navigate to the project directory if you want to start from a scratch:

    cd aptos-hackathon-2023/0-GoingOn-empty-repo

    OR test working demo:

    cd aptos-hackathon-2023/GoingOn
  3. Install the required dependencies:

    go mod download
    go get github.com/SyntropyNet/pubsub-go/pubsub
  4. Update the configuration:

    • Update the natsUrl constant in the main.go file with the appropriate NATS server URL.
    • Update the accessToken and in the next steps: botToken, and chatID constants with the corresponding values for your Telegram bot and chat ID.
  5. Build the application:

    make build
  6. Run the application:

    make serve

Usage

  1. Ensure that the NATS server is running and accessible (yep - it should be running because we have the best DevOps team in the world).
  2. Start the GoingOn application by running the executable generated in the dist directory.
  3. The application will connect to the NATS server and start listening for Aptos transaction messages.
  4. Whenever a relevant transaction message is received, the application will extract the required details and send a notification to the specified Telegram chat ID.

Makefile Usage

The provided Makefile is used for building, testing, and Dockerizing a Go application. It defines various targets that can be invoked using the make command followed by the target name.

Here is a short description of the available targets:

  • gen: Generate necessary files using go generate.
  • build: Build the production binary of the application using CGO disabled.
  • build-debug: Build the debug binary of the application.
  • test: Run all tests in the application.
  • serve: Run the development version of the program using the specified command ($(DEV_CMD)).
  • docker-build: Build the production Docker image using the specified Dockerfile ($(DOCKERFILE_PROD)).
  • docker-build-dev: Build the development Docker image using the specified Dockerfile ($(DOCKERFILE_DEV)).
  • clean: Remove the build artifacts (delete the $(DIST_PATH) directory).
  • all-tests: Run all tests and build the production Docker image.
  • help: Display a help message with a summary of the available targets.

To use the Makefile, open a terminal in the project directory and run make followed by the target name. For example, to build the production binary, you can run make build. Similarly, you can run other targets as needed for building, testing, running, or Dockerizing the application.

Support

Contact anyone from Syntropy.

Authors and acknowledgment

Beata Lipska, Andrius Mikonis, Povilas Žvaliauskas

Contributing

Contributions to the GoingOn project are welcome and encouraged. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request. Make sure to follow the repository's code style and guidelines.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute the code for both commercial and non-commercial purposes.

About

Aptos Hackathon 2023: GoingOn is a Go application that leverages the power of NATS messaging system and Telegram bot API to process and send real-time notifications for Aptos transactions. The application listens for messages on a specific NATS topic, extracts relevant transaction data, and sends notifications via Telegram bot to specified chat ID.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published