Skip to main content
Use the bootstrapped localnet in inj-examples to deploy Solidity contracts and test Injective’s native precompiles through Ethereum JSON-RPC. The example starts a real Injective node with pre-funded development accounts and a local Blockscout explorer. Use Anvil or Hardhat’s in-memory chain for standard EVM unit tests. Use the Injective localnet when your contract calls native precompiles. For custom genesis, Cosmos SDK modules, or native protocol changes, see Run a Local Native Node.

Start the Localnet

Install Docker with Docker Compose, jq, and Foundry. Clone the example and initialize the chain once.
Check that your client is connected:
The setup prints instructions for accessing the funded accounts. Use those accounts only on the local chain. Import a funded account into your wallet or configure it in Foundry or Hardhat against the local RPC.

Deploy and Test

Use the precompiles example to deploy a standard contract or a Bank-backed ERC20. If you want to start a new project, the Foundry template includes the same local environment. The local chain starts with an empty swap allowlist. For a complete test that creates and allowlists a market, seeds its order book, and executes swaps, use the swap localnet demo. Run make local-stop to stop the services. Run make local-start to resume with the same state.
Last modified on November 19, 2026