SteemChain - Charts & Analytics V1.3.0
Repository
https://github.com/Juless89/steem-dashboard
Website

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 blockchain.com 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/urls.py
path('//', CountData.as_view()),
# front-end/api/views.py
# 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 = datetime.now()
# 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')
else:
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 serializer.data[:-1]:
x.append(row['timestamp'])
y.append(row['count'])
# 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/views.py
# 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>
Comment
</a>
</li>
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/urls.py
path('', OperationView.as_view()),
# front-end/pages/views.py
class OperationView(View):
def get(self, request, *args, **kwargs):
return render(request, 'operation.html')
Split up operations.py
Commit: b3ab0619b678f0520b5d7f3aa6d335afe327341d
As recommended operations.py has been split up into smaller more manageable files.
operations_account.py
operations_comment.py
operations_custom.py
operations_escrow.py
operations_orderbook.py
operations_vote.py
operations_wallet.py
operations_witness.py
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.
Roadmap
- 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
Leave SteemChain - Charts & Analytics V1.3.0 to:
Read more #utopian-io posts
Best Posts From Steem-Python
We have not curated any of steempytutorials's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Steem-Python
- Python #7 part 1 - Advent of Code 2018 - Topological Sort
- Python #6 - Advent of Code 2018 - Distances between points
- Python #5 - Solving Puzzles from Advent of Code 2018 - String/character functions
- Learn how to program with Python #4 - Solving Puzzles from Advent of Code 2018
- Learn how to program with Python #3 - Solving Puzzles from Advent of Code 2018
- Learn how to program with Python #2 - Solving Puzzles from Advent of Code 2018
- Learn how to program with Python #1 - Solving Puzzles from Advent of Code 2018
- Part 4: Comparing orderbooks from different exchanges in real time
- Part 3: Connecting and managing multiple websocket streams in parallel
- Part 2: Manage local 'STEEM' orderbook via websocket stream from exchange
- Part 1: Connecting to STEEM orderbook stream via websockets on different exchanges
- SteemChain - Charts & Analytics V1.4.0
- SteemChain - Charts & Analytics V1.3.0
- Connect to multiple STEEM nodes in parallel to validate blocks
- SteemChain - Charts & Analytics V1.2.0
- SteemChain - Charts & Analytics V1.1.0
- New Project: SteemChain - Charts & Analytics
- Part 4: Adding live STEEM/SBD tickers
- Part 3: Combing Charts.js And Django Rest Framework
- Part 2: Using A Bootstrap Template To Parse STEEM Posts Via Beem API