CLI Reference
Here you can find a complete reference of the core commands Nile provides by default.
Transaction execution
Commands for executing or querying the status of a transaction.
setup
nile setup <PRIVATE_KEY_ALIAS>
Deploy an Account associated with a given private key.
This command takes an alias instead of the actual private key to avoid accidentally leaking private keys. This alias is associated with an environmental variable of the same name, whose value is the private key. |
|
Arguments
-
PRIVATE_KEY_ALIAS
Specify the private key that will own the account to be deployed. Looks for an environment variable with the name of the private key alias.
Options
-
--network
Select network: one of (
localhost
,integration
,goerli
,goerli2
,mainnet
).Default to
localhost
. -
--salt
Specify the salt for the address generation.
-
--max_fee
Specify the max fee you are willing to pay for the transaction.
-
--simulate
and--estimate_fee
Flags for querying the network without executing the transaction.
-
--debug
and--track
Watch the status of the account deployment transaction. See the status command for a complete description.
declare
nile declare <PRIVATE_KEY_ALIAS> <CONTRACT_NAME>
Declare a contract through an Account.
Arguments
-
PRIVATE_KEY_ALIAS
Specify the alias representing the account to be used.
-
CONTRACT_NAME
Specify the name of the contract artifact to be declared.
Options
-
--network
Select network: one of (
localhost
,integration
,goerli
,goerli2
,mainnet
).Default to
localhost
. -
--max_fee
Specify the max fee you are willing to pay for the transaction.
-
--alias
The alias for registering the declared class_hash (DEPRECATED).
-
--overriding_path
Override the directory path for artifacts discovery.
-
--simulate
and--estimate_fee
Flags for querying the network without executing the transaction.
-
--debug
and--track
Watch the status of the account deployment transaction. See the status command for a complete description.
deploy
nile deploy <PRIVATE_KEY_ALIAS> <CONTRACT> [arg1, arg2...]
Deploy a contract through an Account.
|
Arguments
-
PRIVATE_KEY_ALIAS
Specify the alias representing the account to be used.
-
CONTRACT
Specify the name of the contract artifact to be deployed.
-
ARGS
Optional calldata arguments for the constructor.
Options
-
--network
Select network: one of (
localhost
,integration
,goerli
,goerli2
,mainnet
).Default to
localhost
. -
--salt
Specify the salt for the address generation.
-
--max_fee
Specify the max fee you are willing to pay for the transaction.
-
--alias
Specify the alias for Nile local registration purposes. This allows you to interact with the contract later without using the address directly.
-
--unique
Specify that the account address should be taken into account for target address generation.
-
--abi
Override artifact abi to be registered. Useful for proxies.
-
--deployer_address
Specify the deployer contract if needed.
-
--simulate
and--estimate_fee
Flags for querying the network without executing the transaction.
-
--debug
and--track
Watch the status of the account deployment transaction. See the status command for a complete description.
send
nile send <PRIVATE_KEY_ALIAS> <CONTRACT_ID> <METHOD> [arg1, arg2...]
Execute a transaction through an Account.
Arguments
-
PRIVATE_KEY_ALIAS
Specify the alias representing the account to be used.
-
CONTRACT_ID
Specify the contract to call (either alias or address).
-
METHOD
Specify the method to execute.
-
ARGS
Optional calldata arguments for the method to execute.
Options
-
--network
Select network: one of (
localhost
,integration
,goerli
,goerli2
,mainnet
).Default to
localhost
. -
--max_fee
Specify the max fee you are willing to pay for the transaction.
-
--simulate
and--estimate_fee
Flags for querying the network without executing the transaction.
-
--debug
and--track
Watch the status of the account deployment transaction. See the status command for a complete description.
status
nile status <TX_HASH>
Query the current status of a transaction.
Options
-
--network
Select network: one of (
localhost
,integration
,goerli
,goerli2
,mainnet
).Default to
localhost
. -
--track
Continue probing the network in case of pending transaction states.
-
--debug
Use locally available contracts to make error messages from rejected transactions more explicit.
Implies
--track
. -
--contracts_file
Override the deployments file to query the contract artifacts from.
Default to
<NETWORK>.deployments.txt
.
Queries
Utilities for querying the blockchain.
call
Project management
Utilities for managing the project.
node
nile node
Run a local starknet-devnet node.
Options
-
--host
Specify the address to listen at.
Defaults to 127.0.0.1 (use the address the program outputs on start).
-
--port
Specify the port to listen at. Defaults to 5050.
-
--seed
Specify the seed for randomness of accounts to be deployed.
-
--lite-mode
Applies all lite-mode optimizations by disabling features such as block hash and deploy hash calculation.
compile
nile compile [PATH_TO_CONTRACT]
Compile Cairo contracts.
Compilation artifacts are written into the artifacts/
directory.
Options
-
--directory
Specify a directory to compile contracts from.
-
--account_contract
As of cairo-lang v0.8.0, users must compile account contracts with the
--account_contract
flag. Nile automatically inserts the flag if the contract’s name ends with Account. i.e.Account.cairo
,EthAccount.cairo
. Otherwise, the flag must be included by the user.nile compile contracts/NewAccountType.cairo --account_contract # compiles account contract
-
--cairo_path
Specify which directories the compiler must use to resolve imports from Cairo.
Check Import search paths from StarkNet documentation. -
--disable-hint-validation
Compile allowing unwhitelisted hints.
Utils
Other utilities.
get-accounts
nile get-accounts
Retrieve a list of ready-to-use accounts which allows for easy scripting integration.
The list of accounts includes only those that exist in the local Sending transactions through predeployed accounts can be done through scripting, but the current CLI version doesn’t allow using these accounts for |