Splinterlands Statistics v0.7.0 (Server mode + How to deploy on Synology NAS)

Splinterlands Statistics.png

Introduction

This new release has no new features. This release is more focused on how the tool can be deployed and started.

Some startup options has been changed. It is now possible to start up in a server mode so the battle scan is done every 90 minutes and portfolio is updated daily.

Now it is also possible to start up the application in an read only mode. This mode prevents account modification as well as disables investments deposit/withdraws.
It makes it possible to share with others if you would like todo that, without others messing up your data.

Previous posts:
v0.6.0 - Card overview + Nemesis expansion
v0.5.0 - Portfolio card edition and sps overview
v0.4.0 - Show categories in portfolio overview including history
v0.3.1 - Add generate hive blog
v0.2.0 - Add filter and sort options to home page
v0.1.0 - First implementation Splinterlands Statistics V2
Last "Old" Splinterstats tool V1

Main features of this splinterlands statistics tools are:

  • Capture battle history Win and Loss matched
    • What are your best cards
    • What are the cards you lose the most against.
  • Tracking your season results in playing and earnings
    • Generate hive blog of last season
  • View card statistics for an specific card
  • Tracking your portfolio, investment and value
    • View categories, CARDS/SPS/DEC/.. etc, at an certain time in history
    • View edition values and bcx count
    • View SPS (including staked SPS) value and quantity
  • Your nemesis (fun statistics)
    • Select enemy and view
  • Rating over time
    • View battle stats per day. Daily win rate modern and wild

What is new...

  • FIX: Home page default from date filter causing error when not loaded fully.
  • FIX: Deposit/withdraw exception without account
  • FIX: Update season end dates also when season update button is pressed. Was only done on startup not good with server mode
  • FIX: When a specific card is viewed that is no longer in you possession it did not generate the level correctly
  • Change use commandline arguments iso environment variables
  • Add read-only mode, unable to change accounts and deposit/withdraw investments
  • Add server mode, this will update battle/collection every 90 minutes, portfolio update daily
  • Add version info for released versions (thx to: @viniciotricolor)
  • Update add account, now updated directly (no wait for 90 minutes in server mode)
  • Update github workflows

Elaborate on the new features

Startup modes

The application has change from running with environment variable to runtime argument to get all the options you can start with --help
These are the current options:

  -h, --help            show this help message and exit
  -d, --debug           Enable debug mode
  -l {WARN,ERR,DEBUG,INFO}, --log-level {WARN,ERR,DEBUG,INFO} Set log level
  -s, --server-mode     Enable server mode
  -st STORE, --store STORE Specify a store
  -ro, --read-only      Read only

The two new options are -s and -ro.
With the -s option it will start in a server mode. This mean every 90minutes it will pull new battle information. When a new day is started also the portfolio is updated. to confirm it is in ready only mode the Daily update button is removed.

image.png

image.png

With the -ro option it will start in a read only mode it is not possible to add or remove new account also not possible to withdraw or deposit investments. With this option it is possible to share the site publicly with others if you would like.

image.png

image.png

How to deploy on Synology NAS

With the above changes it becomes easier to deploy it on a NAS or cloud environment.
In this short tutorial I will show how this can be done for an Synology NAS.
These step should be pretty similar for other systems that are able to run containers.

Before starting ensure your nas is capable to run docker containers and have the following packages installed:
image.png image.png

In container manager start an new project with the following settings:
Note: Path and volumes may differ in your situation

image.png

docker-compose.yml

version: '3'
services:
  splinterlands_statistics:
    image: gamerbeaker/splinterlands-statistics:v0.7.0
    command: ["-s"]
    volumes:
      - /volume1/docker/splinterlands_stats_store:/app/store
    ports:
      - "8050:8050"

image.png

Press next, check settings and press done this will lead you to the web store portal. Here you create and new web service portal for internal use.
image.png

Now if you go to your internal network: https://spl-stat:81/ you should be seeing splinterlands statistics page.

It is important to have an https connection else it is possible you will not see the copy report button for the seasonal hive blog
@viniciotricolor this is the point where if I selected http it will not show the copy hive button.

Version info

