SteemChain - Charts & Analytics V1.3.0

in #utopian-io3 years ago (edited)



What is SteemChain?

SteemChain in an open source application to analyse transactions and operations from the STEEM blockchain. Store these into a MySQL database and visualise with charts and tables via the web. Looking to bring data analytics to STEEM like websites as do for Bitcoin.

New Features

Removed minute and hour resolution for now, added 365D delta

Commit: 455da0dea3d03be4ce1f40316a666c3e21b2d012

As Chart.js is not suited to handle large amounts of data points, for now the minute and hour resolution have been removed. The default is set to day. The periods have also been adjusted to accommodate this change. In addition a 365 day delta has been added.


Added all operations types to the front-end

Commit: ce036d351e571cd01e3012274158c98d339a90a2

To enable easy scaling to all operation types a dynamic view has been created to retrieve chart data. All variables are retrieved from the path.

# front-end/api/

path('<slug:type>/<slug:delta>/<slug:period>', CountData.as_view()),

# front-end/api/

# API for count chart data
class CountData(APIView):
    # Unused user authentication classes
    authentication_classes = []
    permission_classes = []

    def get(self, request, format=None, *args, **kwargs):
        # get resolution, period and operation type
        delta = kwargs['delta']
        period = kwargs['period']
        operation = kwargs['type']
        end =

        # get operation count model
        self.model = get_model_count(operation)

        # calculate start
        start = get_start_day(period, end)

        # ALL or specific periode
        if start:
            ticker = self.model.objects.filter(timestamp__range=(start, end)).order_by('timestamp')
            ticker = self.model.objects.all().order_by('timestamp')
        serializer = VotesCount(ticker, many=True)

        x = []
        y = []

        # Omit last result, append data into lists
        for row in[:-1]:

        # datastruct for response
        data = {
            "label": '# of operations',
            "labels": x,
            "data": y,

        return Response(data)

The correct database model is retrieved by calling get_model_count. I was unable to figure out a way to dynamically link the operation to the correct model, as the models are classes. This resulted in rather large if/else statements.

# front-end/api/

# return count model for operation type
def get_model_count(operation):
    if operation == 'votes':
        return votes_count_day
    elif operation == 'transfers':
        return transfers_count_day
    elif operation == 'claim_rewards':
        return claim_rewards_count_day
    elif operation == 'delegate_vesting_shares_operation':
        return delegate_vesting_shares_operation_count_day

Linking to each operation type has been made simple by maintaining the same naming scheme as the STEEM blockchain.

# front-end/templates/index.html

<li class="nav-item">
    <a id="comment_operation" class="nav-link" href="/comment_operation">
        <span data-feather="file"></span>

The operation type is then captured and send to the dynamic OperationView which uses a new dynamic operation.html to retrieve and plot the chart.

# front-end/pages/

path('<slug:operation>', OperationView.as_view()),

# front-end/pages/

class OperationView(View):
    def get(self, request, *args, **kwargs):
        return render(request, 'operation.html')


Split up

Commit: b3ab0619b678f0520b5d7f3aa6d335afe327341d

As recommended has been split up into smaller more manageable files.

Next update

The next update will look to replace Charts.js for a more suitable charting library.

Known issues

  • At the moment if no operation occurred in a specific period, the period does not get added. By default this should be set to 0.


  • Replace Charts.js for a library that is better equipped to deal with large amounts of data points and has a zoom function
  • Add analytics for all operation types
  • Add user analytics
  • Create a daily automated report of important data posted to a STEEM account
  • Create an overview with most relevant data as the home page
  • Write documentation

GitHub Account



Hi @steempytutorials!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @steempytutorials!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support!
Simply set as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord

Vote for Utopian Witness!