Repository
https://github.com/Juless89/steem-dashboard
Website
http://www.steemchain.eu(syncing with blockchain atm)
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
Expanded to all STEEM operation types
Commit: 3cc40bd48df755a259f37b0e8fc8996b0c53c4eb
For this update all different operation types that the STEEM Blockchain has to offer have been added. This includes the processing and storing of the operation and keeping track of statistics for charting purposes. The amount of operation types tracked increased from 3 to 31. Which can be divided over the next categories.
# all operation types
# voting
vote_operation
# orderbook
limit_order_create_operation
limit_order_cancel_operation
# comments
comment_operation
comment_options_operation
delete_comment_operation
# witness
feed_publish_operation
witness_update_operation
# custom
custom_operation
custom_json_operation
# wallet
convert_operation
delegate_vesting_shares_operation
transfer_operation
transfer_from_savings_operation
transfer_to_savings_operation
transfer_to_vesting_operation
cancel_transfer_from_savings_operation
set_withdraw_vesting_route_operation
withdraw_vesting_operation
claim_reward_balance_operation
# account
account_update_operation
account_create_operation
account_create_with_delegation_operation
account_witness_proxy_operation
account_witness_vote_operation
recover_account_operation
request_account_recovery_operation
change_recovery_account_operation
# escrow
escrow_release_operation
escrow_transfer_operation
escrow_approve_operation
All operation types inherit from Operation. For each unique type different data is extracted which can be used for analytics. In addition for each operation type up to several variables are tracked over time for charting. Each operation type includes at least the count
. Also tracked are volume of currencies and several other variables. All class objects are stored inside operations.py
removing the need for individual files for each operation.
class Transfer_from_savings_operation(operation.Operation):
def __init__(self, table, storage, lock, scraping=False):
operation.Operation.__init__(self, table, storage, lock, scraping)
def process_operation(self, operation):
# deconstruct operation and prepare for storing
value_from = operation['value']['from']
value_to = operation['value']['to']
amount = operation['value']['amount']['amount']
nai = operation['value']['amount']['nai']
self.db.add_operation(
value_from=value_from,
value_to=value_to,
amount=amount,
nai=nai,
timestamp=self.timestamp,
)
# Allow for multiple resolutions
hour = self.timestamp.hour
minute = self.timestamp.minute
# Chart data
steem = 0
sbd = 0
if nai == "@@000000021":
steem += float(amount)
elif nai == "@@000000013":
sbd += float(amount)
data = {
"count": 1,
"steem": steem,
"sbd": sbd,
}
self.counter.set_resolutions(hour, minute, **data)
Django was used to set up all database models for easy integration with the front-end. Each unique operation type has 4 different models: the operation, count/minute, count/hour and count/day. In all cases the timestamps are index for more efficient time bases analytics.
# =======================================================
#
# wallet
#
# =======================================================
class transfers_count_minute(models.Model):
count = models.IntegerField()
steem = models.TextField()
sbd = models.TextField()
timestamp = models.DateTimeField(db_index=True)
class transfers_count_hour(models.Model):
count = models.IntegerField()
steem = models.TextField()
sbd = models.TextField()
timestamp = models.DateTimeField(db_index=True)
class transfers_count_day(models.Model):
count = models.IntegerField()
steem = models.TextField()
sbd = models.TextField()
timestamp = models.DateTimeField(db_index=True)
class transfers(models.Model):
sender = models.CharField(max_length=25)
receiver = models.CharField(max_length=25)
amount = models.TextField()
precision = models.TextField()
nai = models.TextField()
timestamp = models.DateTimeField(db_index=True)
Next update
The next update will focus on the front-end. Creating a dynamic view to easily extract the correct chart data from the database while keeping it simple with the 31 different operation types. As well as adding the buttons for all operation types.