Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Possible timeout problem #3

Open
AltCoiFish opened this issue Mar 1, 2021 · 9 comments · Fixed by AltCoiFish/defi-btc-anchorer#1
Open

Possible timeout problem #3

AltCoiFish opened this issue Mar 1, 2021 · 9 comments · Fixed by AltCoiFish/defi-btc-anchorer#1

Comments

@AltCoiFish
Copy link

error when looping

/opt/dfi/defi-btc-anchorer# python3 main.py --config config.toml --checkprofit yes --checkcompeting yes --createanchor yes --sendanchor yes --repeat 600

checking competing anchors in BTC mempool
ok
requesting anchor template from DeFi RPC
Error: [Errno 32] Broken pipe

2021-03-01 15:41:36.461349 repeating the routine
================================================
checking competing anchors in BTC mempool
ok
requesting anchor template from DeFi RPC
Error: [Errno 32] Broken pipe

RPC to bitcoind - working (and enough funds on bitcoind)

btc-node
2021-03-01T13:18:56Z ThreadRPCServer method=getrawtransaction user=bitcoind

RPC to defid - working

2021-03-01T14:33:56Z ThreadRPCServer method=help user=dfid
2021-03-01T14:34:14Z ThreadRPCServer method=spv_listanchorauths user=dfid
2021-03-01T14:34:47Z ThreadRPCServer method=spv_estimateanchorcost user=dfid
2021-03-01T14:37:22Z ThreadRPCServer method=spv_estimateanchorcost user=dfid
2021-03-01T14:37:25Z ThreadRPCServer method=spv_listanchorauths user=dfid
2021-03-01T14:41:36Z ThreadRPCServer method=getbestblockhash user=dfid

After each cycle it seems the RPC connection to defid times out.

I did increase the timeouts via dfid.conf

[...]
rpctimeout=180

# debug
debug=mempool
debug=rpc

I am trying now with changing the timeout value on dfid as well as adding rpcservertimeout=1200 like I did on the btc-node and see if its helps.

@AltCoiFish
Copy link
Author

Created PR for a possible solution.
#4

For reference I will re-open this issue.

@AltCoiFish AltCoiFish reopened this Mar 1, 2021
@dell1503
Copy link

dell1503 commented Mar 2, 2021

@AltCoiFish
Did return AuthServiceProxy(url, timeout=240) solve the issue on your side?

@AltCoiFish
Copy link
Author

@AltCoiFish
Did return AuthServiceProxy(url, timeout=240) solve the issue on your side?

Yes , its running now over 24h without any problems.
As described above, I also increased the timeout but I did this also prior to adding the timeout=240 .

@dell1503
Copy link

dell1503 commented Mar 3, 2021

@AltCoiFish
Did return AuthServiceProxy(url, timeout=240) solve the issue on your side?

Yes , its running now over 24h without any problems.
As described above, I also increased the timeout but I did this also prior to adding the timeout=240 .

Thanks for you replay.
So you ended up with the rpcservertimeout=1200 in bitcoind and defid?
Also in main.py you gave it 1200?

Did you recived as well the RPC error: -25: Min anchor quorum was not reached! ?

@AltCoiFish
Copy link
Author

Did you recived as well the RPC error: -25: Min anchor quorum was not reached! ?

This is due to #6

@dell1503
Copy link

dell1503 commented Mar 6, 2021

error when looping

/opt/dfi/defi-btc-anchorer# python3 main.py --config config.toml --checkprofit yes --checkcompeting yes --createanchor yes --sendanchor yes --repeat 600

checking competing anchors in BTC mempool
ok
requesting anchor template from DeFi RPC
Error: [Errno 32] Broken pipe

2021-03-01 15:41:36.461349 repeating the routine
================================================
checking competing anchors in BTC mempool
ok
requesting anchor template from DeFi RPC
Error: [Errno 32] Broken pipe

RPC to bitcoind - working (and enough funds on bitcoind)

btc-node
2021-03-01T13:18:56Z ThreadRPCServer method=getrawtransaction user=bitcoind

RPC to defid - working

2021-03-01T14:33:56Z ThreadRPCServer method=help user=dfid
2021-03-01T14:34:14Z ThreadRPCServer method=spv_listanchorauths user=dfid
2021-03-01T14:34:47Z ThreadRPCServer method=spv_estimateanchorcost user=dfid
2021-03-01T14:37:22Z ThreadRPCServer method=spv_estimateanchorcost user=dfid
2021-03-01T14:37:25Z ThreadRPCServer method=spv_listanchorauths user=dfid
2021-03-01T14:41:36Z ThreadRPCServer method=getbestblockhash user=dfid

After each cycle it seems the RPC connection to defid times out.

I did increase the timeouts via dfid.conf

[...]
rpctimeout=180

# debug
debug=mempool
debug=rpc

I am trying now with changing the timeout value on dfid as well as adding rpcservertimeout=1200 like I did on the btc-node and see if its helps.

Hi @AltCoiFish
I still have this issue.
I changed the rpcservertimeout in defi.conf. Also I adjusted the main.py with timeout=240 as you stated in you merge request.
You were refering to a other time out in the first post, you mean the general connection timeout in the defi.conf?

 -timeout=<n>
       Specify connection timeout in milliseconds (minimum: 1, default: 5000)

Realy strange, my setup isn't stable.

@dell1503
Copy link

dell1503 commented Mar 6, 2021

I did again a clean defid Blockchain download (remove all existing data in .defi/* expect the ther conf) overnight. the Error: [Errno 32] Broken pipe error did disappear, no other changes, no config change nothing.

@Bushstar
Copy link
Member

Bushstar commented Mar 6, 2021

Not sure if you are aware that you can also create an anchor manually following the guide below. Please make sure you are on DeFiChain 1.5.1 that has just been released. When upgrading to 1.5.1 please start the client with -spv_resync or add spv_resync=1 in your .defi folder, you can check the sync status with the RPC command spv_syncstatus.

https://github.com/DeFiCh/ain/wiki/Create-Bitcoin-Anchor

DeFiChain 1.5.1 Release

https://github.com/DeFiCh/ain/releases/tag/v1.5.1

I'll raise your reported issue with the team and get someone to try and recreate the issue.

@dell1503
Copy link

dell1503 commented Mar 6, 2021

Not sure if you are aware that you can also create an anchor manually following the guide below. Please make sure you are on DeFiChain 1.5.1 that has just been released. When upgrading to 1.5.1 please start the client with -spv_resync or add spv_resync=1 in your .defi folder, you can check the sync status with the RPC command spv_syncstatus.

https://github.com/DeFiCh/ain/wiki/Create-Bitcoin-Anchor

DeFiChain 1.5.1 Release

https://github.com/DeFiCh/ain/releases/tag/v1.5.1

I'll raise your reported issue with the team and get someone to try and recreate the issue.

Thank you very much, my node is running on 1.5.1.
If needed I cann provide more logs ore even access to the system. You can also reach out to me on Telegram, if a faster exchange is required.

So in the morning the system was running. I then decide to keep in in the loop running with :
./main.py --config ./config.toml --repeat 3600
It looks to me, that it some time it run, sometimes I recived
RPC error: -25: Min anchor quorum was not reached!
or
Error: [Errno 32] Broken pipe

I keep it running and will so how is doing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants