### Install Website Dependencies Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/README.md Run this command to install all necessary Node.js dependencies for the website. ```bash $ npm install ``` -------------------------------- ### Install starkup tool Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Installs the starkup tool, which manages Starknet-related tools including starknet-devnet. This command downloads and executes the starkup installation script. ```bash $ curl --proto '=https' --tlsv1.2 -sSf https://sh.starkup.sh | sh ``` -------------------------------- ### Install Starknet Devnet from crates.io Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Installs the Starknet Devnet executable binary from crates.io using cargo. This downloads, builds, and installs the crate to your ~/.cargo/bin directory. ```bash $ cargo install starknet-devnet ``` -------------------------------- ### Start Local Development Server Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/README.md Starts a local development server that automatically reflects changes. A browser window will open automatically. ```bash $ npm run start ``` -------------------------------- ### Starknet Core Constructor Example Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/postman.md Example of a Starknet Core contract constructor taking an `IStarknetCore` contract as an argument. ```solidity constructor(IStarknetCore starknetCore_) public { starknetCore = starknetCore_; } ``` -------------------------------- ### Run Starknet Devnet from source Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Installs and runs the Starknet Devnet directly from its source code repository using cargo. This command builds the project and starts the Devnet. ```bash $ cargo run ``` -------------------------------- ### Start Time Configuration Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/starknet-time.md Configures the starting timestamp for Devnet's genesis block via the CLI. ```APIDOC ## Start Time ### Description Devnet's starting timestamp can be defined via CLI by providing a positive value of [Unix time seconds](https://en.wikipedia.org/wiki/Unix_time) to the `--start-time` flag. If provided, this timestamp shall be used in mining the genesis block. The default value is the current Unix time. ### Command Line Interface ```bash $ starknet-devnet --start-time ``` ### Parameters - **--start-time** (integer) - Optional - The desired starting timestamp in Unix time seconds for the genesis block. ``` -------------------------------- ### Mock Starknet Messaging Constructor Example Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/postman.md Example of a constructor for Devnet's L1-L2 communication testing, replacing `IStarknetCore` with `MockStarknetMessaging`. ```solidity constructor(MockStarknetMessaging mockStarknetMessaging_) public { starknetCore = mockStarknetMessaging_; } ``` -------------------------------- ### Start Local Node with Anvil Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/contracts/l1-l2-messaging/solidity/README.md Launches a local Ethereum node for development and testing. This command starts Anvil with default settings. ```shell anvil ``` -------------------------------- ### WebSocket Subscription Example Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/versioned_docs/version-0.8.1/api.md Demonstrates how to subscribe to new block heads using the WebSocket API. This example uses `wscat` to connect to the Devnet's WebSocket endpoint and send a subscription request. ```APIDOC ## WebSocket Subscription ### Description Access Starknet and Devnet JSON-RPC API, including WebSocket subscription methods, via the WebSocket protocol. Devnet listens for new WebSocket connections at `ws://:/ws`. ### Method WebSocket ### Endpoint `ws://:/ws` ### Example Usage with `wscat` Connect to the WebSocket endpoint: ```bash $ wscat -c ws://127.0.0.1:5050/ws Connected (press CTRL+C to quit) ``` Send a subscription request for new block heads: ``` > { "jsonrpc": "2.0", "id": 0, "method": "starknet_subscribeNewHeads" } ``` Receive a confirmation response: ``` < {"id":0,"result":2935616350010920547,"jsonrpc":"2.0"} ``` ``` -------------------------------- ### WebSocket Subscription Example Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/api.md Demonstrates how to subscribe to new block heads using the WebSocket API. This example uses `wscat` to connect to the Devnet WebSocket endpoint. ```APIDOC ## WebSocket Subscription ### Description Access Starknet and Devnet JSON-RPC API methods, including WebSocket subscription methods, via the WebSocket protocol. ### Endpoint `ws://:/ws` ### Example Usage (using wscat) ```bash $ wscat -c ws://127.0.0.1:5050/ws Connected (press CTRL+C to quit) > { "jsonrpc": "2.0", "id": 0, "method": "starknet_subscribeNewHeads" } < {"id":0,"result":2935616350010920547,"jsonrpc":"2.0"} ``` ``` -------------------------------- ### Environment Setup and Contract Compilation Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/contracts/l1-l2-messaging/README.md Sources environment variables and compiles both Cairo and Solidity contracts. Ensure you are in the root directory of the README. ```bash # This .env file combines variables for both chains. source ./.env # Compile cairo contracts. scarb --manifest-path ./cairo/Scarb.toml build # Compile solidity contracts. forge install --root ./solidity forge build --root ./solidity ``` -------------------------------- ### Run a Docker container Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/docker.md Start a Starknet Devnet Docker container, publishing the internal port to the host machine. Replace `` with your desired host port. ```bash docker run -p [HOST:]:5050 shardlabs/starknet-devnet-rs [OPTIONS] ``` -------------------------------- ### Enable Metrics with Host and Port Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/metrics.md Customize the metrics server port using the `--metrics-port` parameter when starting Devnet. ```bash $ starknet-devnet --metrics-host 127.0.0.1 --metrics-port 8080 ``` -------------------------------- ### Install Starknet Devnet from GitHub Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Installs the Starknet Devnet directly from its GitHub repository. The --locked flag ensures that the dependencies specified in Cargo.lock are used. ```bash $ cargo install --git https://github.com/0xSpaceShard/starknet-devnet.git --locked ``` -------------------------------- ### Install latest Starknet Devnet version with asdf Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Installs the latest available version of starknet-devnet using the asdf version manager. ```bash $ asdf install starknet-devnet latest ``` -------------------------------- ### Start Forking Devnet Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/forking.md Use this command to start Devnet and fork from a specified Starknet network URL. You can optionally specify a block number to fork from; otherwise, it defaults to the latest block. ```bash $ starknet-devnet --fork-network [--fork-block ] ``` -------------------------------- ### Enable Metrics with Host Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/metrics.md Start Devnet with the `--metrics-host` parameter to enable metrics. The server defaults to port 9090. ```bash $ starknet-devnet --metrics-host ``` -------------------------------- ### Install specific Starknet Devnet version with asdf Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Installs a specific version of starknet-devnet using the asdf version manager. ```bash $ asdf install starknet-devnet 0.2.0 ``` -------------------------------- ### List available Starknet Devnet versions with asdf Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Lists all installable versions of starknet-devnet using the asdf version manager. ```bash $ asdf list-all starknet-devnet ``` -------------------------------- ### Get Help for Foundry Tools Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/contracts/l1-l2-messaging/solidity/README.md Displays help information for Forge, Anvil, and Cast commands, listing available options and subcommands. ```shell forge --help ``` ```shell anvil --help ``` ```shell cast --help ``` -------------------------------- ### Run installed Starknet Devnet executable Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Executes the Starknet Devnet after it has been installed via cargo or other methods. Ensure the executable is in your system's PATH. ```bash $ starknet-devnet ``` -------------------------------- ### Connect to Devnet WebSocket and Subscribe Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/api.md Connect to the Devnet WebSocket endpoint and subscribe to new block headers. This example uses wscat to demonstrate the interaction. ```bash $ wscat -c ws://127.0.0.1:5050/ws Connected (press CTRL+C to quit) > { "jsonrpc": "2.0", "id": 0, "method": "starknet_subscribeNewHeads" } < {"id":0,"result":2935616350010920547,"jsonrpc":"2.0"} ``` -------------------------------- ### Pull Docker image with zero-seeded accounts Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/docker.md Download images that predeploy funded accounts with `--seed 0` for consistent account setup. This can be combined with specific versions or the `latest` tag. ```bash docker pull shardlabs/starknet-devnet-rs:-seed0 ``` ```bash docker pull shardlabs/starknet-devnet-rs:latest-seed0 ``` -------------------------------- ### Automatic Periodic Block Creation Example Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/blocks.md Demonstrates automatic block generation at a specified interval. New blocks are mined every 10 seconds, and transactions are included. Manual block creation can also be triggered. ```bash # t $ starknet-devnet --block-generation-on 10 # t + 1s # user: send tx1 # t + 4s # user: send tx2 # t + 10s # Devnet: block automatically generated, contains tx1 and tx2 # t + 12s # user: send tx3 # t + 14s # user: invoke empty block creation # Devnet: generated block contains tx3 # t + 20s # Devnet: block automatically generated, contains no txs (manual creation did not restart the counter) ``` -------------------------------- ### Dump Devnet on Request (CLI) Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/dump-load-restart.md Start Devnet with the `--dump-on request` option to enable manual state dumping via JSON-RPC. A dump path can be optionally provided via the CLI. ```bash $ starknet-devnet --dump-on [--dump-path ] ``` -------------------------------- ### Set Devnet Start Time via CLI Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/starknet-time.md Define the genesis block's timestamp using the `--start-time` CLI argument. Provide the time in Unix time seconds. If not specified, the default is the current Unix time. ```bash $ starknet-devnet --start-time ``` -------------------------------- ### starknet_proveTransaction RPC Response Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/proofs.md Example JSON-RPC response for `starknet_proveTransaction`. Includes a base64-encoded proof, proof facts, and L2 to L1 messages if simulation was successful. ```json { "jsonrpc": "2.0", "id": 1, "result": { "proof": "", "proof_facts": [ "0x...", "0x...", "0x...", "0x...", "0x...", "0x...", "0x...", "0x...", "0x..." ], "l2_to_l1_messages": [ { "order": 0, "from_address": "0x...", "to_address": "0x...", "payload": ["0x...", "0x..."] } ] } } ``` -------------------------------- ### Run Docker container on Mac/Windows with specific host IP Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/docker.md On Mac and Windows, publish the container's internal port (default 5050) to a specific host port and IP address. This example binds to localhost. ```bash docker run -p 127.0.0.1:5050:5050 shardlabs/starknet-devnet-rs ``` -------------------------------- ### Display All CLI Options Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/cli.md Use the --help flag to view all available command-line options for Starknet Devnet. ```bash $ starknet-devnet --help ``` ```bash $ docker run --rm shardlabs/starknet-devnet-rs --help ``` -------------------------------- ### Configure Proof Mode via Environment Variable Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/cli.md Alternatively, configure the proof mode for Devnet by setting the PROOF_MODE environment variable. Accepted values are 'full', 'devnet', or 'none'. ```bash PROOF_MODE= ``` -------------------------------- ### Configure Proof Mode via CLI Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/cli.md Set the proof mode for Devnet using the --proof-mode CLI argument. Accepted values are 'full', 'devnet', or 'none'. ```bash starknet-devnet --proof-mode ``` -------------------------------- ### Extract and run pre-compiled Starknet Devnet binary Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/versioned_docs/version-0.8.1/running/install.md Downloads a pre-compiled binary executable for Starknet Devnet from a GitHub release, extracts it, and runs it. Replace and with the appropriate values. ```bash $ curl -sSfL https://github.com/0xSpaceShard/starknet-devnet/releases/download// | tar -xvz -C $ /starknet-devnet ``` -------------------------------- ### Configure Proof Mode Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/versioned_docs/version-0.8.1/running/cli.md Set the proof mode for Devnet using the --proof-mode CLI argument or the PROOF_MODE environment variable. The default mode is 'devnet'. ```bash starknet-devnet --proof-mode ``` ```bash PROOF_MODE= ``` -------------------------------- ### Abort Blocks Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/versioned_docs/version-0.8.1/blocks.md Aborts blocks starting from a specified block ID. This is useful for simulating chain reorganizations or discarding blocks. ```APIDOC ## POST /abortBlocks ### Description Aborts blocks starting from the specified `starting_block_id`. The result contains a list of hashes of the aborted blocks. ### Method POST ### Endpoint /abortBlocks ### Parameters #### Request Body - **starting_block_id** (BLOCK_ID) - Required - The ID of the first block to abort. ### Request Example ```json { "jsonrpc": "2.0", "id": "1", "method": "devnet_abortBlocks", "params": { "starting_block_id": BLOCK_ID } } ``` ### Response #### Success Response (200) - **aborted** (array[BLOCK_HASH]) - A list of hashes of the blocks that were aborted. #### Response Example ```json { "aborted": [BLOCK_HASH_0, BLOCK_HASH_1, ...] } ``` ``` -------------------------------- ### Format Website Code Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/README.md Execute this command to format the website's codebase according to the project's standards. ```bash $ npm run format ``` -------------------------------- ### Load Devnet State on Startup Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/dump-load-restart.md Preserve your Devnet instance for future use by specifying the dump path during startup. This loads the state from the specified file. ```bash $ starknet-devnet --dump-path ``` -------------------------------- ### Get Predeployed Accounts (JSON-RPC) Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/predeployed.md Retrieve information about predeployed accounts. This method can optionally include their ETH and STRK balances. ```APIDOC ## Get Predeployed Accounts ### Description Retrieves details of predeployed accounts. Can optionally include balances. ### Method POST ### Endpoint / ### Parameters #### Query Parameters - **with_balance** (boolean) - Optional - If true, includes ETH and STRK balances for predeployed accounts. ### Request Body ```json { "jsonrpc": "2.0", "id": "1", "method": "devnet_getPredeployedAccounts", "params": { "with_balance": true | false } } ``` ### Response #### Success Response (200) - **result** (object) - Contains details of predeployed accounts. - **cairo_version** (string) - The Cairo version of the account. - **initial_balance** (string) - The initial balance of the account in WEI or FRI. - **address** (string) - The address of the predeployed account. - **public_key** (string) - The public key of the account. - **checksum_address** (string) - The checksummed address of the account. - **private_key** (string) - The private key of the account. #### Response Example ```json { "jsonrpc": "2.0", "id": "1", "result": [ { "cairo_version": "1", "initial_balance": "1000000000000000000000000", "address": "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "public_key": "0x123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "checksum_address": "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "private_key": "0x123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" } ] } ``` ``` -------------------------------- ### Load Configuration from a File Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/versioned_docs/version-0.8.1/running/cli.md To manage numerous configuration parameters, you can load them from a file using environment variables. Source the file before running Devnet. ```bash export SEED=42 export ACCOUNTS=3 ... ``` ```bash $ source .my-env-file && starknet-devnet ``` ```bash $ ( source .my-env-file && starknet-devnet ) ``` -------------------------------- ### Load Devnet Configuration from a File Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/cli.md Source a file containing exported environment variables to configure Devnet. This simplifies managing numerous settings. ```bash export SEED=42 export ACCOUNTS=3 ... ``` ```bash $ source .my-env-file && starknet-devnet ``` -------------------------------- ### Abort Blocks Request Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/blocks.md Send this JSON-RPC request to abort blocks starting from a specified block ID. This is used to simulate chain reorganizations. ```json { "jsonrpc": "2.0", "id": "1", "method": "devnet_abortBlocks", "params": { "starting_block_id": BLOCK_ID } } ``` -------------------------------- ### Configure Devnet Proof Mode via CLI Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/proofs.md Set the transaction proof mode using the `--proof-mode` CLI argument. Use 'devnet' for default behavior, 'none' to disable, or 'full' for unimplemented full proving. ```bash starknet-devnet --proof-mode devnet ``` ```bash starknet-devnet --proof-mode none ``` ```bash starknet-devnet --proof-mode full ``` -------------------------------- ### Build Project with Forge Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/contracts/l1-l2-messaging/solidity/README.md Compiles the smart contracts in the project. Use this before testing or deploying. ```shell forge build ``` -------------------------------- ### Healthcheck Endpoint Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/api.md Check if a Devnet instance is alive by sending an HTTP GET request to the `/is_alive` endpoint. A successful response will return a `200 OK` status. ```APIDOC ## GET /is_alive ### Description Checks if the Devnet instance is running and responsive. ### Method GET ### Endpoint /is_alive ### Response #### Success Response (200 OK) Returns a success message indicating the Devnet instance is alive. ``` -------------------------------- ### Download and extract pre-compiled Starknet Devnet binary Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Fetches a pre-compiled binary executable for Starknet Devnet from a GitHub release. Replace and with the appropriate values. The archive is extracted to . ```bash $ curl -sSfL https://github.com/0xSpaceShard/starknet-devnet/releases/download// | tar -xvz -C ``` -------------------------------- ### Enable Restrictive Mode with Custom Methods Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/restrictive.md Enables restrictive mode and specifies a custom list of forbidden methods. Devnet will fail to start if any methods or routes are misspelled. ```bash $ starknet-devnet --restrictive-mode devnet_dump devnet_config ``` -------------------------------- ### Configure Devnet Proof Mode via Environment Variable Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/proofs.md Alternatively, set the transaction proof mode using the `PROOF_MODE` environment variable. This is useful for containerized deployments. ```bash PROOF_MODE=devnet starknet-devnet ``` -------------------------------- ### starknet_proveTransaction RPC Request Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/proofs.md Example JSON-RPC request for `starknet_proveTransaction`. This method accepts a block ID and an INVOKE v3 transaction payload to generate a proof and associated facts. ```json { "jsonrpc": "2.0", "id": 1, "method": "starknet_proveTransaction", "params": { "block_id": "latest", "transaction": { "type": "INVOKE", "version": "0x3", "sender_address": "0x1234", "calldata": ["0x1", "0x2"], "signature": [], "nonce": "0x0", "resource_bounds": { "l1_gas": { "max_amount": "0x0", "max_price_per_unit": "0x0" }, "l1_data_gas": { "max_amount": "0x0", "max_price_per_unit": "0x0" }, "l2_gas": { "max_amount": "0x0", "max_price_per_unit": "0x0" } }, "tip": "0x0", "paymaster_data": [], "account_deployment_data": [], "nonce_data_availability_mode": "L1", "fee_data_availability_mode": "L1" } } } ``` -------------------------------- ### Run Starknet Devnet from source with arguments Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Runs the Starknet Devnet from source, allowing for the specification of optional command-line arguments. ```bash $ cargo run -- [ARGS] ``` -------------------------------- ### CLI Argument Precedence Over Environment Variables Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/cli.md When both a CLI argument and an environment variable are provided for the same parameter, the CLI argument takes precedence. This example shows the seed value 42 being used. ```bash $ SEED=10 starknet-devnet --seed 42 ``` -------------------------------- ### Run Starknet Devnet from source with release optimization Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Builds and runs the Starknet Devnet from source in release mode for optimized performance. This may result in a longer compilation time. ```bash $ cargo run --release ``` -------------------------------- ### Get Predeployed Accounts Info (JSON-RPC) Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/predeployed.md Retrieve information about predeployed accounts using a JSON-RPC request to the Devnet API. The `with_balance` parameter can be optionally set to true to include ETH and STRK balances. ```json { "jsonrpc": "2.0", "id": "1", "method": "devnet_getPredeployedAccounts" } ``` ```json { "jsonrpc": "2.0", "id": "1", "method": "devnet_getPredeployedAccounts", "params": { // optional; defaults to false "with_balance": true | false } } ``` -------------------------------- ### Configure Devnet Proof Mode via Docker Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/proofs.md Configure the transaction proof mode when running Starknet Devnet using Docker by setting the `PROOF_MODE` environment variable. ```bash docker run --rm -p 5050:5050 \ -e PROOF_MODE=devnet \ shardlabs/starknet-devnet-rs ``` -------------------------------- ### Run pre-compiled Starknet Devnet binary Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/running/install.md Executes the Starknet Devnet from a pre-compiled binary that has been downloaded and extracted. ```bash $ /starknet-devnet ``` -------------------------------- ### Enable Metrics with Environment Variables Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/metrics.md Alternatively, metrics can be enabled using environment variables `METRICS_HOST` and `METRICS_PORT`. ```bash $ METRICS_HOST=127.0.0.1 METRICS_PORT=8080 starknet-devnet ``` -------------------------------- ### Retrieve Devnet Configuration Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/api.md Send a JSON-RPC request to the 'devnet_getConfig' method to get the current configuration of the Devnet instance. The response details parameters like seed, account settings, gas prices, and server configuration. ```json { "seed": 4063802897, "total_accounts": 10, "account_contract_class_hash": "0x61dac032f228abef9c6626f995015233097ae253a7f72d68552db02f2971b8f", "predeployed_accounts_initial_balance": "1000000000000000000000", "start_time": null, "gas_price_wei": 100000000000, "gas_price_fri": 100000000000, "data_gas_price_wei": 100000000000, "data_gas_price_fri": 100000000000, "l2_gas_price_wei": 100000000000, "l2_gas_price_fri": 100000000000, "chain_id": "SN_SEPOLIA", "dump_on": "exit", "dump_path": "dump_path.json", "state_archive": "none", "fork_config": { "url": "http://rpc.pathfinder.equilibrium.co/integration-sepolia/rpc/v0_7", "block_number": 26429 }, "server_config": { "host": "127.0.0.1", "port": 5050, "timeout": 120, "restricted_methods": null }, "block_generation": null, "lite_mode": false, "eth_erc20_class_hash": "0x046ded64ae2dead6448e247234bab192a9c483644395b66f2155f2614e5804b0", "strk_erc20_class_hash": "0x046ded64ae2dead6448e247234bab192a9c483644395b66f2155f2614e5804b0" } ``` -------------------------------- ### Select Account Class with CLI Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/predeployed.md Choose between Cairo 0 or Cairo 1 account classes using the `--account-class` CLI option. Alternatively, specify a custom Sierra artifact path for your account contract. ```bash --account-class [cairo0 | cairo1] ``` ```bash --account-class-custom ``` -------------------------------- ### Compile Cairo Artifacts and Run Starknet Devnet Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/contracts/l1-l2-messaging/README.md Compiles Cairo artifacts for abigen and then runs the Starknet Devnet with a specified seed. Ensure you are in the contracts directory. ```bash cd contracts && bash generate_artifacts.sh cargo run -- --seed 42 ``` -------------------------------- ### Build Static Website Content Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/README.md Generates the static files for the website, typically placed in the 'build' directory, ready for hosting. ```bash $ npm run build ``` -------------------------------- ### Deploy Script with Forge Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/contracts/l1-l2-messaging/solidity/README.md Deploys smart contracts using a Forge script. Requires RPC URL and private key for the target network. ```shell forge script script/Counter.s.sol:CounterScript --rpc-url --private-key ``` -------------------------------- ### Format Project with Forge Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/contracts/l1-l2-messaging/solidity/README.md Formats the Solidity code in the project according to standard conventions. ```shell forge fmt ``` -------------------------------- ### Deploy Website (using SSH) Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/README.md Deploys the website using SSH, suitable for pushing to a 'gh-pages' branch on GitHub. ```bash $ USE_SSH=true npm run deploy ``` -------------------------------- ### Customize Contract Size Limits Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/server-config.md Customize contract size limits using CLI parameters during Devnet startup. These include maximum contract class size, bytecode size, and Sierra length. ```bash $ starknet-devnet --maximum-contract-class-size ``` ```bash $ starknet-devnet --maximum-contract-bytecode-size ``` ```bash $ starknet-devnet --maximum-sierra-length ``` -------------------------------- ### Load Devnet State with Docker Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/dump-load-restart.md Use this command to load a previously dumped state into a Dockerized Devnet. Ensure the dump directory exists and is bind-mounted correctly. ```bash docker run \ -p 127.0.0.1:5050:5050 \ --mount type=bind,source=/path/to/dumpdir,target=/path/to/dumpdir \ shardlabs/starknet-devnet-rs \ --dump-path /path/to/dumpdir/mydump ``` -------------------------------- ### Test Project with Forge Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/contracts/l1-l2-messaging/solidity/README.md Runs the tests defined in the project's test files. Ensure contracts are built first. ```shell forge test ``` -------------------------------- ### Run Starknet Devnet in Lite Mode Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/website/docs/lite.md Provide the --lite-mode flag to run Devnet in a minimal configuration. This mode skips block hash and commitment calculations. ```bash $ starknet-devnet --lite-mode ``` -------------------------------- ### Declare and Deploy Starknet L1-L2 Contract Source: https://github.com/0xspaceshard/starknet-devnet/blob/main/contracts/l1-l2-messaging/README.md Declares and deploys the cairo_l1_l2 contract on Starknet Devnet. Replace placeholders with actual values returned by the commands. ```bash # Declare. starkli declare ./cairo/target/dev/cairo_l1_l2.contract_class.json CLASS_HASH= # displayed after previous command # Deploy (adjust the class hash if needed). starkli deploy "$CLASS_HASH" --salt 123 CONTRACT_L2= # displayed after previous command ```