Ready to set up PAXminer for your region? Great! There are some things you need to do. Don’t worry, it’s all easy. Follow these steps:
Setting up PAXminer in your Slack Workspace
Don’t worry, it’s a lot easier than it sounds. You must have admin privileges in your Slack workspace in order to do this. The first thing you need to do is just to tell slack “hey, I have something that will need to access my Slack environment from outside of the Slack system.” This is called an incoming webhook.
- From your Slack workspace, click on the workspace name dropdown menu -> Settings & Administration -> Manage Apps
- Click “Build” on the top right of your screen
- Click “Create New App”
- Enter App Name = “PAXminer”
- Select your F3 Workspace
- Click “Create” and then select “Incoming Webhooks” functionality needed for your app
- Turn on the “Activate Incoming Webhooks” toggle
- Click “Add New Webhook to Workspace”
- Slack will ask you “Where should PAXminer Post?” – select #general (or any Slack channel, it doesn’t matter for now. I created a temporary #debugging channel. Anything will work.
- Click “Allow”
- After creating the app, select “OAuth & Permissions” on the left side menu
Now, you need to grant PAXminer the appropriate permissions (Scopes) to be able to read and write to your channels.
- Click on “OAuth & Permissions”
- Under “Bot Token Scopes” – add the following list of scopes to it:
PLEASE MAKE SURE YOUR SCOPES ARE SET UP CORRECTLY!!! If not, it will throw permissions errors and Beaker gets annoyed having to ask you to fix it!
- Also under “OAuth & Permissions” – Find the “Bot User OAuth Access Token” and copy it. This shouldd be a big ugly string like “xoxb-XXXXXXX…”. Send this to Beaker (F3 STL) via slack DM. This is what he needs to get your region enabled.
- Finally, go back to the Settings -> Basic Information menu
- Find the PaxMiner.png image (https://github.com/srschaecher/PAXminer/blob/main/PaxMiner.png) and download. Use this to replace the app image under “Basic Information” near the bottom.
Connecting to the Database
We need a point person from each region to own the stats/process for the region. While it’s mostly hands off, I want you to know how the database works and how the data gets posted to it. This will help you with any QC that needs to happen, to help your guys if they have questions, and enables you to run ad-hoc reports if needed.
First step – download this database tool that will give you access to everything:
After installed, create a new database connection (click the little blue plug with a +)
Select MySQL 5 as the Database Type
Enter the following connection settings:
Server Host: f3stlouis.cac36jsyb5ss.us-east-2.rds.amazonaws.com
Database: <beaker will supply this to you>
Username: <beaker will supply this to you>
PW: <beaker will supply this to you>
After connecting, you will have read only access to all of the F3 region schemas so you can see how the data looks when populated. You will have full access to your region schema so you can take care of things as needed. You can interact with the various tables like a glorified spreadsheet, or you can run SQL statements if you know how or if you want to learn.
If you don’t have experience working with databases, don’t stress – it’s easy.
- Expand the tree on the left, open f3<your region>, and expand “tables”
- Right click on “aos” and select “View Data”
- You’ll see a spreadsheet layout. Find whatever channels you want to look in for BBs and double click on the “backblast” column. Change the 0 to a 1. A 1 means “PAXminer will look here for BBs”.
- CLICK SAVE at the bottom left of the screen! <- very important to save your changes
Next, make sure to invite your new @PAXminer app to your AO channels in Slack! This is an important step many people forget to do. If you don’t invite @PAXminer to the channel, it cannot access the posts to find the backblasts.
After setting your AO channels – you’re all set and ready to start posting backblasts to your Slack channels!
PAXminer runs automatically on the hour from 7AM-9PM CST. When any new backlist gets posted, PAXminer will attempt to import it at the next run time. The PAX posting the BB will be notified in Slack of success or failure.
Okay, I’ve posted some backblasts and received messages that they successfully imported. Now what?
Now, to SEE the data as it comes into the database, a few things to note. Across the various tables, users and slack channels are referred to with their Slack IDs. This is because names of channels and of users can (and often does) change in Slack, but the user ID does not. So when a PAX posts to a workout, you’ll see the workout show up in the “beatdowns” table, and each PAX that posted will show up in the bd_attendance table.
An example of what you would see from the “beatdowns” view is shown below at right.
The problem is, those are hard to read as it only uses the IDs. To make it more human readable, there are a few tables under the “Views” tab that automatically replaces the IDs with the AO names and the PAX names for you. So the “attendance_view” is essentially the same as the bd_attendance table, but it has the PAX names in it. Same with “beatdown_info”. The “backblast” view is basically the same as the beatdown_info view, except it also has the backblast text. This is the view that is used in your website if you choose to have BB’s shown there.
Stay on top of your region’s processes with PAXminer logs
Sometimes Q’s have an error in their BB and they just can’t seem to get it fixed. Sometimes a region adds a new AO channel to your Slack environment, but forgets to invite @PAXminer to the channel so it can’t access the BackBlasts. How can you stay on top of any issues that arise?
It’s easy to keep tabs on what is happening in your region. Simply add a channel to your Slack workspace called “paxminer_logs” and make sure to invite @PAXminer to it. That’s it! You’ll immediately see simple log messages to keep you posted on the health of your region’s BackBlast imports.
Note – I don’t recommend turning on notifications for this channel – as a log channel, it will get a short set of new messages every hour when PAXminer runs. This is a channel that you should check periodically for any issues.
Okay, you should now be up and running! Start playing around, get comfortable with it, and get creative! Make sure to check out how to add a “Backblast” page to your website, as well as some graphs to your AO pages.
Check out this page for example queries you can use to pull reports and data from PAXminer for your region.
If you aren’t already, please ask to be added to the #paxminer-and-slackblast channel in the Nation’s Slack!