Wildhorn Testnet Part 2 — Running a Node and Earning Points
Welcome to the second blog on the HOPR Wildhorn testnet on Polygon Network. If you haven’t installed and funded a node yet, check out Part 1.
With your node up and running, you should see a screen like this when you visit http://localhost:3000/ in your browser:
This is your node interface. Type commands in the field at the bottom and see the results in the panel at the top.
Before we start interacting with other nodes, let’s take a tour around our own node. You can get a full list of commands by typing “help”.
To get your node address, type:
You’ll see two addresses: the last five characters of your node’s HOPR address, and its Polygon address (although it will say “ETH address”). To see the full HOPR address, click the shortened version to expand it.
To get your node’s token balance, type:
You’ll see its balance in MATIC and mHOPR tokens.
To see what other nodes your node knows about, type :
This will show a (hopefully!) long list of other nodes, including your node’s assessment of their quality. This quality factor is used when your node tries to find the best path through the network for sending data. This data is hard to make accurate, and is one of the things we’ll be testing in this and future testnets.
A direct way to test the connection between your node and another node is to use the ping function. Type:
You should quickly receive a pong back.
Now let’s try sending a direct (unmixed, not private) message. It’s best if you use an address of someone you know or another node you control.
To send a message, type:
send ,[address] [message]
Make sure you put a space after send and a comma directly before the address!
(Yes, this is very weird. Between you and me I’m pushing to change it in future versions! But the reason for this syntax will be clearer when we send a multi-hop message later.)
So that’s the basics of using a HOPR node. Other than when it was first funded, none of these interactions will have been recorded on the blockchain.
Now that you know your way around your node a bit, it’s time to start earning some points. These actions all result in on-chain activity, which we can use to derive your node’s score.
(This may seem at odds with HOPR’s privacy credentials. This is one of the balancing acts when running a testnet: we need to be able to link data to specific nodes to see what’s working and what isn’t. Rest assured, we wouldn’t be able to make meaningful links if we weren’t first getting your permission via your dashboard interactions.)
A lot of these steps will be easier if done with a few other people (you can connect with other testnet participants in Telegram or Discord), or if you control multiple nodes. If you spin up multiple nodes, remember that you can register them all on our dashboard and get the combined score for all of them!
To send private messages, you need to open channels to other nodes to relay your data.
To open a channel, type:
open [address] [amount of mHOPR to fund]
The amount can be anything your balance can cover, but bear in mind each ticket is worth 0.01 mHOPR, so 1 mHOPR should be enough to send many messages!
This process can take a little while, so be patient. Once the channel is open, you’ll see a success message and a channel ID.
Sending OnHop Messages
Let’s send a one hop message to our own node. Type:
send [hop address],[your address] [message]
(This, incidentally, is the reason for the weird comma syntax when we sent a direct message. The node expects a list of addresses demarcated by commas, so you need one even if the list is just one address long!)
If you check your balance, you’ll see that you’ve spent some mHOPR sending those messages.
Those mHOPR will have been converted to tickets in the relaying node. The controllers of your node can now type:
To convert those tickets back to mHOPR. Their balances will increase by the appropriate amount.
You can also close a payment channel by typing
It will initiate channel closing, now you should wait for 1 minute, after that you will need to wait at least for 100 confirmed blocks on the chain
Then repeat the close command again:
Note that you need to use the address of the other end of the channel, not the channel ID.
When this happens, tickets should automatically be redeemed.
For the Wildhorn testnet, your node will be assigned a score based on on-chain activity. The basic scoring activities are as follows:
- Opening Channels
- Closing Channels
We’ll be monitoring the time between the opening and closing events. The more channels you have open, and the longer you have them open, the higher your score (although, to prevent spam, you’ll earn fewer points for your 100th channel than your first).
Of course, it’s not very useful to have channels open if they’re not used, so you’ll also earn for sending messages through channels.
We can measure activity by looking at the relative balances of addresses. So you’ll earn points for:
- Increase in mHOPR (from relaying).
- Decrease in mHOPR (from sending messages).
The more messages you send, and the more data your node relays, the higher your score. There will be bonuses for reaching milestones of 50 and 100 messages sent from a node.
These are monitored via the smart contract, not the balance, so you can’t just send tokens between addresses!
(For anyone wondering how this is private in any way, the short answer is it’s not. At the moment every relayed packet generates a ticket, and every ticket can be redeemed on-chain for a reward. This link will be severed once probabilistic payments are implemented. You can read about those here.)
Viewing Your Score
You’ll be able to see the nodes in the network and their score one the Network panel of the dashboard. This will be operational hopefully on Monday. Don’t worry, though, the leaderboard is generated based on on-chain data, so your score is going up as you use your node even though you can’t see it yet!
That’s all for this part. The third and final part will look more into the leaderboard, verifying multiple nodes and claiming NFTs based on your score.