0

Recent v10-rc1 added a new mode to the tezos-client, which is called light mode.

I wondered if I could use it to cast my vote and which endpoints should I use in sources.json.

I did the following:

  1. Compiled v10-rc1 binaries
  2. Created sources.json: echo '{ "uris": [ "https://mainnet-tezos.giganode.io", "https://sebuh.net:8732", "https://mainnet.smartpy.io", "https://mainnet-node.madfish.solutions" ] }' > sources.json
  3. Tested with an RPC: ./tezos-client --mode light --sources sources.json --protocol PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i rpc get /chains/main/blocks/head/header

But I got:

Error:
  Rpc request failed:
     - meth: GET
     - uri: http://localhost:8732/chains/main/blocks/head/protocols
     - error: Unable to connect to the node: "Unix.Unix_error(Unix.ECONNREFUSED, "connect", "")"

If a basic RPC doesn't work, I'm sure on-chain governance voting won't work as well.

This command works:

$ ./tezos-client --endpoint https://mainnet-tezos.giganode.io --protocol PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i rpc get /chains/main/blocks/head/header

{ "protocol": "PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i",
  "chain_id": "NetXdQprcVkpaWU",
  "hash": "BLKV43G3vo4kGNn3ZczBngydH8XGe854UYToixDx2UHiSeC5g4D",
  "level": 1553826, "proto": 9,
  "predecessor": "BLKxYYxzmdnCauJfzC55LSnnhYqe59MfGbKdGUZ1YNLx3xiSVR8",
  "timestamp": "2021-07-12T10:46:30Z", "validation_pass": 4,
  "operations_hash": "LLoaxS4a5CMAzD55PPrT23gudrrWZSt8yrksun1BGxyU2w5R5ELE4",
  "fitness": [ "01", "00000000000db5a2" ],
  "context": "CoUhrse9ptVYbrpNZkrC3CPETm5trzRd66yBQKntuiQiKLbe2RTB",
  "priority": 0, "proof_of_work_nonce": "706457dc0ed60400",
  "signature": "sigusESabTFWWLKJ9X4qiBkLSHq7J1zSr3dn22JFsC2ByLQ4pQyyHmiYn9YQsPr6Zq7aJ6GUaCryWkGfbjJKM6rK4tkkhq2W" }
5
  • That very same command works fine for me locally. However, I'm running the development version of the client, and not the latest release. If you try each of the endpoints individually (in normal mode), do you connect succesfully?
    – arvidj
    Jul 12 at 8:30
  • I just tried on v10-rc1 and it also works just fine.
    – arvidj
    Jul 12 at 8:42
  • You tried the same command at point 3 of my question? I still don't get why it tries to get the protocol from "localhost:8732". I am not running a node, because I just wanted a light way to use Tezos on my old notebook.
    – Babell
    Jul 12 at 10:46
  • @arvidj I tried the endpoints (edited the main question) and they work as expected.
    – Babell
    Jul 12 at 10:51
  • I reverified, I think I do exactly as you do. See the trace here : gitlab.com/-/snippets/2148845
    – arvidj
    Jul 13 at 9:07
1

Hello Babell and thank you for your report. Main light mode developer here. I think you found a bug. As --endpoint is omitted in your initial request, it is being defaulted; hence the locahost:8732 showing up. Can you try specifying --endpoint as follows?

./tezos-client --endpoint https://mainnet-tezos.giganode.io --mode light --sources sources.json --protocol PsFLorenaUUuikDWvMDr6fGBRG8kt3e3D3fHoXK1j1BFRxeSH4i rpc get /chains/main/blocks/head/header

The bug is that, in this case, tezos-client should fail and tell you that the value of --endpoint should be one of the URLs in sources.json (see this code). We chose to force --endpoint to be made explicit in the presence of --sources but it seems we missed one entry point.

If you confirm that adding --endpoint fixes your problem, I will create an issue for this bug.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.