This was mention to me by @viniciotricolor. He was missing some version info. I totally agree so this is added to the main navigation bar. This shows which released version is running.

image.png

When you are using latest tag or and git clone of the main branch it will show latest.

image.png

Showcase some other features...

Main page

In this page you can find your most use best performance units or summoners when click on one you will go to the specific card overview. You can define you filters to specify your search.
For example if you would like to show your best performing unit with the standard ruleset with minimal 10 battles played in modern format.

image.png

Specific card overview

On this new page you can select you account and a specific card.
Note: only cards can be selected since the battles recording via this tool.

On the top an generic overview of the selected card.
image.png

Then with which card it is most paired with summoners and units
image.png

After that the most lost against cards with summoner and units are presented
image.png

Nemesis

On this page you can find information about who you lost most against. And when an certain player is selected you will get an result of the last played matched against that player and some stats.
image.png

In the end of the page there is still the overval nemesis, the most lost battles against an player
image.png

Rating

Daily battle statistics:
In my case modern are played by myself and wild by xbot.

image.png

image.png

Season result tracking

Seasonal battle statistics:
image.png

Summarized seasonal earning:
eos-earnings.png

Generate hive blog post about you last season:
image.png

Portfolio tracking

Tracking your complete portfolio value and view how your editions are valued:

image.png

image.png

View you staked SPS value over time and zoom in:

image.png

What is next...

  • Cleanup code
    • re-use filters
    • use id's iso of strings
  • Write how to deploy on cloud environment
  • Update losing page. Show cards that are not used or almost never used.
  • Make icons for navigation bar

How to use splinterlands statistics

⚠️When this tool is used for the first time and you are collecting seasonal data it has to retrieve all historical data, this can take a very long time, depnding on how long you have played the game and how many transaction are done. Especially when a renting bot is used it probably has many small DEC transaction.

With windows executable

With Docker

docker pull gamerbeaker/splinterlands-statistics:latest
latest can also be replaced by an release tag those can be found here:
https://registry.hub.docker.com/r/gamerbeaker/splinterlands-statistics/tags

Windows (docker):

docker run --rm -it -v C:\Temp:/app/store -p 8050:8050 --name splinterlands-statistics gamerbeaker/splinterlands-statistics:latest
For server mode
docker run --rm -it -v C:\Temp:/app/store -p 8050:8050 --name splinterlands-statistics gamerbeaker/splinterlands-statistics:latest -s

Linux (docker):

docker run --rm -it -v \tmp:/app/store -p 8050:8050 --name splinterlands-statistics gamerbeaker/splinterlands-statistics:latest
For server mode
docker run --rm -it -v \tmp:/app/store -p 8050:8050 --name splinterlands-statistics gamerbeaker/splinterlands-statistics:latest -s

With python development or local execution

Download source and unpack, source link.
Use python 3.8 or higher.
pip install -r requirements.txt
python src/main.py

When installing on a window machine and encounter this error message:
scrypt-1.2.1/libcperciva/crypto/crypto_aes.c(6): fatal error C1083: Cannot open include file: 'openssl/aes.h': No such file or directory
Then install Win64 OpenSSL (not the light version)

Disclaimer

This is an hobby project that I do in my spare time.
Why:

  • I love to dive into data for a game I love to play. In the future hope to see nice improvements in my playstyle because of the data analysis.
  • Secondly practice my programming skills and keep it up to date.

In the future I will try to migrate data with newer updates but expect that sometimes you got to start over with collecting data, I cannot/will not make any promises. I just add stuff I like to view and hope others can appreciate it.

Big caveat, not sure yet how it will perform with large datasets.

Everybody can start using this, since it is a new project expect some crashes or things that are not working for your situation.
As normal when you run into problems send me a message and I will try to help solving the issue.

Any suggestions/remarks/improvements or bugs please leave a comment or send me an message

That's all for this week hope you enjoyed reading and all start tracking data to get more insights.
See you all on the battlefield.

Not a splinterlands player yet, consider using my refferal link.



0
0
0.000
13 comments
avatar

This is great! Do you have a version for apple?

Thanks!

0
0
0.000
avatar

Hi,

