Podping is preparing for Hard Fork HF26 and HiveFest

in #hf262 years ago (edited)

It's a long time since I've updated on Podping and that's mostly because Podping is just working!

There are two vital posts for more background on the current fakenet/testnet and how to use it. I'll add some extra colour that will hopefully help some other Dapp devs.

https://peakd.com/hive-160391/@gtg/full-public-fake-mirror-api

https://peakd.com/rc/@howo/direct-rc-delegation-documentation

https://peakd.com/hive-139531/@blocktrades/14th-update-of-2022-hive-hf26-release-candidate-and-mirrornet-api-node-ready-for-app-testing

Fake API endpoint: https://api.fake.openhive.network
Fake chain-id: 4200000000000000000000000000000000000000000000000000000000000000

What is Fakenet

Fakenet is not quite the same as a self contained testing site as I think we've had in the past. Fakenet carries ALL the main traffic of Hive but additionally, you can write to Fakenet. Writing to Fakenet is like partying in Vegas: what happens in Fakenet stays in Fakenet.

For normal users, I suggest you don't try this because it really will get confusing. You'll like something, or change a delegation or make a transfer and it won't really happen. The problem is that if you're using HiveKeychain you have to be extremely careful over which RPC Node (also called API Nodes) you are interacting with and which the website you're looking at is using on the back end.

I won't pretend to be an expert but I'm sort of treating it a bit like I would treat a public space in Vegas: I'm not doing stuff I wouldn't be horrified about if it leaked out.

So don't go transferring 50,000 HBD to @brianoflondon on Fakenet (well you can) unless you're really really sure you're on Fakenet!

Viewing Fakenet

I'm using a few sites but one of my favorites is @ausbitbank 's site and it has both Fakenet and real.

Fakenet: https://test.ausbit.dev/@podping.bol
Real Hive: https://hive.ausbit.dev/@podping.bol

Side by side Hive, real on the left, fake on the right

They look the same (Ausbitbank should probably change the background on the Fakenet) but the one on the left is real and the one on the right is Fakenet, you can see different content and different resources. This is one of the primary things I've been playing with.

There's also a Condenser based version:

https://testblog.openhive.network/
https://testwallet.openhive.network/

You can sign in and view these sites without making any changes to HiveKeychain, but if you want to make changes ONLY on Fakenet you need to change HiveKeychain.

Hive Keychain

Setting the RPC Node in Hive Keychain

The subtle clue you're on a Fakenet

