# TRTL.Services [![Signup Now!](https://i.imgur.com/VmsdmPs.png)](https://trtl.services) Today we are celebrating our *one millionth* block in style with the release of the TurtleCoin as a Service (TaaS) platform at [TRTL Services](https://trtl.services)! ## What is TRTL Services? TRTL aa Services provides the infrastructure and the tools for developers to **build on-chain apps in an easy, fun and fast way on the TRTL Network**. [![TRTL Services Architecture Flow Diagram](https://i.imgur.com/grmDQ8J.png)](https://trtl.services/docs) TRTL Services does this by offering access to a role-based access control RESTful API backed by an off-chain cache of your wallet. TRTL Services comes with a varitiety of tools, including: a push notification system; wallet monitoring and alert service; a dashboard with oversight and statistics; and a bundle of libraries in varies languages to get started right away. ## RESTful Application Programming Interace (API) [![Frontend API Flow Diagram!](https://i.imgur.com/EQN9eLZ.png)](https://trtl.services/docs) TRTL Services stores publically available data in an off-chain database, which users can interact with [via the RESTful API](https://api.trtl.services). This offloads the heavy duty work from the wallet to TRTL Services, improving stability and allowing developers to build more powerful and intensive apps. The workers scan every online wallet container on a one minute interval for new transactions, using the stored sub-addresses generated with the container and continuing from the last scanned block. Unconfirmed transaction are updated every minute by the system to reflect the number of confirmations, and checks if it has reached the minimal amount of confirmations required to unlock a transaction - this is configurable for each wallet container. ### Role Mangement Applications and users can interact with the API with a [JSON Web Token](https://jwt.io/introduction/) access token that is generated under each registered application in the TRTL Services Dashboard. Users can assign an expiration date to the token and which API methods it may interact with. ![](https://i.imgur.com/OYRorXJ.png) Access tokens are not stored by TRTL Services and should be treated as a secret key. It is wise to make use of multiple access tokens and take advantage of the roles and expiration features. ### Documentation [![API Documentation!](https://i.imgur.com/Fk4V1u4.png)](https://trtl.services/docs) The API documentation can be found at [trtl.services/docs](https://trtl.services/docs). Manuals and documentation on the TRTL Services Dashboard are still in progress - consider this to be your guide. ## HTTP Callbacks (Webhooks) A webhook is a HTTP callback (POST) that is triggered when an event occurs or when defined conditions are met. They interact with your application in an asycnhronous fashion and act as a push notification. ![](https://i.imgur.com/1nxXCPB.png) Users can register the route to their webhook endpoint under an app in the TRTL Services Dashboard. TRTL Servics provides HTTP callbacks for the following events ``query``: - Incoming transaction: `receive` - Outgoing transaction `send` - Transaction confirmation status: `confirm` - Transaction failure: `failed` - App / Wallet alerts: `alert` ## Dashboard TRTL Services offers an elegant dashboard where developers and merchants can manage their apps and wallet containers. It comes with a few tools, including: a simple overview and visualized statistics on registered apps and wallets; historical activity overview and export to CSV function; and error logging and alert overview. ### App Overview The overview dashboard provides a simple overview on the total and locked balance, as well as showing the a graph of the incoming vs outcoming total balance of the past seven days. ![](https://i.imgur.com/pX8GLhK.png) ### Wallet Monitor The wallet monitor page provides a quick glimpse on the status of your wallet. It checks for your wallet uptime every 10 minute, logging and sending a webhook on downtime. It provides a simple overview on the total number of addresses generated with the container and the transactions belonging to them. ![](https://i.imgur.com/qUkKfCY.png) Future plans include an modified version of [turtlecoind-ha](https://github.com/turtlecoin/turtlecoind-ha) that will allow direct interaction with the wallet container process, allowing much better control, logging and monitoring. ### Activity + Export to CSV Turtle Services offers complete historical logs regarding user accounts, apps and wallets. Each log can be viewed in the dashboard or exported with a click of a button. ![](https://i.imgur.com/0y8SC7Q.png) ### Alerts Part of the monitoring system includes an alert system in the Dashboard. Whenever there is a wallet or app process error it gets logged and a webhook is send out with the query ``alert``. Alerts can be viewed in the Dashboard and exported in CSV. ![](https://i.imgur.com/3klZtn0.png) Future plans include integrating it the alert module more closely with the wallet monitoring system once a modified version of [turtlecoind-ha](https://github.com/turtlecoin/turtlecoind-ha) is released. ## Libraries & Third Party Plugins To make things a little more easy, TRTL Services offers API wrapper libraries in [JavaScript](https://www.npmjs.com/package/ts-api-js), [PHP](https://packagist.org/packages/trtlservices/ts-api-php), [Go](https://godoc.org/github.com/trtl-services/trtl-api-go) and [Python](https://pypi.org/project/ts-api-py). Third party plugins for WHMCS, WooCommerce and Magento are either started or planned in the respective order. Development and progress can be viewed at our Gihub Organization [@trtl-service](https://github.com/trtl-services), along with two small examples in Python and JavaSript on how to generate an address, scan it for new transactions and store in a local SQL database - mind that these examples do not utilize webhooks. More detailed examples and tutorials will be published over the course of time. ## Use Cases TRTL Services has a wide range of application, ranging from small apps such as tipping bots to larger, more complex apps such as a payment gateway. Some potential ideas applications: - Integrate TRTL into a game as virtual currency - TRTL powered message board powered by tips - Crowdsourcing platform in TRTL - Tipping / wallet bot for social media platforms - Mobile apps ## Real World Case ### [turtlewallet.lol](https://turtlewallet.lol) [![](https://i.imgur.com/RoNLq9y.png) ](https://turtlewallet.lol) TurtleWallet has been operating on TRTL Services for six weeks now and is doing just fine! A simple online web wallet that is accesible on every device. Users can generate as many addresses as they please and send and receive transactions. The wallet comes with a pricing chart, price conversion and and allow users to export their keys. ## Limitations TRTL Services has a few limitations, however, few are due to design and most will get addressed. Limitations include, but are not limited to: - Privacy is reduced linking transactions to addresses in the database. - Sensitive stored data - the wallet RPC password is stored, encrypted. - Centralized point of attack