Coder Social home page Coder Social logo

xjonathanlei / starkli Goto Github PK

View Code? Open in Web Editor NEW
150.0 7.0 41.0 659 KB

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀

Home Page: https://book.starkli.rs

License: Apache License 2.0

Rust 95.32% Shell 4.56% Dockerfile 0.12%
cli rust starknet

starkli's Introduction

starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀

Installation

If you're on a supported platform, the easiest way to install and update starkli is to use starkliup, which can be installed by running:

curl https://get.starkli.sh | sh

Once starkliup is installed, you can then install or update starkli simply by running the starkliup command without arguments:

starkliup

Behind the scene, starkliup downloads prebuilt binaries (built from GitHub Actions) so you don't need a Rust installation to use it.

Check out the Starkli book for more installation options.

Documentation

Documentation is available as the Starkli book.

License

Licensed under either of

at your option.

starkli's People

Contributors

easeev avatar glihm avatar joshklop avatar tensojka avatar vuittont60 avatar xjonathanlei avatar zmalatrax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

starkli's Issues

Unknown enum GatewayResponse

So just now i received following error: Error: data did not match any variant of enum GatewayResponse

The issue most likely was that there was not enough eth in wallet to pay for fees. I say most likely because when I added some eth to the wallet then the error showed no more. So maybe it is worth adding enum for such response.

Not a known account class hash

Hello, I am a beginner and I have this error when I try to create a descriptor account from a local node starknet-devnet-rs would it be possible to understand the nature of this error?
ty
Capture d'écran 2023-09-12 100112

Edit: Here's a concrete example of what I get with an address provided by the local node launch:

Capture d'écran 2023-09-12 113654

Error "Couldn't download release file" when trying to install starkli

After running curl https://get.starkli.sh | sh and start a new terminal, I got this error:

starkliup
Installing the latest version of starkli...
Fetching the latest release tag from GitHub...
Latest version found: 
Detected host triple: x86_64-unknown-linux-gnu
Downloading release file from GitHub...
######################################################################### 100,0%
Couldn't download release file for tag '' from GitHub [404].

starkliup -v
Version tag is missing

Please fix it, thank you so much! @xJonathanLEI

Issue installing on MacOSX

running
curl https://get.starkli.sh | sh
then whether i open a new window or run
. /Users/Matt/.starkli/env
and run starkliup
I get the following error
Couldn't download release file for tag '' from GitHub [404].
Screen Shot 2023-08-28 at 11 00 19 AM

Feature request: Print raw Tx

It would be very useful to have an option to print out the raw transaction without broadcasting it to the network.
For example, to compare a possible future transaction with an existing transaction on the network, and see the difference.

Example:

[~/Code/Starknet/starkli]> starkli invoke eth transfer 0x5465aa79114f0415f95100cafeb4640b17bce2653810903738ac6c1a7694b6c 100 0 --raw-tx
Enter keystore password:
{
  "type": "INVOKE",
  "sender_address": "0x3e4447641b3c09b3fe3571911352e0cb1027b0799f699245859cf588314fe5d",
  "calldata": [
    "0x1",
    "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
    "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",
    "0x0",
    "0x3",
    "0x3",
    "0x5465aa79114f0415f95100cafeb4640b17bce2653810903738ac6c1a7694b6c",
    "0x64",
    "0x0"
  ],
  "max_fee": "0x3cc4cff9230",
  "version": "0x100000000000000000000000000000001",
  "signature": [
    "0x11b0d36e8b9a7cb150dc6a3c0ce09872016a733989a1c22cdbad8e99488095f",
    "0x70bb815da62d1ded7eb31c4a8fabab18b2978506f3b0803f830ba699a569102"
  ],
  "nonce": "0x6"
}

feat: add codespell linter tool for CI

Codespell linter tool is very important for code and system quality.

Sometimes, because of typo error, the system will go to bad and even crash, and take us much time to debug...

So I want to add codespell linter tool for CI.

Installation issue for macOS with oh-my-zsh

After running:

curl https://get.starkli.sh | sh

and launching a new shell I get

compinit:141: parse error: condition expected: $1
compinit:571: compinit: function definition file not found
/Users/timothyedison/.starkli/env:16: compinit: function definition file not found

Issue is coming from this line added in .profile:

. "/Users/timothyedison/.starkli/env"