I do not have a specific apple executable main reason i cannot test it :).
In the future I think i will not support the specific executables.
All operating systems can use docker so that might the main delivery.

Also for Mac you can use docker install docker:
https://docs.docker.com/desktop/install/mac-install/

Then you can use the command:
docker run --rm -it -v \tmp:/app/store -p 8050:8050 --name splinterlands-statistics gamerbeaker/splinterlands-statistics:latest
For server mode
docker run --rm -it -v \tmp:/app/store -p 8050:8050 --name splinterlands-statistics gamerbeaker/splinterlands-statistics:latest -s

I believe the Linux command is the same for mac.

If you run into any problems let me known i will try to help.

0
0
0.000
avatar

Thank you so much! I actually just got a new PC so I will be able to try it out. I'm a beginner, is there any tutorial or helpful tips you have for me? Thanks in advance!

0
0
0.000
avatar

Hi,

Sorry, not sure if I understand you, how to use the splinterlands statistics tool is described above for windows/linux and docker.

If want other information / tips / tutorial let me know on which topic so i could help you further if i can.

0
0
0.000
avatar

I would love a tutorial!

0
0
0.000
avatar

Stil not 100% sure where you want the tutorial on. At least let me give you small walkthrough the application.

Install the application:

Install Docker (assume in your case on mac):
https://docs.docker.com/desktop/install/mac-install/

Start application

In an terminal enter the following command
docker run --rm -it -v ~\store:/app/store -p 8050:8050 --name splinterlands-statistics gamerbeaker/splinterlands-statistics:v0.7.0
Note: Assume you have created an store directory in your home directory else replace ~\store for and other directory on you system

Setup accounts:

browse to: http://localhost:8050/config
Enter one account a the time.
This also pulls first daily information.

Pull season information:

Browse to: http://localhost:8050/season
Pres update seasons. The first time this can take an very long time.

Every Day

When you are done playing splinterlands battles for that day press update daily button.

image.png

Every Season

When you have claimed you season rewards is time to update you season statistics by pressing update season

image.png

What information can be found where

Home

http://localhost:8050/
Which card do you use most and their winpercentage

Losing

http://localhost:8050/losing
Which card do you lose most against

Card

http://localhost:8050/card
Specific card view which ruleset is this card most used and which which units do use it most often. Also to which unit is losing the most in you battles.

Rating

http://localhost:8050/rating
Shows your rating graphs of you battles and also you win percentage of the day

Nemesis

http://localhost:8050/nemesis
This who you lost most against. and when an opponent is selected also more detail on the battles.

Season

http://localhost:8050/season
Al season information on earning battles and win percentage.
Including the option to generate a hive post on it

Generate hive blog

This generates an hive blog which you can
image.png
press generate and wait copy text to an post via this button

image.png
Will only appear after generate button is done

Portfolio

http://localhost:8050/portfolio
This page will show you account value.
if you have multiple account here you can also combine them.

Add Investments

Here you can add investments. Lets say you deposit 50$ fiat into the game on an a certain date you can add this here so you can easy see the investment against value of your account.
This is only stored locally in your local store.

image.png

Hopes this give you some extra information on how to use it.

Also @viniciotricolor has created a small YouTube video about is only start in an different way with gitpod. but from 1:10 their he shows the application.
Not sure about you language but in this post
@viniciotricolor explains how he has done this.

0
0
0.000
avatar

Thank you so much! I really appreciate it!

0
0
0.000
avatar

It's a great tool; I recommend using it locally. Unfortunately, I can't help with that as I have no knowledge of how Mac works. You can try following the instructions given by beaker007 If that doesn't work, another alternative is to use a server via a web browser. In the video, I used an extension based on Chromium, despite its practicality. In Safari, simply type "gitpod.io/#" before the URL, like this:

gitpod.io/#https://github.com/gamerbeaker007/splinterlands-statistic

Clicking the link downloads the dependencies automatically and provides a temporary URL for use. It has its pros and cons. Using Gitpod requires creating accounts on third-party services since it's not possible to create the account in a standard way with email and password. I use the tool locally on my Ubuntu, but I need Gitpod for a solution to a problem I have in generating posts.

0
0
0.000