Let's say I want to store my notes for the books I have read, on a decentralized blockchain.
Creating a post may not be the perfect fit since generally notes are very short-form content and you don't expect everyone to see it on interfaces like Steemit or Busy.
custom_json
Steem blockchain has a custom_json operation which you can actually post any type of JSON data into the blockchain. It's not really a post or comment so it doesn't show up in the Steemit.
Let's post a quote from the book "Code Complete".
from steem import Steem
from steem.transactionbuilder import TransactionBuilder
from steembase import operations
s = Steem(nodes=["https://rpc.buildteam.io"],
keys=["posting_key"])
account = "emrebeyler"
ops = [
operations.CustomJson(**{
"from": account,
"id": "notes.books",
"json": [
'add-quote',
{
"book": "Code complete",
"quote": "Reduce complexity. The single most important reason "
"to create a routine is to reduce a program's "
"complexity. Create a routine to hide information"
" so that you won't need to think about it."
}
],
"required_auths": [],
"required_posting_auths": ["emrebeyler"],
}),
]
tb = TransactionBuilder()
tb.appendOps(ops)
tb.appendSigner(account, "posting")
tb.sign()
tb.broadcast()
And after a couple of quotes, if I ever want to see my quotes:
import json
from steem.account import Account
account = Account('emrebeyler')
for custom_json in account.history_reverse(filter_by=["custom_json"]):
if custom_json["id"] == "notes.books":
action, data = json.loads(custom_json.get("json"))
print("Book: %s\n Quote: %s" % (data["book"], data["quote"]))
Which will result like that:
Pretty cool, huh? I am not sure if any of the 3rd party apps utilizing custom_json yet but it seems Hivemind will utilize it for the communities feature.
This is pretty useful. I think jussi will use this to batch transactions if I am not mistaken.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Cool! @randowhale used this in the past for the payout distribution to delegators, see here for example
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
For someone that scripts, this is very interesting. I've been wanting to create a rudimentary Steem RPG game and think this may be a good method of storing character stats.
Also, with @flagawhale, one of the difficulties I face is getting the rshares Delta's from the previous battle update. For background, we periodically pull rshares on those that downvote Haejin and slate it for rewards. I don't want to reward the values that had not changed and instead of fiddling around in Excel. Maybe this would be a better alternative as I would be able to run comparisons via python.
Thanks for sharing. Think this is going to help a lot to automate our process.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Sounds like a good use case! :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thx a lot!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hello from the future :)
Can you post how to do this with beem?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Ask this question on Python community ;)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Haha ... I would but then it will end up as a post on my feed ... and it will look like spamming a bit ... btw ... I found out how to do this :)
Slowly learning :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Nice!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Hi @emrebeyler!
I gladly voted you as witness. Good luck!
I will follow you and I hope you can find the opportunity to support one of my projects for making growin' up @steempostitalia, the italian community on Steemit: The Best Power Up of the Week
I think that could be really important, the project is already having great success.
If you are interested in starting any kind of collaboration with us, contact me.
Thank you so much!
See you soon
Girolamo
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Thank you! I will have a look to your power-up challenges.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
your every information is very important for steemit members.Thanks for share with us.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Wow, thanks for sharing that piece of wisdom. I saw the transaction type and was wondering what one can do with it. Now I know. I'm sure I can use this for SteemDesk in the future.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
very nice and helpful information to all of us @emrebeyler.
thank you for sharing your knowledge, hopefully healthy always for you who can share knowledge again
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I have a question. Is this custom json upvotable and can can you earn SBD from this data that you store on the blockchain ?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
No, that's the downside. It's not upvote-able content.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Great! Thanks!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Good!@
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
it's useful!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I appreciate you for this post. Thank you over a year later ^>^
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
hi i am facing the below error:
AttributeError: module 'steem' has no attribute 'steemd'
---> 22 _shared_steemd_instance = stm.steemd.Steemd(
23 nodes=get_config_node_list())
24 else:
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I got your message about voting for witness. I did.
Following you. Im working towards learning basic programming, perhaps I'll pick something up from your blog.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit