Full Nodes or Wallets as peers

Up for chat, does it make a difference if you have a Full Nodes or Wallets connected as a Peer on your Connections?

I guess, you are talking about Full Node Connections section.

The obvious difference is that if a full node is a peer, both nodes eventually exchange bc data (whichever at the moment syncs first). On the other hand, wallets are just leeching data (get your bc data to created wallet db, instead of getting it from the local node).

With that said, the question is how many wallets you should see in that section. With v.1.3.x, wallets prefer to connect to a “friendly” node, that is basically your local node. That of course only happen, if the wallet is not a stand-alone wallet. Therefore, assuming that all nodes are on v1.3.x, the only wallets that should be connected to your node are those that don’t see (yet) a local v2 bc. Assuming that virtually everyone upgrades to v2 db, that implies that once fully synced those nodes should drop off. If you check that Chia monitoring page, about 1-2% (maybe more) of nodes upgrade to v1.3.x daily. Currently, there are ~170k nodes out there, that makes it ~2-5k per day. Assuming that the conversion to fully synced v2 db takes a couple of hours, there should only be a tiny drop in a bucket of such nodes. So, if you have 80 peers, it should be there just one / two wallets getting down with more nodes updating to v1.3.

And of course, stand-alone wallets need to get bc data from somewhere, but I would assume that there are not too many such installations, and they are not running 24/7.

Although, we still have about 30% of pre v1.3 nodes out there, and those do connect, basically inflating that number.

At least, that is how I understand the latest version.

1 Like

To add to @Jacek’s comment, I think this 2.1 Peer to Peer system | Chia Documentation describes what those wallet connections are.

Wallets can communicate with full nodes through the wallet protocol. This is similar to Bitcoin’s SPV protocol: it allows verification of transactions and block weight, without the bandwidth and CPU requirements of full nodes.

Wallet nodes are similar to full nodes, in that they are servers which communicate to other peers in the network. A common use case is to run a wallet locally along with a full node, where the wallet only connects to the full node. Wallets download weight proofs from nodes to quickly validate which blockchain is the longest. They then ask full nodes to scan the blockchain for their desired transactions. The wallet is also responsible for managing private keys, as well as generating, storing and sending transactions. The wallet exposes an RPC HTTPS websocket JSON API, which user interfaces can use to execute commands.

At some point (1.3?) a new config option target_peer_count was added for the wallet configuration as well, and it defaults to 3. Contrast that with the default target_peer_count of 80 for full nodes.

So, if you see 1-3 remote wallet connections, this is expected but it will never go higher than 3 unless you change that option. Full nodes are doing the blockchain work, and the wallet peers are doing what is described above.

1 Like

I think that that document may be outdated (for v1.3) (no date on it). Chia was working on a trusted type of nodes before v1.3, but was not taking advantage of that. Therefore, there is that talk about the longest blockchain, etc. in that document. However, from what I see (on the Wallet / Connection section), my wallet only connects to my local node (was connecting to others before my node got “really synced”), and others reported the same thing. This kind of implies that with v1.3, the wallet prefers the trusted connection, not really the longest blockchain, as such doesn’t bother to reach out to other nodes.

Actually, some time ago I asked on github to be able to specify “preferred” (or in Chia lingo “trusted”) peer while adding it to Full Node Connections section. This would allow to have two peers (on local network) where one would only sync from the primary one (potentially more secure, faster, and good for db backup - could just leech bc data, instead of verifying what is already verified).

Yeah that could very well be dated, but it sorta made sense given the documentation available and some recent observations. More recently, I started noticing wallet peers that were remote, where in the beginning I only ever saw the local wallet (but maybe they were sometimes there and I wasn’t paying attention). My first guess was that these were simply “light wallet” clients new in 1.3, but then I couldn’t find any docs on that and the reference I posted above contradicted what I thought they were.

Here’s a screenshot from right now:

The wallet target_peer_count has been around since before 1.3 and light wallets but I didn’t dig through the history too deep to understand what they’re actually for.

1 Like

On your Wallet / Connections section, how many connections you have there? I only have there 127.0… (Not sure what CLI command is to show that for a wallet.)

Maybe this is an indication that those peers didn’t upgrade to v2 db (local node is not yet trusted)?

By the way, my wallet target_peer_count is also 3, and since bc fully synced to v2 db, I have never seen anything there, other than that localhost connection. Not that I was actively monitoring it, though.

