You are viewing a single comment's thread from:

RE: Opening a NFT card shop in Splinterlands for $25+

in #splinterlands3 years ago (edited)

Hey buynano,

interesting tutorial, was also looking into buying card sets with python right now. There's just two thing which are puzzling me a bit:

1

Add owner.key
Make a new file called owner.key and place your hive owner key for the wallet you want to use. This is your private key so don't share it with anyone and make sure it's not network accessible.

By owner key, do you mean the private owner key of the account ? Or the Private posting key ? Because for neither operation you need the owner key. Active and posting are more than enough.

2 Is there a reason you are using the transaction builder instead of the custom json function on the hive instance itself ?

Sort:  

Thanks, good questions.

  1. You might need the active key? I just used owner because I'm lazy :)

  2. Hey there's a custom_json function https://beem.readthedocs.io/en/latest/beem.blockchaininstance.html#beem.blockchaininstance.BlockChainInstance.custom_json

I haven't tried this either but it looks legit. I was scared of messing up those transactions so I went straight API. I bet custom_json would work.

Edit: After thinking about it, (1) could be considered security issue so I issued an update.

about 1. yes, you absolutely shouldn't use the owner key unless necessary. its exposing the account to a small but unnecessary risk. unless someone gets a hold of your script and you stored it in the script itself. then your account is lost. since you can change the master password with your owner key. and with that all the other private keys.

about 2. it does essentially exactly what you are doing if you look at the beem source code. for examples just take a look at some of my tutorials. the lastest about submitting battles uses a lot of custom json stuff, the rental tutorial as well.

but essentially it works like this (you can load the keys through various other means, that is just the easiest for explaining):
hive: Hive = Hive(keys=[posting_privatekey,active_privatekey])

hive_id: str = "sm_stake_tokens"
request = {"token": "SPS", "qty": qty}
hive.custom_json(hive_id, json_data=request, required_posting_auths=["user"])

Nice hive.custom_json worked first try after reading the relevant portion of your automated rental tutorial.

As an aside, cool ai bot! I noticed the gpt-neox-20b(goose.ai) is available, it might be able to help in selecting/summarizing/rating content.

Great :) and you're talking about my curation bot ? yeah it might help. But right now i don't have any further plans for it. The bot was just based on simple latent semantic analysis and a random forest. Nothing too fancy.

Currently busy with splinterlands :)

Where can I find the tutorials you mentioned "for examples just take a look at some of my tutorials. the lastest about submitting battles uses a lot of custom json stuff, the rental tutorial as well."

hi @doominion, just click on my profile. they are all on my hive blog :)