-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using rpcclient GetNewAddress shows -32600: Invalid request #1843
Comments
You're using the In 061aef9, the Just use the rpcclient package from the v0.22.0-beta tag or right before 061aef9. You should probably also update your btcwallet from 0.7.0 to latest (cli will show 0.11.0, but tag is 0.14.0) |
BTW, @jcvernaleo and @Roasbeef to keep the Or the rpcclient method can be modified to have a type of func (c *Client) GetNewAddressAsync(account, addrType string) FutureGetNewAddressResult {
aType := &addrType
if addrType == "" {
aType = nil
}
cmd := btcjson.NewGetNewAddressCmd(&account, aType) (assuming you want rpcclient to work with older versions of the apps like in this issue, debatable) In any case, the wallet PR btcsuite/btcwallet#783 is needed to actually request different address types. |
i have update my btcwallet from 0.7.0 to 0.14.0(i didn't modify the code). |
i checked the btcctl, using |
As I explained, btcwallet does not support the address type argument yet. That PR still needs to be merged. btcwallet does not yet support the address type argument. |
I don't understand the relevance of #1519. The fix PR was merged long before v0.22.0-beta. |
ok, i understand your meaning, but face another problem now,when i compile my code it shows |
|
Is that your entire go.mod file? You have no Also, you should not need a Edit your go.mod in a text editor, and then do |
This comment was marked as resolved.
This comment was marked as resolved.
it seems that i have solved it now, i'm not sure, i will close this comment as i confirm it was done. Really thanks for your help. : ) |
my version of btcd/btcwallet:
btcd version 0.22.0-beta
btcwallet version 0.7.0-alpha
After running
btcd --simnet --rpcuser=rpcuser --rpcpass=rpcpass --rpclisten=0.0.0.0:18556 --listen=0.0.0.0:18555
&btcwallet --simnet --username=rpcuser --password=rpcpass
the btcwallet RPC server listening on 127.0.0.1:18554after connecting to btcw rpcserver with the config
connCfg := &rpcclient.ConnConfig{ Host: "localhost:18554", Endpoint: "ws", User: "rpcuser", Pass: "rpcpass", Params: "simnet", Certificates: certs, }
using the api
address,err:=client.GetNewAddress("default","legacy")
the err shows that-32600: Invalid request
.Does anyone know the possible solution of this situation?
PS: i have tried
ListAccounts
&GetAddressesByAccount
,they can return the correct data.The text was updated successfully, but these errors were encountered: