Help: "Chain is loading(...)" - Mac HSD


#1

Installed hsd on my Mac OS and have it running. Or so I think.

When I run (./bin/hsd) I get:

[info] (chain) Chain is loading.
[info] (chain)

It’s been 3 days and this command still gives the above. How can I tell if my install is proper and/or the software is actually getting sync’ed up?


#2

Is that literally the only two lines in the log? What else does it report? There could be messages about network connectivity that would help us figure out what’s going on


#3

The command hsd-cli info should report a progress %, block chain height, etc.


#4

This is where I’m hitting a wall. I don’t have that command “hsd-cli”. So I’m wondering how does one check the install? I followed the github and community pages on HOWTO, and I can run: ./bin/hsd

which then returns to my CLI: (and only returns the following)

[info] (chain) Chain is loading.
[info] (chain) Checkpoints are enabled.
[info] (chaindb) Opening ChainDB…
Error: IO error: lock /Users/Abraxis/.hsd/testnet/chain/LOCK: Resource temporarily unavailable

[UPDATE] - ok, so when I run: ./bin/cli info I get:

./cli info
Warning: The hsd cli interface is deprecated.
Please use hsd-cli ($ npm install hs-client).
{
“version”: “0.0.0”,
“network”: “testnet”,
“chain”: {
“height”: 11189,
“tip”: “b000ad617e91b3b7375125ca452fa044095ad3fdc17f24b124f7c412481d485d”,
“treeRoot”: “674a44d52c96914973ea58eec3adb8b7cf6dd3528b92d4b54c4f990dfdb9d16a”,
“progress”: 1,
“state”: {
“tx”: 130349,
“coin”: 104826,
“value”: 22521682094209,
“burned”: 55424023
}
},
“pool”: {
“host”: “2601:647:4800:eb35:cc9:eed4:dbe7:af”,
“port”: 13038,
“agent”: “/hsd:0.0.0/”,
“services”: “1”,
“outbound”: 8,
“inbound”: 0
},
“mempool”: {
“tx”: 0,
“size”: 0
},
“time”: {
“uptime”: 255978,
“system”: 1561131351,
“adjusted”: 1561131351,
“offset”: 0
},
“memory”: {
“total”: 192,
“jsHeap”: 25,
“jsHeapTotal”: 31,
“nativeHeap”: 160,
“external”: 37
}
}


#5

Ah ok, here’s a few things to try. First, you could install hs-client globally:
npm i hs-client -g
(Or clone from github and npm i -g from inside the repo)
This will make hsd-cli available from the command line, and you can start following the api docs at https://handshake-org.github.io/api-docs/
I realize hs-client is not well advertised in the docs right now, I’ll open an issue about that.

Second, it’s interesting that your getinfo reports a chain height of 11189 and progress 1 – that is a fully synced chain!

This leads me to believe that the cause of the LOCK: Resource temporarily unavailable error is… you already have hsd running!

To start clean, just execute killall hsd, then try to run hsd again.


#6

Thanks for this.

Cloned the repo and installed (looks like i had to be sudo). So I now have ‘hsd-cli’

Restarted hsd, and it’s looking a LOT different. Looks like hsd is now actually ‘doing’ something via the output.

I am getting a lot of: Connection timed out…

I see that “refilling peers” I seem to be getting somewhere with this… looks like I’ve got (7/8) peers…
Basically, this ‘connection timed out’ can be ignored? Also, what else can I look at to double check I’m fully up?


#7

Yeah it’s hard to find consistently reliable peers on a young network like this, so expect to see a lot of messages about stalling peers. Even on the Bitcoin network it can take a few minutes of runtime to fill the pool (of peers) to the default size of 8.

Check out the api-docs site I linked, lots to play with there. As far as “fully up” – the progress percentage in hsd-cli info is your answer to that. There’s also a few guides to get you started at https://handshake-org.github.io/


#8

Thanks for this.

I see the ‘progress’ from hsd-cli info, is there a way for me to see the current state of the chain, i.e. blockexplorer (basically as a double check)?

Also, am I correct in thinking that I’m mining if I’m running hsd? And if so, do I also need now setup/configure a wallet?


#9

No, block generation is OFF by default. On testnet and regtest you can play with it using these API calls:
https://handshake-org.github.io/api-docs/#setgenerate
https://handshake-org.github.io/api-docs/#generatetoaddress

But keep in mind difficulty on mainnet will be a lot harder and CPU may not be effective. @mckie can maybe provide more info about a GPU-miner under development for mainnet.

There is a hsd block explorer available at http://hnscan.com but again keep in mind – you are running a full node! Trust THAT, not someone’s website :slight_smile:


#10

Thanks for helping me get up and running.

Will continue my reading of the materials, and interested in the GPU option for mining on mainnet and all.

[UPDATE] - Looks like I’m getting back up afterall.


#11

Ah ok, more weirdness – so the thing about blockchains is, you can’t possibly ever know when you are really “at the tip”. What if there’s another block out there you just haven’t received yet? The dirty secret is, progress: 1 is a GUESS. See here: https://github.com/handshake-org/hsd/blob/master/lib/blockchain/chain.js#L2689-L2699

Long story short, if there hasn’t been a block added to the chain in a 40 minutes, progress will slowly start to decrease below 100%