helium / helium-wallet-rs

Rust implementation of a helium wallet CLI
Apache License 2.0
258 stars 114 forks source link

Error when reasserting a DIY hotspot to a new location #131

Closed mjohngreene closed 3 years ago

mjohngreene commented 3 years ago

I am getting an error when I execute the command: ``helium-wallet hotspots assert --gateway 112thisismygatewayaddyyZBQFw6aqypcMqzDNTjiRe2WedUrq6ena --lat 28.736101 --lon -90.408167 --onboarding

error: Found argument '-9' which wasn't expected, or isn't valid in this context``

mfalkvidd commented 3 years ago

Try helium-wallet hotspots assert --gateway 112thisismygatewayaddyyZBQFw6aqypcMqzDNTjiRe2WedUrq6ena --lat 28.736101 --lon '-90.408167' --onboarding

(Note the two added ' )

mfalkvidd commented 3 years ago

I tested on my wallet, but I can't make any escaping work (tried ' and \ before the minus sign as well as exchanging the minus sign with \x2d). If the minus sign is removed, the command is accepted (with incorrect position of course). So this seems to be a problem with parsing (and a missing test case for negative numbers)?

madninja commented 3 years ago

the trick is to use the = to get past the -90 being detected as an option:

helium-wallet hotspots assert --gateway 112thisismygatewayaddyyZBQFw6aqypcMqzDNTjiRe2WedUrq6ena --lat 28.736101 --lon=-90.408167 --onboarding

mjohngreene commented 3 years ago

@madninja as much as I hate to do it after spinning everyone's wheels on Discord, I have to seek additional guidance. While the above fix did indeed help resolve the immediate issue, I did not have any joy figuring out how to resolve the following: helium-wallet hotspots assert --gateway 112thisismygatewayaddyypcMq1234zDNTjiRe2WedUrq6ena --lat 25.736101 --lon=-91.408167 --onboarding Password: [hidden] error: HTTP status client error (422 Unprocessable Entity) for url (https://onboarding.dewi.org/api/v2/transactions/pay/112thisismygatewayaddyypcMq1234zDNTjiRe2WedUrq6ena)

I suspect this might be due to possibly using both of the 2 "free" asserts when initially attempting the Alpha onboarding and, therefore, will have to pay to reassert. If that is the case, I would appreciate guidance as to how to arrange that payment with the CLI.

Alternatively, the "help" for the CLI's "assert" subcommand shows Assert a hotspot location on the blockchain. The original transaction is created by the hotspot miner and supplied here for owner signing. Use an onboarding key to get the transaction signed by the DeWi staking server so it might also be that somewhere in the command/process I need to provide the original onboarding hash allowing the original assert. If this is the case, please advise as to where/how to pass that hash with the CLI "assert" command.

madninja commented 3 years ago

@madninja as much as I hate to do it after spinning everyone's wheels on Discord, I have to seek additional guidance. While the above fix did indeed help resolve the immediate issue, I did not have any joy figuring out how to resolve the following: helium-wallet hotspots assert --gateway 112thisismygatewayaddyypcMq1234zDNTjiRe2WedUrq6ena --lat 25.736101 --lon=-91.408167 --onboarding Password: [hidden] error: HTTP status client error (422 Unprocessable Entity) for url (https://onboarding.dewi.org/api/v2/transactions/pay/112thisismygatewayaddyypcMq1234zDNTjiRe2WedUrq6ena)

I suspect this might be due to possibly using both of the 2 "free" asserts when initially attempting the Alpha onboarding and, therefore, will have to pay to reassert. If that is the case, I would appreciate guidance as to how to arrange that payment with the CLI.

Alternatively, the "help" for the CLI's "assert" subcommand shows Assert a hotspot location on the blockchain. The original transaction is created by the hotspot miner and supplied here for owner signing. Use an onboarding key to get the transaction signed by the DeWi staking server so it might also be that somewhere in the command/process I need to provide the original onboarding hash allowing the original assert. If this is the case, please advise as to where/how to pass that hash with the CLI "assert" command.

You're right in that you've used up your free asserts.. If the wallet you're creating this with has HNT in it, just remove the --onboarding option to have the wallet pay for the fees.

mjohngreene commented 3 years ago

Worked like a charm, @madninja. Thanks again for the assist.