One more thing, the wallet will also reach out to other peers when local db is behind. I think that target_peer_count will kick in at that point. This (may) also explain those extra wallets, as we are still in the light dust storm condition, so potentially a decent chunk of nodes is behind. If this would be the case, the number of wallets should correlate (2x or 3x higher - target_peer_node multiplication) than the number of peers that are behind.

I’ve got 74 full node connections, the one local wallet connection from and the remote wallet, which interestingly is using port 8449 too. So, it is definitely a remote client, and definitely a wallet server as opposed to a full_node or anything else.

Pretty much all connected nodes are up to date with the exception of just a few. The wallet doesn’t report a height. It only shows 0.23 MiB up and 0 down, so it hasn’t moved much data.

Edited to add…I checked another full node and it has one other remote wallet connection (different IP) and it has 59 MiB up and 0.14 down. Another node has no remote wallets, but it is syncing and a day or two from finishing.

That section is from Full Node, not Wallet panel (so those are wallets that connect to you). I was asking what do you see on the Wallet / Connection panel (show peers that your wallet connects to).

Unless that is from v1.3.4, and the UI changed, and potentially behavior.

1 Like

Where is this in 1.3.4? I just see Tokens, offers, full node, plots, farming, and pooling. The farming tab shows full node and harvester but does not show any wallets.

The textual output is from chia show -sc which has been consistent for a while. It shows all the node connections. It shows the local farmer and local wallet, and then all the remote connections.

chia show -sc is call to your full node, so no wallet connections. It should be something like chia wallet show -sc, if it is there at all.

1 Like

1000 words.

1 Like

So, your wallet also only connects to your localhost.

So far, people that responded to my question, all had just local connection there. So, the question is still what are those remote wallets that connect to the full node?

If the v1 vs v2 assumption is correct (if local db is v1, wallet also connects to other nodes), that would indicate that a lot of people didn’t upgrade to v2. Maybe most people just run software update, and are done with it.

It really sucks that wallet doesn’t have -sc

In the Full Node tab, I have a wallet from localhost and three other Wallet connections, When I run in PS>.\chia wallet show My Chia wallet ID only shows 1 and Chia Holiday 2021 Token shows Wallet ID 2. And I’m for sure running v2 blockchain_v2_mainnet.sqliteX

1 Like

Correct, my wallet is only connected to localhost but there are some remotes. I think @Normanvelez might have reported seeing these wallet connections in another thread on here.

We know it isn’t a 1.3 light wallet because the code has existed long before that, so maybe that documentation is accurate. It could be a wallet downloading a weight proof and then asking my node to scan for their desired transactions.

The document then links to 3.12 Light Clients | Chia Documentation which I think did pre-date 1.3 but says this specific light client functionality was supported in the wallet API.

1 Like

I think we are not yet on the same page, and I don’t know what I have missed again, sorry for that.

Both, the full node and wallet are kind of nodes that if needed will connect to other nodes. What you see on the Full Node / Connections sections are connections to/from your full node (so, your wallet is listed there, as other wallets are). On the other hand, in that screenshot of wallet show …, at the very bottom you have Connections section that shows where your wallet is connecting to (nothing connects to a wallet), and that is only the localhost.

So, if your wallet has only one connection, same with @drhicom, same with mine that implies that for whatever reasons our wallets do not connect to other nodes. Thus my assumption that once fully synced on v2 bc, the wallet prefers trusted connection, and doesn’t bother with connecting to other peers. So, we don’t have a good explanation why there are so many wallets connected to our nodes.

He was talking about other wallets connecting to his full node, not about connections that his wallet made.

1 Like

What do you have in Wallet / Connections tab?

In the Tokens tab the boxes to the far right synced is green and Connected (1)

OK, they changed it in v1.3.4 apparently (I am still on v1.3.3). In the previous version, at the very bottom of Wallet was just what wallet connects to (as in my screenshot). Also, when you run chia wallet show, at the very bottom it shows what wallet connects to (what @chiameh posted above). So, this makes it more confusing to differentiate between full node and wallet as standalone processes (as your section list only what full node sees, not really wallet).

So, again the question is if our wallets are only connecting to local full nodes, what are those other wallets connecting to our full node. I guess, that is the gist of the original question.

1 Like

I think I’m going down a different tangent is all. I realize I don’t have any outgoing wallet connections, or think that there should be since my node is fully synced and wallet appears to be as well.

Aside from that documentation I don’t have a good explanation as to why these wallets would be making outbound connections. I see where you’re coming from thinking that once synced on v2 that there shouldn’t be any need for a wallet to connect to another node.

1 Like