[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10545":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":18,"lastSyncTime":30,"discoverSource":31},10545,"ganache","ConsenSys-archive\u002Fganache","ConsenSys-archive",":warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.","https:\u002F\u002Fconsensys.io\u002Fblog\u002Fconsensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_",null,"TypeScript",2629,670,2633,372,0,1,2,30.48,"MIT License",true,false,"develop",[25,26,5],"blockchain","ethereum","2026-06-12 02:02:23","\u003C!-- Using h2 instead of h1 because npm doesn't support align=center on h1 tags -->\n\u003Ch2 align=\"center\">\n  \u003Ca href=\"#readme\" title=\"Ganache README.md\">\u003Cimg alt=\"Ganache\" src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Ftrufflesuite\u002Fganache\u002Fdevelop\u002Fdocs\u002Fassets\u002Fimg\u002Fganache-logo-dark.svg\" alt=\"Ganache\" width=\"160\"\u002F>\u003C\u002Fa>\n\u003C\u002Fh2>\n\n\u003Ch3 align=\"center\">\n  A tool for creating a local blockchain for fast Ethereum development.\n\u003C\u002Fh3>\n\n\u003Cp align=\"center\">\n  \u003Ca title=\"ganache on npm\" href=\"https:\u002F\u002Fwww.npmjs.com\u002Fganache\">\u003Cimg alt=\"\" src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002Fganache\u002Flatest?label=npm&amp;color=b98b5b&amp;style=for-the-badge&amp;labelColor=3c2c30&amp;logo=data:image\u002Fsvg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZD0iTTAgMGg0MHY0MEgwVjB6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbD0iIzMzMjUyYSIgZD0iTTcgN2gyNnYyNmgtN1YxNGgtNnYxOUg3eiIvPjwvc3ZnPgo=\" \u002F>\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fnpmtrends.com\u002Fganache\" title=\"Historic Ganache download graphs on npmtrends.com\">\u003Cimg alt=\"\" src=\"https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fdm\u002Fganache?color=b98b5b&amp;style=for-the-badge&amp;labelColor=3c2c30&amp;logo=data:image\u002Fsvg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOTAuMzEgMjE0Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2U0YTY2Mzt9LmNscy0ye2ZpbGw6IzVlNDY0ZDt9LmNscy0ze2ZpbGw6I2ZmZjt9PC9zdHlsZT48L2RlZnM+PHRpdGxlPmdhbmFjaGUtbG9nb21hcms8L3RpdGxlPjxnIGlkPSJMYXllcl8yIiBkYXRhLW5hbWU9IkxheWVyIDIiPjxnIGlkPSJMYXllcl84IiBkYXRhLW5hbWU9IkxheWVyIDgiPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0iTTE2NS4zOCwxNjAuMzFjMi4yNCwwLDMtLjUyLDQuMDYtMi4zM3MuNTUtNC43NS41MS01LjU1Yy0uMS0xLjc2LS42OS0zLjcyLS43Ni00Ljct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2M0Ljc2LTIuNzUsOC42NS05LjUsOC42NS0xNVoiLz48cGF0aCBjbGFzcz0iY2xzLTMiIGQ9Ik0xMDUsOTkuNzNjLTUuMzksMy4xMS0xNC4yLDMuMTEtMTkuNTgsMGwtNzkuNjEtNDJjLjkuODksODAuNzMsNDcuMjcsODAuNzMsNDcuMjcsNC43NiwyLjc2LDEyLjU1LDIuNzYsMTcuMzEsMCwwLDAsNzkuNzQtNDYuMjQsODAuNjMtNDcuMTNaIi8+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNODUuMzIsOC4wOEM5MC43MSw1LDk5LjUyLDUsMTA0LjksOC4wOWw5LjY1LDRjLS45LS44OS0xMC43OC03LjI5LTEwLjc4LTcuMjktNC43NS0yLjc1LTEyLjU0LTIuNzYtMTcuMywwLDAsMC0xNS43Nyw5LjI3LTE2LjY3LDEwLjE1WiIvPjwvZz48L2c+PC9zdmc+\" \u002F>\u003C\u002Fa>\n  \u003Ca title=\"Build status\" href=\"https:\u002F\u002Fgithub.com\u002Ftrufflesuite\u002Fganache\u002Factions?query=workflow%3ACommits+branch%3Adevelop+event%3Apush\">\u003Cimg alt=\"\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Ftrufflesuite\u002Fganache\u002Fpush.yml?style=for-the-badge&amp;labelColor=3c2c30&amp;logo=github&amp;color=b98b5b&amp;branch=develop\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#features\">Features\u003C\u002Fa> •\n  \u003Ca href=\"#getting-started\">Getting Started\u003C\u002Fa> •\n  \u003Ca href=\"#documentation\">Documentation\u003C\u002Fa> •\n  \u003Ca href=\"#community\">Community\u003C\u002Fa> •\n  \u003Ca href=\"#docker\">Docker\u003C\u002Fa> •\n  \u003Ca href=\"#contributing\">Contributing\u003C\u002Fa> •\n  \u003Ca href=\"#related\">Related\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n## Features\n\nGanache is an Ethereum simulator that makes developing Ethereum applications faster, easier, and safer. It includes all popular RPC functions and features (like events) and can be run deterministically to make development a breeze.\n\n- `console.log` in Solidity\n- Zero-config Mainnet Forking\n- Fork any Ethereum network without waiting to sync\n- Ethereum JSON-RPC support\n- Snapshot\u002Frevert state\n- Mine blocks instantly, on demand, or at an interval\n- Fast-forward time\n- Impersonate any account (no private keys required!)\n- Listens for JSON-RPC 2.0 requests over HTTP\u002FWebSockets\n- Programmatic use in Node.js\n- Pending Transactions\n- \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ftrufflesuite\u002Fganache\u002Ftree\u002Fdevelop\u002Fpackages\u002Fflavor#readme\">Flavors\u003C\u002Fa> (aka Plugins), like \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ftrufflesuite\u002Fganache-plugin-filecoin\u002Ftree\u002Fmain\u002Fpackages\u002Ffilecoin#readme\">Filecoin\u003C\u002Fa>\n\n## Getting Started\n\nGanache can be used from the [command line](#command-line-use), [programmatically](#programmatic-use) via Node.js, or [in the browser](#browser-use).\n\n### Command line use\n\nYou must first install [Node.js](https:\u002F\u002Fnodejs.org\u002F) >= v16.0.0 and npm >= 7.10.0.\n\nTo install Ganache globally, run:\n\n```console\n$ npm install ganache --global\n```\n\nIn case you're upgrading from a previous version of Ganache, we've also written up [this handy guide](https:\u002F\u002Fgithub.com\u002Ftrufflesuite\u002Fganache\u002Fblob\u002Fdevelop\u002FUPGRADE-GUIDE.md) on how to upgrade\u002Finstall Ganache and to document all breaking changes to look out for.\n\nOnce installed globally, you can start ganache right from your command line:\n\n```console\nganache\n```\n\nYour output should look something like this:\n\n```\nGanache CLI v6.12.1 (ganache-core: 2.13.1)\n\nAvailable Accounts\n==================\n(0) 0xe261e26aECcE52b3788Fac9625896FFbc6bb4424 (100 ETH)\n(1) 0xcE16e8eb8F4BF2E65BA9536C07E305b912BAFaCF (100 ETH)\n(2) 0x02f1c4C93AFEd946Cce5Ad7D34354A150bEfCFcF (100 ETH)\n(3) 0x0B75F0b70076Fab3F18F94700Ecaf3B00fE528E7 (100 ETH)\n(4) 0x7194d1F1d43c2c58302BB61a224D41B649e65C93 (100 ETH)\n(5) 0xC9A2d92c5913eDEAd9a7C936C96631F0F2241063 (100 ETH)\n(6) 0xD79BcDE5Cb11cECD1dfC6685B65690bE5b6a611e (100 ETH)\n(7) 0xb6D080353f40dEcA2E67108087c356d3A1AfcD64 (100 ETH)\n(8) 0x31A064DeeaD74DE7B9453beB4F780416D8859d3b (100 ETH)\n(9) 0x37524a360a40C682F201Fb011DB7bbC8c8A247c6 (100 ETH)\n\nPrivate Keys\n==================\n(0) 0x7f109a9e3b0d8ecfba9cc23a3614433ce0fa7ddcc80f2a8f10b222179a5a80d6\n(1) 0x6ec1f2e7d126a74a1d2ff9e1c5d90b92378c725e506651ff8bb8616a5c724628\n(2) 0xb4d7f7e82f61d81c95985771b8abf518f9328d019c36849d4214b5f995d13814\n(3) 0x941536648ac10d5734973e94df413c17809d6cc5e24cd11e947e685acfbd12ae\n(4) 0x5829cf333ef66b6bdd34950f096cb24e06ef041c5f63e577b4f3362309125863\n(5) 0x8fc4bffe2b40b2b7db7fd937736c4575a0925511d7a0a2dfc3274e8c17b41d20\n(6) 0xb6c10e2baaeba1fa4a8b73644db4f28f4bf0912cceb6e8959f73bb423c33bd84\n(7) 0xfe8875acb38f684b2025d5472445b8e4745705a9e7adc9b0485a05df790df700\n(8) 0xbdc6e0a69f2921a78e9af930111334a41d3fab44653c8de0775572c526feea2d\n(9) 0x3e215c3d2a59626a669ed04ec1700f36c05c9b216e592f58bbfd3d8aa6ea25f9\n\nHD Wallet\n==================\nMnemonic:      candy maple velvet cake sugar cream honey rich smooth crumble sweet treat\nBase HD Path:  m\u002F44'\u002F60'\u002F0'\u002F0\u002F{account_index}\n\nDefault Gas Price\n==================\n20000000000\n\nGas Limit\n==================\n6721975\n\nCall Gas Limit\n==================\n9007199254740991\n\nListening on 127.0.0.1:8545\n```\n\n### NPM project use\n\nIf you want to install Ganache into an npm project, run:\n\n```console\n$ npm install ganache\n```\n\nYou can then add Ganache to your package.json scripts:\n\n```json\n\"scripts\": {\n  \"ganache\": \"ganache --wallet.seed myCustomSeed\"\n}\n```\n\n_See [Documentation](#documentation) for additional command line options._\n\nThen start it:\n\n```console\n$ npm run ganache\n```\n\n### Programmatic use\n\nYou can use Ganache programmatically from Node.js. Install Ganache into your npm package:\n\n```console\n$ npm install ganache\n```\n\nThen you can use ganache as an [EIP-1193 provider only](#as-an-eip-1193-provider-only), an [EIP-1193 provider and JSON-RPC web server](#as-an-eip-1193-provider-and-json-rpc-web-server), as a [Web3 provider](#as-a-web3js-provider), an [ethers provider](#as-an-ethersjs-provider), or a [viem transport](#as-a-viem-transport).\n\n#### As an EIP-1193 provider only:\n\n```javascript\nconst ganache = require(\"ganache\");\n\nconst options = {};\nconst provider = ganache.provider(options);\nconst accounts = await provider.request({ method: \"eth_accounts\", params: [] });\n```\n\n#### As an EIP-1193 provider and JSON-RPC web server:\n\n```javascript\nconst ganache = require(\"ganache\");\n\nconst options = {};\nconst server = ganache.server(options);\nconst PORT = 0; \u002F\u002F 0 means any available port\nserver.listen(PORT, async err => {\n  if (err) throw err;\n\n  console.log(`ganache listening on port ${server.address().port}...`);\n  const provider = server.provider;\n  const accounts = await provider.request({\n    method: \"eth_accounts\",\n    params: []\n  });\n});\n```\n\n#### As a [web3.js](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fweb3) provider:\n\nTo use ganache as a Web3 provider:\n\n```javascript\nconst Web3 = require(\"web3\");\nconst ganache = require(\"ganache\");\n\nconst web3 = new Web3(ganache.provider());\n```\n\nNOTE: depending on your web3 version, you may need to set a number of confirmation blocks\n\n```\nconst web3 = new Web3(ganache.provider(), null, { transactionConfirmationBlocks: 1 });\n```\n\n#### As an [ethers.js](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fethers) provider:\n\n```javascript\nconst ganache = require(\"ganache\");\n\nconst provider = new ethers.providers.Web3Provider(ganache.provider());\n```\n\n#### As a [viem](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fviem) transport:\n\nTo use a ganache provider as a viem transport:\n\n```javascript\nimport { createWalletClient, custom } from \"viem\";\nimport { localhost } from \"viem\u002Fchains\";\nimport ganache from \"ganache\";\nconst client = createWalletClient({\n  chain: localhost,\n  transport: custom(ganache.provider())\n});\n```\n\n### Browser Use\n\nYou can also use Ganache in the browser by adding the following script to your HTML:\n\n```html\n\u003Cscript src=\"https:\u002F\u002Fcdn.jsdelivr.net\u002Fnpm\u002Fganache@{VERSION}\u002Fdist\u002Fweb\u002Fganache.min.js\">\u003C\u002Fscript>\n```\n\nNOTE: the `{VERSION}` in the above path needs to be replaced with a version number or tag that is listed in [npm](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fganache?activeTab=versions).\n\nFrom there, Ganache is available in your browser for use:\n\n```javascript\nconst options = {};\nconst provider = Ganache.provider(options);\n```\n\n## Documentation\n\nSee our [Interactive Docs](https:\u002F\u002F\u002Fganache.dev\u002F) for a full list of Ganache's RPC methods.\n\n### Startup Options\n\nThe startup options are grouped in the `chain`, `database`, `fork`, `logging`, `miner`, `wallet`, and `server` namespaces, and should be used as such on startup, i.e.\n\n```console\nganache --namespace.option=\"value\"\n```\n\nfor CLI use, and\n\n```TypeScript\nconst options = { namespace: { option: \"value\"}};\nconst provider = ganache.provider(options);\n```\n\nfor programmatic use.\n\nThe following options are listed for command line use, but can also be used when running Ganache programmatically in your project.\n\n```console\nChain:\n  --chain.allowUnlimitedContractSize    Allows unlimited contract sizes while debugging. Setting this to true\n                                        will cause ganache to behave differently than production environments.\n                                                                                    [boolean] [default: false]\n\n  --chain.allowUnlimitedInitCodeSize    Allows unlimited initcode sizes while debugging. Setting this to true\n                                        will cause ganache to behave differently than production environments.\n                                                                                    [boolean] [default: false]\n\n  --chain.asyncRequestProcessing        When set to false only one request will be processed at a time.\n                                                                                     [boolean] [default: true]\n\n  --chain.chainId                       The currently configured chain id.            [number] [default: 1337]\n\n  -i, --chain.networkId                 The id of the network returned by the RPC method net_version.\n                                        deprecated aliases: --networkId\n                                                            [number] [default: System time at process start or\n                                                               Network ID of forked blockchain if configured.]\n\n  -t, --chain.time                      Date that the first block should start.\n                                        deprecated aliases: --time                                    [number]\n\n  -k, --chain.hardfork                  Set the hardfork rules for the EVM.\n                                        deprecated aliases: --hardfork\n          [string] [choices: \"constantinople\", \"byzantium\", \"petersburg\", \"istanbul\", \"muirGlacier\", \"berlin\",\n                           \"london\", \"arrowGlacier\", \"grayGlacier\", \"merge\", \"shanghai\"] [default: \"shanghai\"]\n\n  --chain.vmErrorsOnRPCResponse         Whether to report runtime errors from EVM code as RPC errors.\n                                                                                    [boolean] [default: false]\n\n\nDatabase:\n  --database.dbPath                     Specify a path to a directory to save the chain database.\n                                        deprecated aliases: --db, --db_path                           [string]\n\nLogging:\n  --logging.debug                       Set to true to log EVM opcodes.             [boolean] [default: false]\n\n  -q, --logging.quiet                   Set to true to disable logging.\n                                        deprecated aliases: --quiet                 [boolean] [default: false]\n\n  -v, --logging.verbose                 Set to true to log detailed RPC requests.\n                                        deprecated aliases: --verbose               [boolean] [default: false]\n\n\nMiner:\n  -b, --miner.blockTime                 Sets the blockTime in seconds for automatic mining. A blockTime of 0\n                                        enables \"instamine mode\", where new executable transactions will be\n                                        mined instantly.\n                                        deprecated aliases: --blockTime                  [number] [default: 0]\n\n  -g, --miner.defaultGasPrice           Sets the default gas price in WEI for transactions if not otherwise\n                                        specified.\n                                        deprecated aliases: --gasPrice          [string] [default: 0x77359400]\n\n  -l, --miner.blockGasLimit             Sets the block gas limit in WEI.\n                                        deprecated aliases: --gasLimit            [string] [default: 0xb71b00]\n\n  --miner.defaultTransactionGasLimit    Sets the default transaction gas limit in WEI. Set to \"estimate\" to\n                                        use an estimate (slows down transaction execution by 40%+).\n                                                                                   [string] [default: 0x15f90]\n\n  --miner.difficulty                    Sets the block difficulty.                     [string] [default: 0x1]\n\n  --miner.callGasLimit                  Sets the transaction gas limit in WEI for eth_call and eth_estimateGas\n                                        calls.\n                                                                                 [string] [default: 0x2faf080]\n  --miner.instamine                     Set the instamine mode to either \"eager\" (default) or \"strict\". In\n                                        \"eager\" mode a transaction will be included in a block before its hash\n                                        is returned to the caller. In \"strict\" mode a transaction's hash is\n                                        returned to the caller before the transaction is included in a block.\n                                        This value has no effect if `blockTime` is *not* `0` (the default).`\n                                                      [string] [choices: \"eager\", \"strict\"] [default: \"eager\"]\n\n  --miner.coinbase                      Sets the address where mining rewards will go.\n                                                         [default: 0x0000000000000000000000000000000000000000]\n\n  --miner.extraData                     Set the extraData block header field a miner can include.\n                                                                                        [string] [default: 0x]\n\n  --miner.priceBump                     Minimum price bump percentage needed to replace a transaction that\n                                        already exists in the transaction pool.         [string] [default: 10]\n\n\nWallet:\n  --wallet.accounts                     Account data in the form \u003Cprivate_key>,\u003Cinitial_balance>, can be\n                                        specified multiple times. Note that private keys are 64 characters\n                                        long and must be entered as an 0x-prefixed hex string. Balance can\n                                        either be input as an integer, or as a 0x-prefixed hex string with\n                                        either form specifying the initial balance in wei.\n                                        deprecated aliases: --account                                  [array]\n\n  -a, --wallet.totalAccounts            Number of accounts to generate at startup.\n                                        deprecated aliases: --accounts                  [number] [default: 10]\n\n  -d, --wallet.deterministic            Use pre-defined, deterministic seed.\n                                        deprecated aliases: --deterministic         [boolean] [default: false]\n\n  -s, --wallet.seed                     Seed to use to generate a mnemonic.\n                                        deprecated aliases: --seed\n                                                                                                      [string]\n                                             [default: Random value, unless wallet.deterministic is specified]\n\n  -m, --wallet.mnemonic                 Use a specific HD wallet mnemonic to generate initial addresses.\n                                        deprecated aliases: --mnemonic                                [string]\n                                                                         [default: Generated from wallet.seed]\n\n  -u, --wallet.unlockedAccounts         Array of addresses or address indexes specifying which accounts should\n                                        be unlocked.\n                                        deprecated aliases: --unlock                                   [array]\n\n  -n, --wallet.lock                     Lock available accounts by default (good for third party transaction\n                                        signing).\n                                        deprecated aliases: --secure, --lock        [boolean] [default: false]\n\n  --wallet.passphrase                   Passphrase to use when locking accounts.\n                                        deprecated aliases: --passphrase                              [string]\n\n  --wallet.accountKeysPath              Specifies a file to save accounts and private keys to, for testing.\n                                        deprecated aliases: --account_keys_path, --acctKeys           [string]\n\n  -e, --wallet.defaultBalance           The default account balance, specified in ether.\n                                        deprecated aliases: --defaultBalanceEther     [number] [default: 1000]\n\n  --wallet.hdPath                       The hierarchical deterministic path to use when generating accounts.\n                                                                            [string] [default: m,44',60',0',0]\n\n\nFork:\n  -f, --fork.url                        Fork from another currently running Ethereum client at a given block.\n                                        Input should be the URL of the node, e.g. \"http:\u002F\u002Flocalhost:1337\". You\n                                        can optionally specify the block to fork from using an @ sign:\n                                        \"http:\u002F\u002Flocalhost:1337@8675309\".\n\n                                        You can specify Basic Authentication credentials in the URL as well.\n                                        e.g., \"wss:\u002F\u002Fuser:password@example.com\u002F\". If you need to use an Infura\n                                        Project Secret, you would use it like this:\n                                        \"wss:\u002F\u002F:{YOUR-PROJECT-SECRET}@mainnet.infura.com\u002F...\"\n\n                                        Alternatively, you can use the fork.username and fork.password\n                                        options.\n                                        deprecated aliases: --fork\n\n  --fork.network                        A network name to fork from; uses Infura's archive nodes.\n\n                                        Use the shorthand command ganache --fork to automatically fork from\n                                        Mainnet at the latest block.\n                                                            [choices: \"mainnet\", \"goerli\", \"görli\", \"sepolia\"]\n  --fork.blockNumber                    Block number the provider should fork from.\n                                                                                [default: Latest block number]\n\n  --fork.preLatestConfirmations         When the fork.blockNumber is set to \"latest\" (default), the number of\n                                        blocks before the remote node's \"latest\" block to fork from.\n                                                                                         [number] [default: 5]\n\n  --fork.username                       Username to use for Basic Authentication. Does not require setting\n                                        fork.password.\n\n                                        When combined with fork.password, is shorthand for fork: { headers: {\n                                        \"Authorization\": \"Basic {ENCODED-BASIC-HEADER}\" } }\n\n                                        If the fork.headers option specifies an \"Authorization\" header, it\n                                        will be be inserted after this Basic token.\n\n  --fork.password                       Password to use for Basic Authentication. Does not require setting\n                                        fork.username.\n\n                                        When combined with fork.username, is shorthand for fork: { headers: {\n                                        \"Authorization\": \"Basic {ENCODED-BASIC-HEADER}\" } }\n\n                                        If the fork.headers option specifies an \"Authorization\" header, it\n                                        will be be inserted after this Basic token.\n\n  --fork.jwt                            Encoded JSON Web Token (JWT) used for authenticating to some servers.\n\n                                        Shorthand for fork:\n                                          { headers: { \"Authorization\": \"Bearer {YOUR-ENCODED-JWT}\" } }\n\n                                        If the fork.headers option specifies an \"Authorization\" header, it\n                                        will be be inserted after the JWT Bearer token.\n\n  --fork.userAgent                      The User-Agent header sent to the fork on each request.\n\n                                        Sent as Api-User-Agent when used in the browser.\n\n                                        Will be overridden by a \"User-Agent\" defined in the fork.headers\n                                        option, if provided.\n\n                                                                                [default: Ganache\u002F7.0.0-beta.0\n                                          (https:\u002F\u002Fwww.trufflesuite.com\u002Fganache; ganache\u003Cat>trufflesuite.com)]\n\n  --fork.origin                         The Origin header sent to the fork on each request.\n\n                                        Ignored in the browser.\n\n                                        Will be overridden by an \"Origin\" value defined in the fork.headers\n                                        option, if provided.\n\n  --fork.headers                        Headers to supply on each request to the forked provider.\n\n                                        Headers set here override headers set by other options, unless\n                                        otherwise specified.\n\n                                                                    Defaults to: [\"User-Agent: Ganache\u002FVERSION\n                                         (https:\u002F\u002Fwww.trufflesuite.com\u002Fganache; ganache\u003Cat>trufflesuite.com)\"]\n                                                                                                       [array]\n\n  --fork.requestsPerSecond              Restrict the number of requests per second sent to the fork provider.\n                                        0 means no limit is applied.                     [number] [default: 0]\n\n  --fork.disableCache                   Disables caching of all forking requests.   [boolean] [default: false]\n\n  --fork.deleteCache                    Deletes the persistent cache before starting.\n                                                                                    [boolean] [default: false]\n\n\nServer:\n  --server.ws                           Enable a websocket server.                   [boolean] [default: true]\n\n  --server.wsBinary                     Whether or not websockets should response with binary data\n                                        (ArrayBuffers) or strings.\n                                                                            [choices: \"true\", \"false\", \"auto\"]\n                                                                                               [default: auto]\n\n  --server.rpcEndpoint                  Defines the endpoint route the HTTP and WebSocket servers will listen\n                                        on.\n                                                                                                [default: \"\u002F\"]\n\n  -h, --server.host                     Hostname to listen on.\n                                        deprecated aliases: --host, --hostname\n                                                                               [string] [default: \"127.0.0.1\"]\n\n  -p, --server.port, --port             Port to listen on.\n                                        deprecated aliases: --port\n                                                                                      [number] [default: 8545]\n```\n\n### Detached Instances\n\nGanache can be started as a background instance via the CLI by providing the following argument (along with any valid combination\nof the Ganache startup arguments above):\n\n```console\n  -D, --detach, --😈                     Run Ganache in detached (daemon) mode.                       [boolean]\n```\n\nThis will start Ganache as a background process, and return to the console as soon as Ganache has started and is ready to\nreceive requests. A friendly name will be returned to STDOUT which can then be used to interact with the instance via\nthe `ganache instances` command with the following arguments:\n\n```console\nCommands:\n  ganache instances list         List instances running in detached mode\n  ganache instances stop \u003Cname>  Stop the instance specified by \u003Cname>\n```\n\nE.g., start Ganache on port 8544, with a block time of 10 seconds, and then stop the instance.\n\n```console\n$ ganache --port=8544 --miner.blockTime=10 --detach\nsalted_caramel_ganache\n\n$ ganache instances list\n┌───────┬────────────────────────┬──────────┬─────────┬────────────────┬────────┐\n│   PID │ Name                   │ Flavor   │ Version │ Host           │ Uptime │\n├───────┼────────────────────────┼──────────┼─────────┼────────────────┼────────┤\n│ 12182 │ salted_caramel_ganache │ ethereum │ 7.6.0   │ 127.0.0.1:8545 │    36s │\n└───────┴────────────────────────┴──────────┴─────────┴────────────────┴────────┘\n\n$ ganache instances stop salted_caramel_ganache\nProcess stopped\n```\n\nWith the following command, you can start Ganache, run your tests, and stop Ganache when you are finished.\n\n```console\nGANACHE=$(ganache --detach) && npm run test; ganache instances stop $GANACHE\n```\n\nOr if you are running PowerShell on Windows, you can do:\n\n```PowerShell\n$GANACHE=ganache --detach; npm run test; ganache instances stop $GANACHE\n```\n\n### Ganache Provider Events\n\nIn addition to [EIP-1193's](https:\u002F\u002Feips.ethereum.org\u002FEIPS\u002Feip-1193) `\"message\"` event and the legacy `\"data\"` event, Ganache emits 4 additional events: `\"ganache:vm:tx:before\"`, `\"ganache:vm:tx:step\"`, `\"ganache:vm:tx:after\"`, and `\"ganache:vm:tx:console.log\"`.\n\nThese events can be used to observe the lifecycle of any transaction executed via `*sendTransaction`, `eth_call`, `debug_traceTransaction`, or `debug_storageRangeAt`.\n\nThese share the [event paradigm that Truffle uses](https:\u002F\u002Fwww.trufflesuite.com\u002Fdocs\u002Ftruffle\u002Fadvanced\u002Fevent-system#how-to-define-your-event-handlers), but without any of the wildcard handling, i.e., no `\"vm:*\"` support (for now).\n\nEach of these events will emit a `context` object which is a unique object that can be used to identify a transaction over the course of its lifecycle. For example:\n\n```typescript\ninterface StepEvent {\n  account: {\n    nonce: bigint;\n    balance: bigint;\n    stateRoot: Buffer;\n    codeHash: Buffer;\n  };\n  address: Buffer;\n  codeAddress: Buffer;\n  depth: number;\n  gasLeft: bigint;\n  gasRefund: bigint;\n  memory: Buffer;\n  memoryWordCount: bigint;\n  opcode: {\n    name: string;\n    fee: number;\n  };\n  pc: number;\n  returnStack: Buffer[];\n  stack: Buffer[];\n}\n\nconst contexts = new Map();\nprovider.on(\"ganache:vm:tx:before\", (event: { context: {} }) => {\n  contexts.set(event.context, []);\n});\nprovider.on(\"ganache:vm:tx:step\", (event: { context: {}; data: StepEvent }) => {\n  contexts.get(event.context).push(event.data);\n});\nprovider.on(\n  \"ganache:vm:tx:console.log\",\n  (event: { context: {}; logs: (string | bigint | boolean)[] }) => {\n    console.log(...event.logs);\n  }\n);\nprovider.on(\"ganache:vm:tx:after\", (event: { context: {} }) => {\n  doAThingWithThisTransactionsSteps(contexts.get(event.context));\n  contexts.delete(event.context);\n});\n```\n\nThe reason this `context` is necessary is that Ganache may run multiple transactions simultaneously, so `\"ganache:vm:tx:step\"` events from different transactions could be intermingled.\n\nThe above events will be emitted for `eth_call`, `*sendTransaction`, `debug_traceTransaction`, and `debug_storageRangeAt`.\n\nCurrently, we do not await the event listener's return value, however, we'll likely enable this in the future.\n\n## `console.log` in Solidity\n\nBy default, Ganache logs to stdout when a contract executes a `console.log`\nSolidity statement during `eth_call`, `eth_sendTransaction`, `personal_sendTransaction`, and `eth_sendRawTransaction`.\nSee the [@ganache\u002Fconsole.log package](https:\u002F\u002Fgithub.com\u002Ftrufflesuite\u002Fganache\u002Ftree\u002Fdevelop\u002Fpackages\u002Fethereum\u002Fconsole.log)\nfor implementation and usage.\n\n## Community\n\n- [Discord](https:\u002F\u002Ftrfl.io\u002Fcommunity)\n- [Reddit](https:\u002F\u002Fwww.reddit.com\u002Fr\u002FTruffle\u002F)\n\n## Docker\n\nThe simplest way to get started with the Docker image:\n\n```console\n$ docker run --detach --publish 8545:8545 trufflesuite\u002Fganache:latest\n```\n\nTo pass options to Ganache through Docker simply add the arguments to the end of the run command, e.g.,\n\n```console\n$ docker run --detach --publish 8545:8545 trufflesuite\u002Fganache:latest --accounts 10 --debug\n                                                                      ^^^^^^^^^^^^^^^^^^^^^\n```\n\nThe Docker container adds an environment variable `DOCKER=true`; when this variable is set to `true` (case insensitive), Ganache uses a default hostname IP of `0.0.0.0` instead of the normal default `127.0.0.1`. You can still specify a custom hostname however:\n\n```console\n$ docker run --detach --publish 8545:8545 trufflesuite\u002Fganache:latest --host XXX.XXX.XXX.XXX\n                                                                      ^^^^^^^^^^^^^^^^^^^^^^\n```\n\nTo build and run the Docker container from source:\n\n```console\n$ git clone https:\u002F\u002Fgithub.com\u002Ftrufflesuite\u002Fganache.git && cd ganache\n```\n\nthen:\n\n```console\n$ docker build --tag trufflesuite\u002Fganache --file .\u002Fpackages\u002Fganache\u002FDockerfile .\n$ docker run --publish 8545:8545 trufflesuite\u002Fganache\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](https:\u002F\u002Fgithub.com\u002Ftrufflesuite\u002Fganache\u002Fblob\u002Fdevelop\u002FCONTRIBUTING.md) for our guide to contributing to Ganache.\n\n## Related\n\n- [Truffle GitHub](https:\u002F\u002Fwww.github.com\u002Ftrufflesuite\u002Ftruffle)\n- [Drizzle GitHub](https:\u002F\u002Fwww.github.com\u002Ftrufflesuite\u002Fdrizzle)\n- [Truffle Suite Website](https:\u002F\u002Fwww.trufflesuite.com\u002F)\n\n\u003Cbr\u002F>\n\n---\n\n\u003Ch4 align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fwww.trufflesuite.com\" title=\"Brought to you by Truffle\">\u003Cimg alt=\"Truffle\" src=\"https:\u002F\u002Fganache.dev\u002Fassets\u002Fimg\u002Ftruffle-logo-dark.svg\" width=\"60\"\u002F>\u003C\u002Fa>\n\u003C\u002Fh4>\n","Ganache 是一个用于快速以太坊开发的本地区块链创建工具。它允许开发者在本地环境中模拟完整的以太坊网络，从而无需连接到公共测试网或主网即可进行智能合约的编写、部署和调试。该工具支持多种高级功能，如区块时间调整、交易记录查看以及私钥管理等，极大地方便了区块链应用的开发与测试工作。Ganache 采用 TypeScript 编写，并遵循 MIT 许可证开放源代码。尽管 Truffle Suite 已宣布停止更新，但 Ganache 仍然适合那些需要在受控环境下进行以太坊相关项目开发的学习者和专业开发者使用。","2026-06-11 03:29:04","top_topic"]