- Telegram: @rukavkov
- Surf: 0:392300ae37bdccb044a8e2ba13f9f3a2f966f26c53a776bc10706f2ed591487d
Repository(actual readme): https://github.com/nrukavkov/freeton-notification-service
FNS (FreeTON Notification Service) is a http service allows you to forward encrypted messages from FreeTON Network to http(s) web services and Telegram.
- Guarantee delivery: no one loss even a server or service unavailable. FNS will repeat to try send a callback until it is done. Or until you want to stop it.
- Easy to use auth system: just press the link and get an access to the private area.
- Forward messages to http(s) and telegram.
- Super user permissions for administration the service.
- Visual pretty interface for quick seach and detect problems.
- Easy deploy to Kubernetes.
- API
- Logging errors and many other things...
Before start using FNS you need to have.
-
Serf wallet.
-
External web address for receiving messages. For testing enough to use services like https://webhook.site. Open https://webhook.site and press the link
https://webhook.site/0f0b0f73-11d8-4074-bd70-e03be5e19dee
. You will receive an external https address which could be used for testing later. Do not forget enableCORS Headers
. It is very important for testing.
-
Open Serf and log in using your credentials.
-
Switch to Test Network and get some Ruby using https://faucet.extraton.io/.
-
Open Debot using Debot Browser or link. After the siging two transactions you will see the menu.
- Press the button
Send callbackUrl | deviceToken to provider
and choosegithub.com/nrukavkov/freeton-notification-service, ID = TNS
from the list. Then enter data to the provider. By default you can use two types: HTTP(S) or TELEGRAM. Example of usage:https://webhook.site/0f0b0f73-11d8-4074-bd70-e03be5e19dee
telegram://someChatId
ℹ️ Before receiving messages to Telegram, you have to create Telegram Bot using Bot Father, save Bot Token
and add your bot to the some channel.
Open the secret link
starts with https://freeton-notification-service.voip-lab.ru/login/{your_secret_api_key}
and get an access to the private are where you can change your profile settings.
Also here you can see all messsages and status of delivery.
If you want to get more detailed info just press the ➕ near the intrested message.
- Then you need to
Set Rules
and follow the instruction received from Debot. At the first line you need to set up ID. In our case it will be generatedID=TNS
. And the second line will be an address in blockchain and message type. Example of rules:
ID=TNS
# HERE YOU NEED TO USE YOUR OWN ADDRESS. IT IS JUST EXAMPLE.
0:392300ae37bdccb044a8e2ba13f9f3a2f966f26c53a776bc10706f2ed591487d all
ℹ️ For testing you can use your personal wallet address.
- Final step try to send some Rubi to addreess you set before. A few seconds later you will get POST requests to your endpoint.
If you want you can use self hosted version of FreeTON Notification Service. In this case you can have admin rights. It allows you to see all messages and enpoints. To get admin rights just set in mongodb isAdmin
field to true
for your endpoint.
POST
/
- set new endpoint
GET
/endpoint
- return all available endpoints
DELETE
/endpoint:id
- delete endpoint with ID
GET
/message
- get all my messages
DELETE
/message/:id
- delete message with ID
The primary instance installed in Kubernetes Cluster. But you can start it locally using docker-compose up --build
command. Required docker-compose and docker installed and .env
with variables:
MONGODB_CONNECTION_STRING="mongodb://USERNAME:PASSWORD@HOST_OR_IP/DATABASE?authSource=admin"
SALT=CHANGE_ME
KAFKA_USERNAME=CHANGE_ME
KAFKA_PASSWORD=CHANGE_ME
KAFKA_MECHANISM=scram-sha-512
KAFKA_TOPIC=CHANGE_ME
We use HELM and WERF for deploying the application to kubernetes.To do it just use the command below
werf converge --repo=ghcr.io/nrukavkov/freeton-notification-service
werf run app --docker-options="-ti --rm -p 8000:8000