eco-stake / restake

Auto-compounder script for Cosmos Validators using REStake
https://restake.app
MIT License
356 stars 307 forks source link

local testing #745

Open vchong opened 1 year ago

vchong commented 1 year ago

Hi, is there a way to test locally that everything is working before submitting a PR to the validator registry?

tombeynon commented 1 year ago

Not really unfortunately, since you won't have grants anyway. I could add a config to networks.local.json to locally add an operator, but you'd also need to create the grant manually either using REStake grants section, or CLI. Would that be useful?

vchong commented 1 year ago

Yes, if you can provide some references on how to do that, it would be appreciated. Thanks!

vchong commented 1 year ago

I already have a testnet account that has staked to a validator and granted MsgWithdrawDelegatorReward and MsgDelegate to the bot (hotwallet address). I'm also using a non-default validatorsUrl where I append manually constructed json segments to the data returned by https://validators.testcosmos.directory/, but am still having trouble passing the Not an operator check in index.mjs.

vchong commented 1 year ago

Managed to get through Not an operator by adding a "restake" : .. segment to the output of https://validators.testcosmos.directory/chains/ under the appropriate validator, but now Found 0 addresses with valid grants... when there are obviously grants under <apiUrl>/cosmos/authz/v1beta1/grants/grantee/<botAddress>.

Update: Can't find valid grants because of https://github.com/eco-stake/restake/issues/692#issuecomment-1691604236. Update2: Fix in #749.

vchong commented 1 year ago

Reopen because it'd be nice to figure out how to "add a config to networks.local.json to locally add an operator".