dydx-v3-python icon indicating copy to clipboard operation
dydx-v3-python copied to clipboard

Support Infura in `onboard.py`

Open maxholloway opened this issue 4 years ago • 1 comments

Why?

There have been a number of issues () where people cannot use the account_signTypedData on geth nodes. This is an issue, since Infura runs on geth. This causes problems in the Stark key generation step, as client.onboarding.derive_stark_key() specifically throws this error.

What?

I have found that this problem can be circumvented by explicitly passing the ethereum private key into the dydx Client() constructor. I have modified the existing examples/onboard.py to reflect this change.

Testing

This ran fine locally after filling in values for ETHEREUM_PRIVATE_KEY and WEB_PROVIDER_URL and running python3 onboard.py.

maxholloway avatar Jan 07 '22 03:01 maxholloway

Hi, I just wondering how safe it is by passing the eth private key directly to the dydx client?

All of the signing happens offline, so there's no risk introduced by the dydx client. It's precisely as secure as the machine it's running on.

maxholloway avatar Jan 30 '22 06:01 maxholloway