grin-wallet icon indicating copy to clipboard operation
grin-wallet copied to clipboard

Deprecation of some API breaks mining on remote nodes

Open slavikus opened this issue 4 years ago • 4 comments

Describe the bug The recent PR breaks the ability to mine on a node that runs on a remote machine.

ERROR grin_servers::mining::mine_block - Failed to get coinbase from http:/x.x.x.x:3415. Is the wallet listening? Request error: Cannot make request: error trying to connect: tcp connect error: Connection refused (os error 111) ERROR grin_servers::mining::mine_block - Error building new block: Can't connect to wallet listener at "http://x.x.x.x:3415"; will retry

slavikus avatar Jan 17 '21 15:01 slavikus

Known issue. @jaspervdm Please comment - what is the plan?

bladedoyle avatar Jan 21 '21 18:01 bladedoyle

@slavikus As a workaround you can edit the source code and fix with something like this: sed -i 's/127.0.0.1:{}/0.0.0.0:{}/' config/src/types.rs

bladedoyle avatar Jan 21 '21 18:01 bladedoyle

We will likely have to introduce a new api type that solely exposes an endpoint to build a coinbase output. In the meanwhile it is recommended to use a reverse proxy in front of the wallet.

jaspervdm avatar Jan 22 '21 14:01 jaspervdm

What happened is: The wallets entire foreign_api was moved to tor listener and hardcoded to localhost

What should have happened: A new receive_api added to the wallet, hardcoded to listen on localhost and used only by tor. The receive_tx & finalize_tx methods should have been moved to this new api, and no longer available on the foreign_api. The foreign_api should have been left alone except for removing receive endpoints

edit: some endpoints - like check_version would be available through both receive_api and foreign_api It may be good to rename "foreign_api" to something like "local_api" or something since it wont necessarily be exposed to the public internet

bladedoyle avatar Feb 14 '21 19:02 bladedoyle