GithubHelp home page GithubHelp logo

arseny271 / freeton-httpnotificationprovidercontest Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 3.0 1.46 MB

License: MIT License

HTML 14.14% TypeScript 22.16% CSS 14.02% JavaScript 47.58% Python 2.10%

freeton-httpnotificationprovidercontest's Introduction

HTTP Notification Provider Contest

Dependencies: MongoDb, NodeJs

Features

  • using multiprocessing
  • admin panel for the consumer

api docs https://api.events.ton.arsen12.ru/

statistics page https://events.ton.arsen12.ru/

Provider

start instruction

Copy the provider folder to your server.

Generate a keypair and write them into the secret/provider.keys.json. This keys will be used to sign the sent notifications.

Edit configs in configs folder:

  • provider-info.json - Provider information
  • config-mongo.json - Contains database url
  • config-kafka.json - Connection parameters for kafka
  • config-server.json โ€“
    • host, port - server api parameters
    • max_concurrency - maximum number of simultaneously processed messages
    • first_attempt_timeout - message timeout on first send ( if 0, no timeout )
    • next_attempts_timeout - message timeout on subsequent send
    • max_attempts - maximum number of retry attempts to send
    • retry_time_base - the base of the number to calculate the delay time between retransmissions. Time between dispatches is calculated as n^x, where n is retry_time_base and x is a number of unsuccessful attempts.

Run node init.js to initialize the database.

Run node index.js to start the notification provider.

Consumer

The consumer is an intermediate layer, he receives messages from the provider, decrypts them and forwards them to another address in accordance with the specified rules. In fact, it would be more correct to call this module a router For the convenience of users, the consumer has an admin panel. It simplifies consumer configuration and allows you to view the last received messages in decrypted form.

start instruction

Copy the consumer folder to your server.

Edit configs in configs folder:

  • config-mongo.json - Contains database url
  • config-server.json โ€“
    • receiverPort, receiverEndpoint - port and url for receiving notify from providers
    • adminPanelPort - port on which the admin panel will run

Run node init.js to initialize the database.

Run node index.js to start start the consumer.

More on how to subscribe to information here

Telegram bot

A bot is an example of a notification consumer. At startup, it starts listening to port 8924 and waits for decrypted messages there. The bot is available at the @ton_notifications_bot link. He sends messages to all users who have pressed /start about events on the network. To unsubscribe use /stop

start instruction

Run python3 init.py to initialize the database.

Run python3 bot.py to start start the consumer.

freeton-httpnotificationprovidercontest's People

Contributors

arseny271 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.