goat-systems / tzpay

tzpay is a configurable batch payment tool for Bakers in the Tezos ecosystem
MIT License
12 stars 10 forks source link

Unable to generate report or payout #5

Closed leopoldjoy closed 5 years ago

leopoldjoy commented 5 years ago

I am running the following:

$ payman report --delegate=tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt --cycle=101 --node=https://mainnet-node.tzscan.io:443 --fee=0.1

I get the follow errors:

2019/05/18 02:06:28 report.go:65: could not get delegate report for 
tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt at cycle 101: could not get rewards for 
tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt at 101 cycle: bad response code 404

I can't find a work-around for the 404 error. I've also tried with a local endpoint (http://127.0.0.1:8732), however this does not help. I am currently running on MacOS. Any idea why this is failing?

DefinitelyNotAGoat commented 5 years ago

Hi @leopoldjoy! I did some investigating, and I think it's because https://mainnet-node.tzscan.io:443 does not have all the necessary RPC's exposed for the tool. On that note I did find a bug, that's fixed and released under v1.0.3.

I compiled the mac binary for you so you can just wget https://github.com/DefinitelyNotAGoat/payman/releases/download/v1.0.3/payman_darwin_amd64

Example of it working on my local node:

user@Tezos-Mainnet:~/QubesIncoming/TezosDevelopment$ ./payman report --delegate=tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt --cycle=101 --node=http://127.0.0.1:8732 --fee=0.1
+--------------------------------------+-----------+--------------+-------------+--------------+
|               ADDRESS                |   SHARE   |    GROSS     |     FEE     |     NET      |
+--------------------------------------+-----------+--------------+-------------+--------------+
| KT1ApQ7JehN2vrDr4t8oES6vAipX8VAWeeJm |  0.000000 |     0.000000 |    0.000000 |     0.000000 |
| KT1FSeJk5hgeZZm9RyGyMGCeBL7M2JA13FdP |  0.315532 |    73.198184 |    7.319818 |    65.878366 |
| KT1HmGvNKp8GXgVk6YckUL1LY9h9itDTNXuA |  3.817261 |   885.540968 |   88.554098 |   796.986870 |
| KT1FnjddjrMjq6vjdX4LZ94i2zApTbb1sMG1 |  0.000000 |     0.000000 |    0.000000 |     0.000000 |
| KT1NPmsKUKDxo5Wm4WHpLvnRH6ahSNiVV2XD |  0.000000 |     0.000000 |    0.000000 |     0.000000 |
| KT1HQwpXcNBckyufDJmS1i6rvXsgdo2Nk2cJ |  0.000000 |     0.000000 |    0.000000 |     0.000000 |
| KT1Mh3Nmqk3oHw9H2hoCrkbeeX8WPSHSJyPY |  0.000000 |     0.000000 |    0.000000 |     0.000000 |
| KT1G1ZUaaCHTtLjaZzYXdWYsU4yRQfM1FLcH |  1.576793 |   365.789736 |   36.578974 |   329.210762 |
| KT1VyvPxmo7GpSozfzen8UQLWBRwKjiF9JNa | 73.764180 | 17112.060388 | 1711.206064 | 15400.854324 |
| KT1Uf4boh8eDpoEq9LegaNoGTU8w2SpXVhZy |  0.000000 |     0.000001 |    0.000000 |     0.000001 |
| KT1UfM1zGXbsqNoJWdiz5a2BhuZiDmfxPsKP |  1.440827 |   334.247891 |   33.424789 |   300.823102 |
| KT1FADieaGA64epWVDCemXxGnMbo7wrqnvFF |  0.000000 |     0.000000 |    0.000000 |     0.000000 |
| KT1GFzbVWGck8DcHrPeQgge2xV42AyEsXusH |  0.000000 |     0.000000 |    0.000000 |     0.000000 |
| KT1K2kXKxSMFAkZrpp8dcpJxckDjeLYf8xXF |  0.000000 |     0.000000 |    0.000000 |     0.000000 |
| KT1AcH3YscoUcJKqvqdcYCBeZwAennd2NEeN |  6.308620 |  1463.494610 |  146.349463 |  1317.145147 |
+--------------------------------------+-----------+--------------+-------------+--------------+
|                                          TOTAL   | 20234.331778 | 2023.433206 | 18210.898572 |
+--------------------------------------+-----------+--------------+-------------+--------------+
leopoldjoy commented 5 years ago

@DefinitelyNotAGoat thanks for your response! Are you saying that none of the tzscan endpoints work for payman? Or are you saying that only the HTTPS (port 443) endpoint doesn't work for tzscan?

I've updated to the v1.0.3 release, however I'm still getting the same output:

./payman report --delegate=tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt --cycle=101 --node=http://mainnet-node.tzscan.io:8732 --fee=0.1
report.go:65: could not get delegate report for tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt at cycle 101: could not get rewards for tz1Yju7jmmsaUiG9qQLoYv35v5pHgnWoLWbt at 101 cycle: bad response code 404
DefinitelyNotAGoat commented 5 years ago

Tzscan's nodes and the public Tezos nodes don't have all the RPC's exposed for public use. Specifically Go Tezos relies on the network constants RPC call to get the correct network parameters like the amount blocks in a cycle, because they differ from mainnet to alphanet, and zeronet.

Those public nodes aren't very useful beyond just getting a block. If you use your own node you won't get the 404 though.

Hope that helps!

leopoldjoy commented 5 years ago

Thanks @DefinitelyNotAGoat! Could these relied on constants be hardcoded for mainnet in order to use the tzscan RPC endpoints?

DefinitelyNotAGoat commented 5 years ago

It's not currently supported in GoTezos but I could add that as an option. I will say that those nodes block more than just those RPC's though. I'm pretty sure they block all POST methods, so if you want to payout with payman it won't work through that node unfortunately.

leopoldjoy commented 5 years ago

Ok, makes sense. Yes, as an option I think that would be useful to add! For now, I was able to run the script via a different Tezos node. Thanks for your help!