xJonathanLEI / starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀
https://book.starkli.rs
Apache License 2.0
164 stars 47 forks source link

Help: Issue with `starkli account deploy` - `JsonRpcResponse` Enum Error #44

Closed CyndieKamau closed 11 months ago

CyndieKamau commented 11 months ago

Hi @xJonathanLEI!! My name is Cyndie.

I have been contributing to Account Abstraction chapters in the starknetbook, using David's tutorials as guidance.

I have come across an issue that I've been unable to resolve several times now:

Issue

When attempting to deploy an account contract with Starkli after successful declaration, using the command below:

starkli account deploy ~/.starkli-wallets/custom/account.json

I have been getting this Error output consistently:

Error: data did not match any variant of untagged enum JsonRpcResponse

Here's my detailed flow and corresponding output:

hp@Cyndie:~/Desktop/account_abstraction__starknet/aa$ starkli account deploy ~/.starkli-wallets/custom/account.json
Enter keystore password: 
The estimated account deployment fee is 0.000004330000051960 ETH. However, to avoid failure, fund at least:
    0.000006495000077940 ETH
to the following address:
    0x0062f981ae9d6babd3f6176fbb7fc9e6f7b424e48fcd9b77781ba0076193ec2e
Press [ENTER] once you've funded the address.
Account deployment transaction: 0x058534bd8361061792a8fc9d4c0040e876966abb19991560f875243ac9b7c839
Waiting for transaction 0x058534bd8361061792a8fc9d4c0040e876966abb19991560f875243ac9b7c839 to confirm. If this process is interrupted, you will need to run `starkli account fetch` to update the account file.
Transaction not confirmed yet...
Transaction not confirmed yet...
Error: data did not match any variant of untagged enum JsonRpcResponse

Context and Documentation

For comprehensive context, I have documented my entire setup and deployment process here.

Environment details

Attempted solutions

When I tried to check the source code to pin down where the enum JsonRpcResponse is I couldn't find it, so I have reached out for help.

Thank you for your time!

milancermak commented 11 months ago

Had pretty much the same issue. After switching the RPC from Alchemy to Infura, it went away.

xJonathanLEI commented 11 months ago

Can you try running the command again with --log-traffic?

xJonathanLEI commented 11 months ago

I'm assuming this is the same situation as this one provided by @milancermak. If that's the case, then it's because the receipt response from your JSON-RPC endpoint does not include the field execution_result as required by spec v0.4.0.

It looks like this endpoint you're using is serving JSON-RPC spec v0.3.0, which does not have this field on receipts. The current version of Starkli only supports v0.4.0.

If you have to use spec v0.3.0, you will need to downgrade Starkli to a previous version that uses this old spec version, as Starkli does not currently support using multiple spec versions side by side (actually, anything before spec v0.4.0 doesn't even offer an option to query the spec version, making it hard to support anyways).

Closing this as not in scope.

CyndieKamau commented 11 months ago

Hey @milancermak Yes with Infura it works! Thank you.

hp@Cyndie:~/Desktop/account_abstraction__starknet/aa$ starkli account deploy ~/.starkli-wallets/custom/account.json
Enter keystore password: 
The estimated account deployment fee is 0.000004330000038970 ETH. However, to avoid failure, fund at least:
    0.000006495000058455 ETH
to the following address:
    0x074b028953413ce9a3787f2d45e9e1459d0acbcc5e6499e7cb3470eb4bb83a79
Press [ENTER] once you've funded the address.
Account deployment transaction: 0x04348a81c550192ee75dad0183d432b0d18ac497dd8188d145979282fb649008
Waiting for transaction 0x04348a81c550192ee75dad0183d432b0d18ac497dd8188d145979282fb649008 to confirm. If this process is interrupted, you will need to run `starkli account fetch` to update the account file.
Transaction not confirmed yet...
Transaction not confirmed yet...
Transaction 0x04348a81c550192ee75dad0183d432b0d18ac497dd8188d145979282fb649008 confirmed

Okay @xJonathanLEI thanks! Thank you guys for your assistance.