Posts

Podping is preparing for Hard Fork HF26 and HiveFest

avatar of @podping
25
@podping
·
0 views
·
4 min read

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.

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

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

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!