When commenting it (it's already present in .zshrc in my case) everything works fine.

Add support for `non-known` account class hash

As we've seen recently, lot's of people without coding background are struggling using custom account with starkli.

Could we think about a way that Starkli is not checking the account class hash, even if we have to display an error message?

Because in the first idea it was that any people using custom account contract will have the knowledge to edit files manually. But with katana or other devnet we've seen that new developers / users are facing this issue and don't always have the knowledge to create the files.

WDYT @xJonathanLEI?

feature request: profiles

I use starkli for various projects and in various ways. In some cases, I have simple .sh scripts will all the settings. In others, I either have a long running shell session with the env vars exported (which is a PITA to setup again if I had to restart my OS) or passing some/all necessary args via the command line. In each case tho I use different config options to run starkli. These change on a per project basis.

I would appreciate a way to have the management of this simplified. I don't have a clear picture how this ought to look like, just curious if you'd be willing to add something like this. Maybe a STARKLI_PROFILE / --profile arg that would read all the rest of the config options (RPC, networks, account, private key, etc.) from a file? An integration with Scarb via a [tool.starkli] section in Scarb.toml would also be nice.

Issue with --account flag: Account Config File Not Found Error

Hey @xJonathanLEI!

When using the --account flag in a declaration, I am not getting the following error:

starkli declare target/dev/starknetbook_chapter_2_Vote.sierra.json --compiler-version=2.0.1 --rpc=http://0.0.0.0:5050 --account=~/.starkli-wallets/deployer/account0.json

Error: account config file not found

However, when the account is set, with the same path, as an ENV variable, there is no problem:

export STARKNET_ACCOUNT=~/.starkli-wallets/deployer/account0.json

Need help, program don't works

Hello,
I can't get your program to work and the documentation is incomplete.
I've already opened an issue but it didn't help.

Can you just list the steps required (commands) to deploy a smart contract, on a katana node for example?

can't fetch oz account

starkli version 0.1.10 (90ba98c)
I use the cairo2.1.0 compiler,depolyed a oz account
can't fetch oz account,argent is OK

starkli account fetch 0x041ffa911a144d39e2c7bbb2c6c7eaf1594f6b2669e1cbcc02f9d769aaf5e148
NOTE: --output is not supplied and the account config won't be persisted.
WARNING: no valid provider option found. Falling back to using the sequencer gateway for the goerli-1 network. Doing this is discouraged. See https://book.starkli.rs/providers for more details.
0x048ee94b4dd54b5d2287fc9dd33834bd30ecd3bed6e92d7e8097b4a55dcaccf0 is not a known account class hash. If you believe this is a bug, submit a PR to:
https://github.com/xJonathanLEI/starkli
Error: unknown class hash: 0x048ee94b4dd54b5d2287fc9dd33834bd30ecd3bed6e92d7e8097b4a55dcaccf0

Feature Request: Add support for `secp256r1` and `secp256k1`

The structure of the file account.json that describes an account contract only supports one type, open_zeppelin that relies on a single signer using the stark friendly elliptic curve found in the cairo package ecdsa.

{
  "version": 1,
  "variant": {
    "type": "open_zeppelin",
    "version": 1,
    "public_key": "<SMART_WALLET_PUBLIC_KEY>"
  },
  "deployment": {
    "status": "deployed",
    "class_hash": "<SMART_WALLET_CLASS_HASH>",
    "address": "<SMART_WALLET_ADDRESS>"
  }
}

It would be very useful to also include support for single signer using secp256k1 (Ethereum's ECC) and secp256r1 (Standard ECC). Both ECCs are already available inside the cairo repo under starknet.

Feature request: send raw tx

As a complementary feature to #57, it would be great to have the option to broadcast a raw tx by only providing a network/RPC provider.
Useful if you want to modify data created by --raw-tx manually, and then only use starkli as a convenient interface to broadcast the raw JSON data (e.g. by supplying a file or a string)

Can't deploy to testnet with cairo v2.1.0

Running $starkli declare ./target/dev/x.sierra.json --compiler-version 2.1.0

returns

error: invalid value '2.1.0' for '--compiler-version <COMPILER_VERSION>'
 [possible values: 2.0.1]

 tip: a similar value exists: '2.0.1'

question about mine-udc-salt

I want to compute the salt that make a contract(calldata_len is 0) start with 0x04515, I use starkli lab mine-udc-salt --prefix 4515 --suffix 0 --deployer-address [DEPLOYER] [CLASSHASH] but show Error: invalid bit: 5

  1. Could you give example how to do it?
  2. Can --suffix be optional?
  3. At https://github.com/xJonathanLEI/starkli/blob/e4d23076b67c05fccc2d7bda069561daaa1fde06/src/subcommands/lab/mine_udc_salt.rs#L110 , let prefix_bits = self.suffix should be let prefix_bits = self.prefix

suppress certain warnings for example `using private key in plain text`

This warning can be misleading due to use-case. For example in our case, we would like to use our standard encryption and secrets protocol to encrypt our key. During usage this is decrypted and passed to the command in a single step (starkli --private-key $(decypt-key).

The warning in this case does not apply since the key is not leaked as plaintext in the shell history. Would be appreciated if there was a way to suppress certain warnings that do not apply. Additionally it would be much appreciated if we can pass a PRIVATE_KEY environment variable instead since that is a fairly standard method of passing secrets to programs.

Issue with Starkli Deployment and Class Hash Retrieval

I encountered an issue while attempting to declare my first Cairo contract on Starknet using Starkli following the giudes from an article authored by David Barreto. After successfully installing Starkli using the following command:

curl https://get.starkli.sh | sh 

I used this command to declare:

starkli declare target/dev/cairo_intro_Balance_counter.sierra.json --account $STARKNET_ACCOUNT

I provided the required password (1234), but the process resulted in the following error:

Error: No such file or directory (os error 2)

This unexpected error prevented the successful deployment of my Cairo contract.

Additionally, when attempting to retrieve the class hash for Goerli using this command:

starkli block-number --network goerli-1

I encountered the following error:

data did not match any variant of enum GatewayResponse

but i can successfully get the class hash for mainnet using this command:

starkli block-number --network mainnet

It seems that this issue is related to Starkli functionality, and I would appreciate it if the maintainers could investigate and provide feedback on resolving these errors.

Additional Information:

  • Operating System: macOS Big Sur version 11.7.10
  • Starkli Version: 0.1.20 (e4d2307)

Your prompt attention to this matter and any assistance in resolving these issues would be highly appreciated.If you need more info I'll provide it as soon as possible. Thank you.

feature request: custom RPC headers

Some RPC providers (notably Nethermind) use the same URL for their RPC endpoints and auth is done via a custom HTTP header (in this case x-apikey). Would it be possible for starkli to support this?

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

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

  • Starkli: 0.1.19 (3fd85cf)
  • Scarb: scarb 2.3.1 (0c8def3aa 2023-10-31)
  • Cairo: cairo: 2.3.1 (https://crates.io/crates/cairo-lang-compiler/2.3.1)
  • Sierra: sierra: 1.3.0
  • RPC Source: Alchemy https://starknet-goerli.g.alchemy.com/v2/4VUpCv...

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!

short string exceed 31 character limit

$ starkli to-cairo-string 0x0740c2dd633f2611BF0dB5220317FF6b0fBa399989a3f94b386C7aD26C54D47d
Error: short string exceeds maximum length of 31 characters

STARKNET_KEYSTORE not shown in help

As mentioned in the code here we don't want the conflict clap would introduce.

In the meantime, having a hand-written [env: STARKNET_KEYSTORE=] could be useful for the users that just downloaded Starkli and can have all environment variables from detailed help.

Incorrect network warning

starkli version: 0.1.2

I was using starkli to declare a contract. This is the command I ran:

starkli declare --account ./goerli-experiments-account.json --keystore ~/.starknet_accounts/goerli-experiments.keystore  target/dev/xoroshiro_Xoroshiro.sierra.json
WARNING: when using JSON-RPC, the --network flag is ignored. There's no need to use --network as network is automatically detected.

I had both STARKNET_RPC and STARKNET_NETWORK set as envvars.

I think the warning is confusing as I didn't use --network in my command.

RUSTSEC-2020-0071: Potential segfault in the time crate

Potential segfault in the time crate

Details
Package time
Version 0.1.45
URL time-rs/time#293
Date 2020-11-18
Patched versions >=0.2.23
Unaffected versions =0.2.0,=0.2.1,=0.2.2,=0.2.3,=0.2.4,=0.2.5,=0.2.6

Impact

Unix-like operating systems may segfault due to dereferencing a dangling pointer in specific circumstances. This requires an environment variable to be set in a different thread than the affected functions. This may occur without the user's knowledge, notably in a third-party library.

The affected functions from time 0.2.7 through 0.2.22 are:

  • time::UtcOffset::local_offset_at
  • time::UtcOffset::try_local_offset_at
  • time::UtcOffset::current_local_offset
  • time::UtcOffset::try_current_local_offset
  • time::OffsetDateTime::now_local
  • time::OffsetDateTime::try_now_local

The affected functions in time 0.1 (all versions) are:

  • at
  • at_utc
  • now

Non-Unix targets (including Windows and wasm) are unaffected.

Patches

Pending a proper fix, the internal method that determines the local offset has been modified to always return None on the affected operating systems. This has the effect of returning an Err on the try_* methods and UTC on the non-try_* methods.

Users and library authors with time in their dependency tree should perform cargo update, which will pull in the updated, unaffected code.

Users of time 0.1 do not have a patch and should upgrade to an unaffected version: time 0.2.23 or greater or the 0.3 series.

Workarounds

No workarounds are known.

See advisory page for additional details.

Feature request: Not able to deploy contract to starknet using scarb nightly and above 2.3.1

I am using these as my environment variable to deploy contract and respective versions
Scarb version :- 2.4.1+nightly-2024-01-06 (9583fdec4 2024-01-06)
cairo version :- cairo: 2.4.1 (adeb61730)

`export STARKNET_ACCOUNT=~/.starkli-wallets/deployer/infura.json
export STARKNET_RPC=https://starknet-goerli.infura.io/v3/b7be8b0d609c4500b14a148fa5654c7d

export STARKNET_KEYSTORE=~/.starkli-wallets/deployer/testaccount1.json`

so when i am trying to fetch the account it works fines as
`0x04b90b40d1928284523ad190fec328e8dcd07c68a9290a5f92e3859a99a27ec0 --output ~/.starkli-wallets/deployer/testaccount1.json
Account contract type identified as: Braavos

Description: Braavos official proxy account (legacy)`

But when i am trying to declare the contract it shows me an error:-

`Enter keystore password:

Error: serde-json: missing field crypto at line 22 column 1`

I tried for various others version although it works fine for scarb 2.3.1 and cairo 2.3.1 but not for above versions like 2.4.0

skarkli declare error

Hi there, I used the command "starkli declare" to declare my sierra code, but it prints:
image
I don't know why, my scarb version=0.5.2

feat: remove gateway fallback

Some new users are starting to experience errors like:

[2023-11-28T04:41:06Z TRACE starknet_providers::sequencer] Response from sequencer API: {"code": "StarknetErrorCode.DEPRECATED_ENDPOINT", "message": "Endpoint is deprecated from version 0.12.3."}

I don't have official info but @xJonathanLEI you perhaps have some more accurate information about exact dates of Gateway deprecation. The warning is not enough for new users, and the use of --log-traffic is not obvious for non-experienced user so they are stuck until someone guide them to use RPC instead.

Any feedback on this would be appreciated. 🙏

Unable to Deploy Extended ERC20 Contract using starkli v0.1.15

Hello,

I've been encountering a persistent issue when trying to deploy a contract on StarkNet using starkli. Despite multiple attempts and variations in the command structure, I keep receiving the same validation failure error.

Environment:

Starkli Version: 0.1.15
StarkNet Version: v2.2.0
Contract: Extension of the ERC20 standard from OpenZeppelin v0.7.0-rc.0

starkli deploy --account ~/.starkli-wallets/deployer/account.json --keystore ~/.starkli-wallets/deployer/keystore.json --watch 0x0751012e95eb15318a7036d935c552bf19c526a429c90dc7d8aa611f0e530cc4 u256:100 0x052E6AD8187767eF41F2F3bc225D33d31B37DD9BBEE7B628F4b6b16b90D293EC
2.
starkli deploy --account ~/.starkli-wallets/deployer/account.json --keystore ~/.starkli-wallets/deployer/keystore.json --watch 0x0751012e95eb15318a7036d935c552bf19c526a429c90dc7d8aa611f0e530cc4 u256:100 addr:0x052E6AD8187767eF41F2F3bc225D33d31B37DD9BBEE7B628F4b6b16b90D293EC
Expected Behavior:
The contract, which is an extension of the new ERC20 from OpenZeppelin v0.7.0-rc.0, should deploy successfully.

Actual Behavior:
for the first command I received the following error:
Error: code=ValidationFailure, message="Execution was reverted; failure reason: [0x496e70757420746f6f206c6f6e6720666f7220617267756d656e7473]."
(Note: The error message decodes to "Input too long for arguments")

for the second command I get:
Error: address book entry not found for "0x052E6AD8187767eF41F2F3bc225D33d31B37DD9BBEE7B628F4b6b16b90D293EC"

It would be great if you could help identify the root cause of this issue or guide me on any corrective steps to take.

Thank you for your assistance!

Can't deploy new account at sepolia

run starkli account deploy ~/.starkli-wallets/deployer/account.json --log-traffic

show

[2023-12-17T11:32:19Z TRACE starknet_providers::jsonrpc::transports::http] Response from JSON-RPC: {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid params","data":{"reason":"invalid type: string \"pending\", expected a sequence at line 1 column 499"}},"id":1}

RPC:
https://starknet-sepolia.public.blastapi.io/rpc/v0_6

starkli --version
0.1.20 (e4d2307)


if use https://free-rpc.nethermind.io/sepolia-juno/v0_6 , show error [2023-12-17T11:37:24Z TRACE starknet_providers::jsonrpc::transports::http] Response from JSON-RPC: {"jsonrpc":"2.0","error":{"code":-32602,"message":"Invalid Params","data":"missing/unexpected params in list"},"id":1}

Can't compile Cairo contracts compiled with compiler v2.2

So I have contracts compiled with compiler version 2.2 (scarb 0.7) and when I try to deploy them with starkly I get

error: invalid value '2.2.0' for '--compiler-version <COMPILER_VERSION>'
  [possible values: 2.1.0, 2.4.0]

  tip: a similar value exists: '2.4.0'

For more information, try '--help'.

And if I try to compile with compiler v2.4 for example I get

Declaring Cairo 1 class: 0x02b7501440b04afd348928b6eb7b22a7e181cf0c5ba7c107489b08cc5decdd48
Compiling Sierra class to CASM with compiler version 2.4.0...
CASM class hash: 0x05400d2048ff37beaff03384b8c0e73f6df9d8660228ff6448b9469d2d6a3fca
Error: expected value at line 1 column 1

The thing is that I can only compile them with v2.2. Is there any solution to declare and deploy them ?
If anyone wants to reproduce, I'm trying to redeploy the Loot Survivor contracts (https://github.com/BibliothecaDAO/loot-survivor/tree/production) and you must use Scarb v0.7 to build the contracts

Trimmed error message

Ran into an error when I was deploying a contract. However the error message I got back from starkli seems to be trimmed:

Error: JSON-RPC error: code=-32603, message="Internal error: StarknetErrorCode.TRANSACTION_FAILED: Error at pc=0:12:
Got an exception while executing a hint.
Cairo traceback (most recent call last):
Unknown location (pc=0:161)
Unknown location (pc=0:147)

Error in the called contract (0x765c1816..."

That was all that got printed out, in read, to the terminal. Can you please make it print the whole error? Or is it trimmed somewhere else?

Insufficient help for declare

Running starkli declare with no args, just to see the help message yields

starkli declare
error: the following required arguments were not provided:
  <FILE>

Usage: starkli declare --account <ACCOUNT> --rpc <RPC> --network <NETWORK> <FILE>

For more information, try '--help'.

But for declare to work, I must pass in the --keystore as well. This is not obvious just from the help message. When I ran it without --keystore the output was

Error: no valid signer option provided

which did lead me to the right solution, though I initially used --signer instead of --keystore because I'm new to the tool and the error message mentions "signer" 🙈

Can the initial help message of declare be improved to mention the command needs a signer as well?

How to deploy a contract on the 0.13.0 testnet?

I want to declare new contract in new testnet, but show error below. How should I do next?

starkli declare target/dev/src_Test.contract_class.json
Enter keystore password:
Sierra compiler version not specified. Attempting to automatically decide version to use...
Unknown network. Falling back to the default compiler version 2.1.0. Use the --compiler-version flag to choose a different version.
Declaring Cairo 1 class: 0x06fe4be614eddfe1ca0c5ab160f132b4d690cea0d7e2e82a031d464db7b6c6db
Compiling Sierra class to CASM with compiler version 2.1.0...
Error: error from the program registry

RPC:
https://starknet-sepolia.public.blastapi.io/rpc/v0_6

Scarb version:
scarb 2.4.0 (cba988e68 2023-12-06)
cairo: 2.4.0 (https://crates.io/crates/cairo-lang-compiler/2.4.0)
sierra: 1.4.0

starkli --version
0.1.20 (e4d2307)

Issue with starknet-devnet interaction resulting in response decoding error

Hey! Amazing tool! It is currently the recommended way to interact with Starknet in the Starknet Book.

I'm running into a bit of trouble with the devnet, though. I want to add to the Book some examples using the devnet and starkli. I've set up the Signer and Account Descriptor for an Account on starknet-devnet. But I get an error when I try to declare with the devnet. Here's the command I'm using:

❯ starkli declare target/dev/starknetbook_chapter_2_Vote.sierra --rpc=http://127.0.0.1:5000/ --compiler-version=2.0.1

Error: error decoding response body: expected value at line 1 column 1

No such issue when I'm on the testnet. The same error pops up when I'm making other calls with the devnet. For example:

❯ starkli class-hash-at 0x7e00d496e324876bbc8531f2d9a82bf154d1a04a50218ee74cdd372f75a551a --rpc=http://127.0.0.1:5000

Error: error decoding response body: expected value at line 1 column 1

Any help would be great! Thanks for your time.

Possible bug in u256 scheme resolution

As per the book I was trying to send some ETH on Sepolia. This failed:

starkli invoke 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 transfer 0x06614f0ca97aef455365596cfcb78ca16639537423afb591a581a0ab19c5c0ea u256:1000000000000000000 --rpc https://starknet-sepolia.public.blastapi.io --keystore ./sepolia_keystore.json --account ./sepolia_cmdline.json
Enter keystore password:
Error: JSON-RPC error: code=-32602, message="Invalid params", data={"reason":"expected value at line 1 column 589"}

When I split the u256 into 1000000000000000000 0 it succeeded

starkli invoke 0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 transfer 0x06614f0ca97aef455365596cfcb78ca16639537423afb591a581a0ab19c5c0ea 1000000000000000000 0 --rpc https://starknet-sepolia.public.blastapi.io/rpc/v0_6 --keystore ./sepolia_keystore.json --account ./sepolia_cmdline.json
Enter keystore password:
Invoke transaction: 0x0437cd8bd49b96d9b016964bb2eba5d1f5657f5bbf7065f6e3c072d0fd8b7d63

I'm using the latest starkli:

starkli --version

0.2.4 (7919143)

feat: deploying contracts via UDC

It would be awesome to have a one step deploy command. Basically this new way of deploying using UDC in the CLI.

I think I remember your intention with starkli is to replace the starknet command, so this would be beyond its scope, but I wonder if I can nerd snipe you into doing it regardless 😇

Bonus point: if the command is passed a .cairo file, it would also do the compile & declare steps 💥

starkli account fetch command unexpected argument error

I was following the Starknet developer documentation and encountered an issue while trying to use the starkli account fetch command. The documentation suggests the following command:
starkli account fetch 0x0--------C--F2 ~/starkli-wallets/deployer/account.json
However, when I tried to execute this command, I received the following error:

error: unexpected argument '/Users/baiyuguang/starkli-wallets/deployer/account.json' found
Usage: starkli account fetch [OPTIONS]

when i use this command:
image

Is it possible to allow override of cairo compiler?

Scarb allows the override of the cairo compiler: https://github.com/software-mansion/scarb/blob/529865094ea02ea67e77e07f1f0e8161e287f809/scarb/build.rs#L36 by simply setting the archive path of CARIO_ARCHIVE

This makes it very easy especially when building with nix to simply set the compiler/binaries version and upgrade without requiring a scarb upgrade. Is it possible to do something similar on this project to avoid requiring a starkli code change in order to bump the cairo compiler? (for example cairo compiler is on 2.2.0 now but starkli is on 2.1.0)

I'm assuming non breaking changes at the risk of the user

zsh shell not detected when installing

I'm using zsh on Mac with oh-my-zsh and when I try to install Starkli using:

curl https://get.starkli.sh | sh

I get the message:

Shell detection variables (for debugging use):
- ZSH_NAME =
- SHELL = /bin/zsh

starkliup: could not detect shell. Add '. /Users/david/.starkli/env' to your shell profile, or manually add '/Users/david/.starkli/bin' to your PATH environment variable.

Not a big deal but it would be nice if I could avoid having to add the path to my config file manually

Error deploying contract using infura

Command ran:

starkli deploy {class_hash} {wallet_hash} --network=goerli-1 --rpc=https://goerli.infura.io/v3/{api_key}

Error: code=-32601, message="The method starknet_chainId does not exist/is not available"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.