CLI Reference
Here you can find a complete reference of the core commands Nile provides by default.
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.
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.
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
. -
--debug
and--track
Watch the status of the account deployment transaction. See the status command for a complete description.
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
.Default to localhost.
-
--max_fee
Specify the max fee you are willing to pay for the transaction.
-
--overriding_path
Override the directory path for artifacts discovery.
-
--token
Used for declaring contracts to Alpha Mainnet.
-
--debug
and--track
Watch the status of the account deployment transaction. See the status command for a complete description.
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
.Default to localhost.
-
--max_fee
Specify the max fee you are willing to pay for the transaction.
-
--salt
Set the base salt for address generation.
-
--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.
-
--ignore_account
Deploy without using an account (DEPRECATED).
-
--token
Used for deploying contracts to Alpha Mainnet.
-
--debug
and--track
Watch the status of the account deployment transaction. See the status command for a complete description.
nile call <CONTRACT_ID> <METHOD> [arg1, arg2...]
Perform reading operations against a network.
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
.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.
nile counterfactual-address <PRIVATE_KEY_ALIAS>
Precompute the deployment address of an Account contract.
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
.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
.
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 |