In Hive Keychain you need to add a new RPC node (Advanced-RPC Node) and give the node and the chain ID (42 with lots of 0's).

From then on be very very careful what you do on main net. Again I'm not recommending normal users try this, there really is no noticeable difference for end users.

As a suggestion to @stoodkev and the team, perhaps you could change the background colour of Keychain when you're connected to a different chain ID?

Python Specific Preparations for HF26

There are two main Python libraries for interacting with Hive. Beem is the big boy but there are issues with getting it updated though it still seems to work.

However we've actually switched from Beem to Lighthive (maintained by @emrebeyler).

Beem

Beem is quite easy to move onto the Fakenet. The usual method of connecting to Hive without specifiying a node, just works. All you have to do to switch is add node=["https://api.fake.openhive.network"]. Little gotcha is to remember that you're not passing one Node, you're passing a list (with only one item in it).

hive = Hive(node=["https://api.fake.openhive.network"])

Lighthive

Lighthive is pretty easy too. You just alter the call to get the main Client with the added wrinkle that you must manually pass the ChainID (I think, not sure it might work without it!). Just for a bit more help I'll show you the complete function call we have in Podping-Hivewriter:

def get_client(
    posting_keys: Optional[List[str]] = None,
    nodes=None,
    connect_timeout=3,
    read_timeout=30,
    loglevel=logging.ERROR,
    chain=None,
    automatic_node_selection=False,
    api_type="condenser_api",
) -> Client:
    try:
        if os.getenv("PODPING_TESTNET", "False").lower() in (
            "true",
            "1",
            "t",
        ):
            nodes = [os.getenv("PODPING_TESTNET_NODE")]
            chain = {"chain_id": os.getenv("PODPING_TESTNET_CHAINID")}
        client = Client(
            keys=posting_keys,
            nodes=nodes,
            connect_timeout=connect_timeout,
            read_timeout=read_timeout,
            loglevel=loglevel,
            chain=chain,
            automatic_node_selection=automatic_node_selection,
        )
        return client(api_type)
    except Exception as ex:
        raise ex

and we have the following in a .env to make this switch onto Fakenet:

PODPING_TESTNET=true
PODPING_TESTNET_NODE=https://api.fake.openhive.network
PODPING_TESTNET_CHAINID=4200000000000000000000000000000000000000000000000000000000000000

Once you've done that you can now read from and write to the Fakenet.

RC Delegations

A few gotcha's. I have not been able to change HP delegations with Hive Keychain alone. I can, however, change delegations on Fakenet using https://testwallet.openhive.network/@brianoflondon/delegations and Hive Keychain set to the Fakenet RPC node.

The reason I'm doing this is to test what happens when I reduce delegations to the main active podping accounts and then substitute HP delegation with RC delegation.

My main learning so far is that there will be a transition period where I will have to un-delegate HP from these accounts and replace that with RC delegations.

I suspect I'll have to use my @brianoflondon account to delegate HP to the sub accounts and then remove delegations from @podping. Once a week or so has passed and that HP returns fully to @podping, I will then delegate RC's and can remove the HP delegation from @brianoflondon.

A few little learnings that might help others:

  • Custom_json's are more expensive than before, but not cripplingly so;
  • Account creation token claims ARE much more expensive so they drop your RCs on the fakenet, far lower than on real Hive. As such I'm turning off auto-claiming of these on BrianofLondon for a little while;
  • There's no front end for delegating RC's yet. I've had to write my own code but I'm not a front end dev so I really can't share it.
  • The One Block Irreversibility is amazing. Using the block viewer on https://test.ausbit.dev it is obvious immediately because you can see a custom_json appear as fast as you can switch windows!

Hivefest

Just a short note: last year I spoke mostly about @v4vapp and podcasting and not about @podping. This year I'm going to try to explain what Podping actually is and what problem it solves for Podcasting.

Conclusion

I actually haven't had to change pretty much anything on the main Podping-Hivewriter software. I've only made tweaks to allow for testing. On the reading side of Podping no changes should be necessary which is excellent so a huge thank you to @blocktrades @howo and the whole team who keep this thing forging ahead so brilliantly. I have the utmost respect for all of you.

Happy to hear feedback and corrections if I've made any errors and I hope this helps!

Sort:  

Account creation token claims ARE much more expensive

Not true - they are exactly as expensive as on mainnet down to 5th digit. But there is a catch. RC costs on fakenet are influenced by situation on fakenet, and as close as it is to mainnet, there are still differences (after all it was made so people can try doing things they didn't do on mainnet).

curl --request POST --url https://api.fake.openhive.network/ --header 'Content-Type: application/json' --data '{"jsonrpc": "2.0", "method": "rc_api.get_resource_pool", "params": {}, "id": 1}'

Replace api.fake.openhive.network with api.hive.blog for values from mainnet.

When I'm writing this, resource_new_accounts pool on fakenet is 10729483 while it is 11952076 on mainnet. Since each token is 10000 units, it means that fakenet has 122 less tokens available. For the pool that is exhausted so much such difference in fill level means big difference in RC cost, and big relative difference in RC cost for the most expensive resource means huge difference in absolute value of that cost.

In conclusion, you can't really compare RC costs in this particular case. When comparing apples to apples, for your @brianoflondon account, the average cost of claim_account_operation changed from 9'372'413'894'817 with old rules to 9'372'452'227'838 with new rules (data collected from up to block 66.3M). It means that after claiming a token, now you need to wait 0.12s longer for RC mana to recover in full (new - old = 38'333'021; max mana of 136'853'962'413'867 - value from block 66.3M - means you recover that much over 5 days = 432000 seconds, meaning 316'791'579.66 every second).

Refer to this article for more details on how RC costs changed between old and new version and what are the factors that influence them.

Thanks for this, I can't say I'm finding it very easy to figure out what the RCs actually used for a transaction are or will be. Are these available after the fact for a given transaction?

Right now I'm making a kind of watcher that looks that the resource credits across a group of apps and hands them out if they need more.

There is no easy way to predict RC cost, but you can somewhat get to know what you've already paid. It is the easiest if you have your own node. Having your own node means you can write your own plugin or even add notifications/logs directly to the place that charges your account(s). It is also easy to differentiate between "present" (state from the blocks which can be treated as solid) and "future" (pending state). If you don't have your own node, then you can only use something like rc_api.find_rc_accounts to monitor your accounts. However, if you wanted to use that to see exactly how much you've paid for each transaction, it gets tricky. Typically you only see the "future" when using API, so you'd need to make sure that "future" and "present" are the same, that is, first wait until your transaction gets into block using transaction_status_api.find_transaction, then look for your account's RC and compare it with what it had before transaction. The tricky part is that if you make another transaction in the meantime, you won't be able to tell the cost properly. Also if you are using some service that can f.e. vote in your name, then it can make you the RC payer, not just for your own vote, but for all the votes in the transaction it sent. In normal situation there is little difference between "present" and "future", but during high traffic "future" can be distorted, and in case of highly contested resources, like new account tokens, it can happen that you've claimed your token and "future" shows you've paid 9T RC, but before it becomes "present" some whale claimed 100 tokens and now your token costs 12T RC (it might even happen that you'll no longer be able to afford it and your transaction that was accepted as pending will never make it to the block - these are the dangers of looking into the "future").

BTW can you point me in the direction of where the data for this panel comes from and how it is calculated? Especially the recharge rate.

image.png

I'm guessing here, but everything tells me that the values with HP and M as units use the same procedure for recalculation. The value is calculated from raw RC using current price of VESTs.
Calculating on raw RC values is simplier. Since your RC regenerates from 0 to 100% during 5 days, just take max_mana and divide it by whatever period you want to calculate, that is, 5 for daily recharge rate, 120 for hourly recharge rate, 7200 for minute recharge rate etc. The result is going to be expressed in raw RC values as well. Only now you can treat it as amount of VESTs (which have 6 fractional digits) and using current price recalculate it to HP/M presented in the panel.

Thanks for testing! :-)


The rewards earned on this comment will go directly to the people( @taskmaster4450le ) sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.

🤞🏻 Good luck for your presentation at HiveFest @brianoflondon! Unfortunately I cannot make it but if there is a livestream or a recording I will tune in.
Podping is a great tool which needs much more awareness. Maybe there is also some Apple or Spotify people that hear your Keynote. 😉

Regards Thomas

Agreed! I'll be cheering you on @brianoflondon all the way from Texas.

👏🏻 Hey Jennifer! We cheer together. “Go Brian!” 💪🏻

Congratulations @podping! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s):

You received more than 500 upvotes.
Your next target is to reach 600 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out the last post from @hivebuzz:

New badge - LEO Power Up Day - September 15, 2022
HiveFest⁷ badges available at the HiveBuzz store
HiveFest⁷ meetup in Amsterdam is next week. Be part of it and get your badge.

Congratulations @podping! Your post has been a top performer on the Hive blockchain and you have been rewarded with the following badge:

Post with the highest payout of the day.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out the last post from @hivebuzz:

New badge - LEO Power Up Day - September 15, 2022
HiveFest⁷ badges available at the HiveBuzz store

Excellent

Dear, @podping

May we ask you to review and support our @cryptobrewmaster GameFi proposal on DHF? It can be found here

If you havent tried playing CryptoBrewMaster you can give it a shot. Our @hivefest presentation available here on the YouTube with a pitchdeck of what we building in general

Vote with Peakd.com, Ecency.com, Hivesigner

Thank you!

This is a comment to help with RC Delegation testing.

And this is a further comment.

And because we actually need to run through some RCs in order to test automatic top up delegation.... here's another!