Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ganache

trufflesuite1mMIT7.9.2TypeScript support: included

A library and cli to create a local blockchain for fast Ethereum development.

ganache, ganache-core, ganache-cli, @trufflesuite/ganache, @truffle/ganache, ethereum, evm, blockchain, smart contracts, dapps, solidity, vyper, fe, web3, tooling, truffle

readme

Ganache

A tool for creating a local blockchain for fast Ethereum development.

FeaturesGetting StartedDocumentationCommunityDockerContributingRelated


Features

Ganache 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.

  • console.log in Solidity
  • Zero-config Mainnet Forking
  • Fork any Ethereum network without waiting to sync
  • Ethereum JSON-RPC support
  • Snapshot/revert state
  • Mine blocks instantly, on demand, or at an interval
  • Fast-forward time
  • Impersonate any account (no private keys required!)
  • Listens for JSON-RPC 2.0 requests over HTTP/WebSockets
  • Programmatic use in Node.js
  • Pending Transactions
  • Flavors (aka Plugins), like Filecoin

Getting Started

Ganache can be used from the command line, programmatically via Node.js, or in the browser.

Command line use

You must first install Node.js >= v16.0.0 and npm >= 7.10.0.

To install Ganache globally, run:

$ npm install ganache --global

In case you're upgrading from a previous version of Ganache, we've also written up this handy guide on how to upgrade/install Ganache and to document all breaking changes to look out for.

Once installed globally, you can start ganache right from your command line:

ganache

Your output should look something like this:

Ganache CLI v6.12.1 (ganache-core: 2.13.1)

Available Accounts
==================
(0) 0xe261e26aECcE52b3788Fac9625896FFbc6bb4424 (100 ETH)
(1) 0xcE16e8eb8F4BF2E65BA9536C07E305b912BAFaCF (100 ETH)
(2) 0x02f1c4C93AFEd946Cce5Ad7D34354A150bEfCFcF (100 ETH)
(3) 0x0B75F0b70076Fab3F18F94700Ecaf3B00fE528E7 (100 ETH)
(4) 0x7194d1F1d43c2c58302BB61a224D41B649e65C93 (100 ETH)
(5) 0xC9A2d92c5913eDEAd9a7C936C96631F0F2241063 (100 ETH)
(6) 0xD79BcDE5Cb11cECD1dfC6685B65690bE5b6a611e (100 ETH)
(7) 0xb6D080353f40dEcA2E67108087c356d3A1AfcD64 (100 ETH)
(8) 0x31A064DeeaD74DE7B9453beB4F780416D8859d3b (100 ETH)
(9) 0x37524a360a40C682F201Fb011DB7bbC8c8A247c6 (100 ETH)

Private Keys
==================
(0) 0x7f109a9e3b0d8ecfba9cc23a3614433ce0fa7ddcc80f2a8f10b222179a5a80d6
(1) 0x6ec1f2e7d126a74a1d2ff9e1c5d90b92378c725e506651ff8bb8616a5c724628
(2) 0xb4d7f7e82f61d81c95985771b8abf518f9328d019c36849d4214b5f995d13814
(3) 0x941536648ac10d5734973e94df413c17809d6cc5e24cd11e947e685acfbd12ae
(4) 0x5829cf333ef66b6bdd34950f096cb24e06ef041c5f63e577b4f3362309125863
(5) 0x8fc4bffe2b40b2b7db7fd937736c4575a0925511d7a0a2dfc3274e8c17b41d20
(6) 0xb6c10e2baaeba1fa4a8b73644db4f28f4bf0912cceb6e8959f73bb423c33bd84
(7) 0xfe8875acb38f684b2025d5472445b8e4745705a9e7adc9b0485a05df790df700
(8) 0xbdc6e0a69f2921a78e9af930111334a41d3fab44653c8de0775572c526feea2d
(9) 0x3e215c3d2a59626a669ed04ec1700f36c05c9b216e592f58bbfd3d8aa6ea25f9

HD Wallet
==================
Mnemonic:      candy maple velvet cake sugar cream honey rich smooth crumble sweet treat
Base HD Path:  m/44'/60'/0'/0/{account_index}

Default Gas Price
==================
20000000000

Gas Limit
==================
6721975

Call Gas Limit
==================
9007199254740991

Listening on 127.0.0.1:8545

NPM project use

If you want to install Ganache into an npm project, run:

$ npm install ganache

You can then add Ganache to your package.json scripts:

"scripts": {
  "ganache": "ganache --wallet.seed myCustomSeed"
}

See Documentation for additional command line options.

Then start it:

$ npm run ganache

Programmatic use

You can use Ganache programmatically from Node.js. Install Ganache into your npm package:

$ npm install ganache

Then you can use ganache as an EIP-1193 provider only, an EIP-1193 provider and JSON-RPC web server, as a Web3 provider, an ethers provider, or a viem transport.

As an EIP-1193 provider only:

const ganache = require("ganache");

const options = {};
const provider = ganache.provider(options);
const accounts = await provider.request({ method: "eth_accounts", params: [] });

As an EIP-1193 provider and JSON-RPC web server:

const ganache = require("ganache");

const options = {};
const server = ganache.server(options);
const PORT = 0; // 0 means any available port
server.listen(PORT, async err => {
  if (err) throw err;

  console.log(`ganache listening on port ${server.address().port}...`);
  const provider = server.provider;
  const accounts = await provider.request({
    method: "eth_accounts",
    params: []
  });
});

As a web3.js provider:

To use ganache as a Web3 provider:

const Web3 = require("web3");
const ganache = require("ganache");

const web3 = new Web3(ganache.provider());

NOTE: depending on your web3 version, you may need to set a number of confirmation blocks

const web3 = new Web3(ganache.provider(), null, { transactionConfirmationBlocks: 1 });

As an ethers.js provider:

const ganache = require("ganache");

const provider = new ethers.providers.Web3Provider(ganache.provider());

As a viem transport:

To use a ganache provider as a viem transport:

import { createWalletClient, custom } from "viem";
import { localhost } from "viem/chains";
import ganache from "ganache";
const client = createWalletClient({
  chain: localhost,
  transport: custom(ganache.provider())
});

Browser Use

You can also use Ganache in the browser by adding the following script to your HTML:

<script src="https://cdn.jsdelivr.net/npm/ganache@{VERSION}/dist/web/ganache.min.js"></script>

NOTE: the {VERSION} in the above path needs to be replaced with a version number or tag that is listed in npm.

From there, Ganache is available in your browser for use:

const options = {};
const provider = Ganache.provider(options);

Documentation

See our Interactive Docs for a full list of Ganache's RPC methods.

Startup Options

The 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.

ganache --namespace.option="value"

for CLI use, and

const options = { namespace: { option: "value"}};
const provider = ganache.provider(options);

for programmatic use.

The following options are listed for command line use, but can also be used when running Ganache programmatically in your project.

Chain:
  --chain.allowUnlimitedContractSize    Allows unlimited contract sizes while debugging. Setting this to true
                                        will cause ganache to behave differently than production environments.
                                                                                    [boolean] [default: false]

  --chain.allowUnlimitedInitCodeSize    Allows unlimited initcode sizes while debugging. Setting this to true
                                        will cause ganache to behave differently than production environments.
                                                                                    [boolean] [default: false]

  --chain.asyncRequestProcessing        When set to false only one request will be processed at a time.
                                                                                     [boolean] [default: true]

  --chain.chainId                       The currently configured chain id.            [number] [default: 1337]

  -i, --chain.networkId                 The id of the network returned by the RPC method net_version.
                                        deprecated aliases: --networkId
                                                            [number] [default: System time at process start or
                                                               Network ID of forked blockchain if configured.]

  -t, --chain.time                      Date that the first block should start.
                                        deprecated aliases: --time                                    [number]

  -k, --chain.hardfork                  Set the hardfork rules for the EVM.
                                        deprecated aliases: --hardfork
          [string] [choices: "constantinople", "byzantium", "petersburg", "istanbul", "muirGlacier", "berlin",
                           "london", "arrowGlacier", "grayGlacier", "merge", "shanghai"] [default: "shanghai"]

  --chain.vmErrorsOnRPCResponse         Whether to report runtime errors from EVM code as RPC errors.
                                                                                    [boolean] [default: false]


Database:
  --database.dbPath                     Specify a path to a directory to save the chain database.
                                        deprecated aliases: --db, --db_path                           [string]

Logging:
  --logging.debug                       Set to true to log EVM opcodes.             [boolean] [default: false]

  -q, --logging.quiet                   Set to true to disable logging.
                                        deprecated aliases: --quiet                 [boolean] [default: false]

  -v, --logging.verbose                 Set to true to log detailed RPC requests.
                                        deprecated aliases: --verbose               [boolean] [default: false]


Miner:
  -b, --miner.blockTime                 Sets the blockTime in seconds for automatic mining. A blockTime of 0
                                        enables "instamine mode", where new executable transactions will be
                                        mined instantly.
                                        deprecated aliases: --blockTime                  [number] [default: 0]

  -g, --miner.defaultGasPrice           Sets the default gas price in WEI for transactions if not otherwise
                                        specified.
                                        deprecated aliases: --gasPrice          [string] [default: 0x77359400]

  -l, --miner.blockGasLimit             Sets the block gas limit in WEI.
                                        deprecated aliases: --gasLimit            [string] [default: 0xb71b00]

  --miner.defaultTransactionGasLimit    Sets the default transaction gas limit in WEI. Set to "estimate" to
                                        use an estimate (slows down transaction execution by 40%+).
                                                                                   [string] [default: 0x15f90]

  --miner.difficulty                    Sets the block difficulty.                     [string] [default: 0x1]

  --miner.callGasLimit                  Sets the transaction gas limit in WEI for eth_call and eth_estimateGas
                                        calls.
                                                                                 [string] [default: 0x2faf080]
  --miner.instamine                     Set the instamine mode to either "eager" (default) or "strict". In
                                        "eager" mode a transaction will be included in a block before its hash
                                        is returned to the caller. In "strict" mode a transaction's hash is
                                        returned to the caller before the transaction is included in a block.
                                        This value has no effect if `blockTime` is *not* `0` (the default).`
                                                      [string] [choices: "eager", "strict"] [default: "eager"]

  --miner.coinbase                      Sets the address where mining rewards will go.
                                                         [default: 0x0000000000000000000000000000000000000000]

  --miner.extraData                     Set the extraData block header field a miner can include.
                                                                                        [string] [default: 0x]

  --miner.priceBump                     Minimum price bump percentage needed to replace a transaction that
                                        already exists in the transaction pool.         [string] [default: 10]


Wallet:
  --wallet.accounts                     Account data in the form <private_key>,<initial_balance>, can be
                                        specified multiple times. Note that private keys are 64 characters
                                        long and must be entered as an 0x-prefixed hex string. Balance can
                                        either be input as an integer, or as a 0x-prefixed hex string with
                                        either form specifying the initial balance in wei.
                                        deprecated aliases: --account                                  [array]

  -a, --wallet.totalAccounts            Number of accounts to generate at startup.
                                        deprecated aliases: --accounts                  [number] [default: 10]

  -d, --wallet.deterministic            Use pre-defined, deterministic seed.
                                        deprecated aliases: --deterministic         [boolean] [default: false]

  -s, --wallet.seed                     Seed to use to generate a mnemonic.
                                        deprecated aliases: --seed
                                                                                                      [string]
                                             [default: Random value, unless wallet.deterministic is specified]

  -m, --wallet.mnemonic                 Use a specific HD wallet mnemonic to generate initial addresses.
                                        deprecated aliases: --mnemonic                                [string]
                                                                         [default: Generated from wallet.seed]

  -u, --wallet.unlockedAccounts         Array of addresses or address indexes specifying which accounts should
                                        be unlocked.
                                        deprecated aliases: --unlock                                   [array]

  -n, --wallet.lock                     Lock available accounts by default (good for third party transaction
                                        signing).
                                        deprecated aliases: --secure, --lock        [boolean] [default: false]

  --wallet.passphrase                   Passphrase to use when locking accounts.
                                        deprecated aliases: --passphrase                              [string]

  --wallet.accountKeysPath              Specifies a file to save accounts and private keys to, for testing.
                                        deprecated aliases: --account_keys_path, --acctKeys           [string]

  -e, --wallet.defaultBalance           The default account balance, specified in ether.
                                        deprecated aliases: --defaultBalanceEther     [number] [default: 1000]

  --wallet.hdPath                       The hierarchical deterministic path to use when generating accounts.
                                                                            [string] [default: m,44',60',0',0]


Fork:
  -f, --fork.url                        Fork from another currently running Ethereum client at a given block.
                                        Input should be the URL of the node, e.g. "http://localhost:1337". You
                                        can optionally specify the block to fork from using an @ sign:
                                        "http://localhost:1337@8675309".

                                        You can specify Basic Authentication credentials in the URL as well.
                                        e.g., "wss://user:password@example.com/". If you need to use an Infura
                                        Project Secret, you would use it like this:
                                        "wss://:{YOUR-PROJECT-SECRET}@mainnet.infura.com/..."

                                        Alternatively, you can use the fork.username and fork.password
                                        options.
                                        deprecated aliases: --fork

  --fork.network                        A network name to fork from; uses Infura's archive nodes.

                                        Use the shorthand command ganache --fork to automatically fork from
                                        Mainnet at the latest block.
                                                            [choices: "mainnet", "goerli", "görli", "sepolia"]
  --fork.blockNumber                    Block number the provider should fork from.
                                                                                [default: Latest block number]

  --fork.preLatestConfirmations         When the fork.blockNumber is set to "latest" (default), the number of
                                        blocks before the remote node's "latest" block to fork from.
                                                                                         [number] [default: 5]

  --fork.username                       Username to use for Basic Authentication. Does not require setting
                                        fork.password.

                                        When combined with fork.password, is shorthand for fork: { headers: {
                                        "Authorization": "Basic {ENCODED-BASIC-HEADER}" } }

                                        If the fork.headers option specifies an "Authorization" header, it
                                        will be be inserted after this Basic token.

  --fork.password                       Password to use for Basic Authentication. Does not require setting
                                        fork.username.

                                        When combined with fork.username, is shorthand for fork: { headers: {
                                        "Authorization": "Basic {ENCODED-BASIC-HEADER}" } }

                                        If the fork.headers option specifies an "Authorization" header, it
                                        will be be inserted after this Basic token.

  --fork.jwt                            Encoded JSON Web Token (JWT) used for authenticating to some servers.

                                        Shorthand for fork:
                                          { headers: { "Authorization": "Bearer {YOUR-ENCODED-JWT}" } }

                                        If the fork.headers option specifies an "Authorization" header, it
                                        will be be inserted after the JWT Bearer token.

  --fork.userAgent                      The User-Agent header sent to the fork on each request.

                                        Sent as Api-User-Agent when used in the browser.

                                        Will be overridden by a "User-Agent" defined in the fork.headers
                                        option, if provided.

                                                                                [default: Ganache/7.0.0-beta.0
                                          (https://www.trufflesuite.com/ganache; ganache<at>trufflesuite.com)]

  --fork.origin                         The Origin header sent to the fork on each request.

                                        Ignored in the browser.

                                        Will be overridden by an "Origin" value defined in the fork.headers
                                        option, if provided.

  --fork.headers                        Headers to supply on each request to the forked provider.

                                        Headers set here override headers set by other options, unless
                                        otherwise specified.

                                                                    Defaults to: ["User-Agent: Ganache/VERSION
                                         (https://www.trufflesuite.com/ganache; ganache<at>trufflesuite.com)"]
                                                                                                       [array]

  --fork.requestsPerSecond              Restrict the number of requests per second sent to the fork provider.
                                        0 means no limit is applied.                     [number] [default: 0]

  --fork.disableCache                   Disables caching of all forking requests.   [boolean] [default: false]

  --fork.deleteCache                    Deletes the persistent cache before starting.
                                                                                    [boolean] [default: false]


Server:
  --server.ws                           Enable a websocket server.                   [boolean] [default: true]

  --server.wsBinary                     Whether or not websockets should response with binary data
                                        (ArrayBuffers) or strings.
                                                                            [choices: "true", "false", "auto"]
                                                                                               [default: auto]

  --server.rpcEndpoint                  Defines the endpoint route the HTTP and WebSocket servers will listen
                                        on.
                                                                                                [default: "/"]

  -h, --server.host                     Hostname to listen on.
                                        deprecated aliases: --host, --hostname
                                                                               [string] [default: "127.0.0.1"]

  -p, --server.port, --port             Port to listen on.
                                        deprecated aliases: --port
                                                                                      [number] [default: 8545]

Detached Instances

Ganache can be started as a background instance via the CLI by providing the following argument (along with any valid combination of the Ganache startup arguments above):

  -D, --detach, --😈                     Run Ganache in detached (daemon) mode.                       [boolean]

This will start Ganache as a background process, and return to the console as soon as Ganache has started and is ready to receive requests. A friendly name will be returned to STDOUT which can then be used to interact with the instance via the ganache instances command with the following arguments:

Commands:
  ganache instances list         List instances running in detached mode
  ganache instances stop <name>  Stop the instance specified by <name>

E.g., start Ganache on port 8544, with a block time of 10 seconds, and then stop the instance.

$ ganache --port=8544 --miner.blockTime=10 --detach
salted_caramel_ganache

$ ganache instances list
┌───────┬────────────────────────┬──────────┬─────────┬────────────────┬────────┐
│   PID │ Name                   │ Flavor   │ Version │ Host           │ Uptime │
├───────┼────────────────────────┼──────────┼─────────┼────────────────┼────────┤
│ 12182 │ salted_caramel_ganache │ ethereum │ 7.6.0   │ 127.0.0.1:8545 │    36s │
└───────┴────────────────────────┴──────────┴─────────┴────────────────┴────────┘

$ ganache instances stop salted_caramel_ganache
Process stopped

With the following command, you can start Ganache, run your tests, and stop Ganache when you are finished.

GANACHE=$(ganache --detach) && npm run test; ganache instances stop $GANACHE

Or if you are running PowerShell on Windows, you can do:

$GANACHE=ganache --detach; npm run test; ganache instances stop $GANACHE

Ganache Provider Events

In addition to EIP-1193's "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".

These events can be used to observe the lifecycle of any transaction executed via *sendTransaction, eth_call, debug_traceTransaction, or debug_storageRangeAt.

These share the event paradigm that Truffle uses, but without any of the wildcard handling, i.e., no "vm:*" support (for now).

Each 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:

interface StepEvent {
  account: {
    nonce: bigint;
    balance: bigint;
    stateRoot: Buffer;
    codeHash: Buffer;
  };
  address: Buffer;
  codeAddress: Buffer;
  depth: number;
  gasLeft: bigint;
  gasRefund: bigint;
  memory: Buffer;
  memoryWordCount: bigint;
  opcode: {
    name: string;
    fee: number;
  };
  pc: number;
  returnStack: Buffer[];
  stack: Buffer[];
}

const contexts = new Map();
provider.on("ganache:vm:tx:before", (event: { context: {} }) => {
  contexts.set(event.context, []);
});
provider.on("ganache:vm:tx:step", (event: { context: {}; data: StepEvent }) => {
  contexts.get(event.context).push(event.data);
});
provider.on(
  "ganache:vm:tx:console.log",
  (event: { context: {}; logs: (string | bigint | boolean)[] }) => {
    console.log(...event.logs);
  }
);
provider.on("ganache:vm:tx:after", (event: { context: {} }) => {
  doAThingWithThisTransactionsSteps(contexts.get(event.context));
  contexts.delete(event.context);
});

The 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.

The above events will be emitted for eth_call, *sendTransaction, debug_traceTransaction, and debug_storageRangeAt.

Currently, we do not await the event listener's return value, however, we'll likely enable this in the future.

console.log in Solidity

By default, Ganache logs to stdout when a contract executes a console.log Solidity statement during eth_call, eth_sendTransaction, personal_sendTransaction, and eth_sendRawTransaction. See the @ganache/console.log package for implementation and usage.

Community

Docker

The simplest way to get started with the Docker image:

$ docker run --detach --publish 8545:8545 trufflesuite/ganache:latest

To pass options to Ganache through Docker simply add the arguments to the end of the run command, e.g.,

$ docker run --detach --publish 8545:8545 trufflesuite/ganache:latest --accounts 10 --debug
                                                                      ^^^^^^^^^^^^^^^^^^^^^

The 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:

$ docker run --detach --publish 8545:8545 trufflesuite/ganache:latest --host XXX.XXX.XXX.XXX
                                                                      ^^^^^^^^^^^^^^^^^^^^^^

To build and run the Docker container from source:

$ git clone https://github.com/trufflesuite/ganache.git && cd ganache

then:

$ docker build --tag trufflesuite/ganache --file ./packages/ganache/Dockerfile .
$ docker run --publish 8545:8545 trufflesuite/ganache

Contributing

See CONTRIBUTING.md for our guide to contributing to Ganache.



Truffle

changelog

Changelog

7.2.0 - 2021-09-28

Added

  • Add db.getMany(keys) (#381) (e4445a7) (Vincent Weevers).

7.1.0 - 2021-09-21

Added

  • Support for await...of db.iterator() (#379) (372695f) (Vincent Weevers)

7.0.0 - 2021-04-09

If you are upgrading: please see UPGRADING.md.

Changed

  • Replace immediate shim with smaller queue-microtask (a00e3ed) (Vincent Weevers).
  • Remove need for full buffer shim (except in test suite) (8f79234) (Vincent Weevers)
  • Bump level-concat-iterator and level-supports (0b5e1a3) (Vincent Weevers)
  • Breaking: drop support of Safari 11 (7c4cce6) (Vincent Weevers)
  • Modernize syntax and bump standard from 14.x to 16.x (cfe8040) (Vincent Weevers)
  • Replace xtend dependency with Object.assign() (9d4171f) (Vincent Weevers)
  • Breaking: remove legacy range options (start & end) (979d34f) (Level/community#86) (Vincent Weevers)
  • Breaking: drop support of stock Android browser (AOSP) (a1fd94e) (Vincent Weevers)
  • Breaking: drop node 6 and 8 (1beee24) (Vincent Weevers)
  • Breaking (for browsers): bump buffer from 5.x to 6.x (#373) (f62f38b) (Alex Potsides).

Added

6.3.0 - 2020-04-11

Changed

  • Upgrade devDependency dependency-check from ^3.3.0 to ^4.1.0 (9193656) (@vweevers)

Added

  • Support running test suite on a levelup db, as well as skipping start and end tests (for multileveldown) (#364) (@vweevers)

6.2.3 - 2020-04-03

Changed

  • Upgrade airtap devDependency from ^2.0.0 to ^3.0.0 (#360) (@vweevers)

Fixed

6.2.2 - 2019-10-21

Added

6.2.1 - 2019-10-01

Fixed

6.2.0 - 2019-09-30

Changed

  • Upgrade hallmark devDependency from ^1.0.0 to ^2.0.0 (#349) (@vweevers)
  • Upgrade standard devDependency from ^13.0.1 to ^14.0.0 (#348) (@vweevers)

Added

6.1.1 - 2019-08-18

Fixed

  • Remove process.emitWarning because it breaks AppVeyor builds (8e963c3) (@vweevers)

6.1.0 - 2019-08-18

Changed

  • Upgrade hallmark devDependency from ^0.1.0 to ^1.0.0 (#343) (@vweevers)
  • Upgrade standard devDependency from ^12.0.0 to ^13.0.1 (#341) (@vweevers)

Added

  • Add experimental clear() method to delete all entries or a range (#310) (@vweevers).

6.0.3 - 2019-04-26

Changed

  • Upgrade nyc devDependency from ^13.2.0 to ^14.0.0 (#334) (@vweevers)

Fixed

6.0.2 - 2019-03-30

Changed

Fixed

6.0.1 - 2018-12-27

Changed

  • Upgrade hallmark devDependency from 0.0.2 to 0.1.0 (#316) (@vweevers)
  • Split v6 upgrade guide into sections for consumers and implementors (@vweevers)

Fixed

  • Remove range tests that assumed zero-length strings or Buffers meant "not defined" (#319) (@vweevers)

6.0.0 - 2018-10-20

If you are upgrading: please see UPGRADING.md.

Changed

Added

Removed

Fixed

5.0.0 - 2018-05-22

If you are upgrading: please see UPGRADING.md.

Changed

Added

Removed

4.0.3 - 2018-02-21

Changed

Fixed

  • Remove invalid TypeScript from Batch (@Tapppi)
  • Add JSDoc to incorrectly inferred TypeScript types (@Tapppi)

4.0.2 - 2018-02-09

Fixed

  • Fix iterator#next to return this (@vweevers)

4.0.1 - 2018-02-09

This was released as a patch because it only changed tests and TypeScript typings (which are marked experimental and don't follow semver).

Added

  • Run test suite in TypeScript in addition to Node.js (@vweevers)
  • Add TypeScript smoke test (@vweevers)
  • Add TypeScript readme section with stability badge (@vweevers)

Removed

  • Remove obsolete parameters from tests (@vweevers)

Fixed

  • Update TypeScript typings for v4 (@vweevers)
  • Use ES6 classes in tests to please TypeScript (@vweevers)
  • Define default methods on prototype to please TypeScript (@vweevers)

4.0.0 - 2018-01-20

If you are upgrading: please see UPGRADING.md.

Changed

  • Ignore empty range options in AbstractLevelDOWN#_setupIteratorOptions (@ralphtheninja)
  • Make testCommon.js the default value for testCommon parameter (@ralphtheninja)
  • Use Buffer.isBuffer() instead of AbstractLevelDOWN#isBuffer (@ralphtheninja)
  • Cleanup iterator tests (#161) (@ralphtheninja)
  • Pass test function as a parameter instead of setting local global (@ralphtheninja)
  • Assert batch type is 'put' or 'del' (@vweevers)
  • Assert batch array elements are objects (@vweevers)

Added

Removed

  • Remove isLevelDOWN function and corresponding tests (@ralphtheninja)
  • Remove AbstractLevelDOWN#approximateSize method and corresponding tests (@ralphtheninja)
  • Remove testBuffer in abstract/put-get-del-test.js (@ralphtheninja)
  • Remove object value test in abstract/put-test.js (@vweevers)
  • Remove serialize buffer tests (@vweevers)
  • Remove serialize object tests (@vweevers)
  • Remove BufferType parameter in abstract/put-get-del-test.js, use Buffer (@ralphtheninja)

Fixed

  • Ensure stores are closed properly (fixes problems on Windows) (@ralphtheninja)
  • Call back errors on next tick to avoid zalgo (@vweevers)

3.0.0 - 2017-11-04

If you are upgrading: please see UPGRADING.md.

Added

Removed

  • Drop support for 0.12. Cause for new major version! (@vweevers)

Fixed

2.7.2 - 2017-10-11

Changed

2.7.1 - 2017-09-30

Changed

2.7.0 - 2017-09-12

Added

2.6.3 - 2017-09-05

Changed

  • Upgrade dependencies (@ralphtheninja)
  • Convert nullish values to empty strings (@bigeasy)
  • Use t.equal(a, b) instead of t.ok(a === b) (@bigeasy)
  • Relax tests for serializing object in abstract/chained-batch-test.js (@ralphtheninja)

Added

Fixed

2.6.2 - 2017-07-30

Changed

Added

Fixed

2.6.1 - 2016-09-12

Fixed

  • Fix null case in default value serializer (fixes problems in 2.6.0) (@juliangruber)

2.6.0 - 2016-03-10

This release was a breaking change. See @juliangruber's comment for more information.

Changed

  • Use proto delegation to patch methods on db (@deanlandolt)
  • Allow serialization functions to return buffers (@deanlandolt)

Added

  • Add collectBatchOps function to buffer _put and _del inputs in abstract/chained-batch-test.js (@deanlandolt)

Removed

  • Remove unnecessary initialization hackery in abstract/chained-batch-test.js (@deanlandolt)

2.5.0 - 2016-05-01

Changed

  • Upgrade dependencies and add more node versions to Travis (@ralphtheninja)

Added

Removed

Fixed

2.4.1 - 2015-08-29

Fixed

2.4.0 - 2015-05-19

Added

2.3.1 - 2015-05-18

Added

Removed

  • Extract Contributors section from README into level/community (@ralphtheninja)

Fixed

2.3.0 - 2015-05-18

Changed

Added

2.2.2 - 2015-05-13

Fixed

2.2.1 - 2015-05-12

Fixed

2.2.0 - 2015-05-10

Added

  • Test { sync: true } option in abstract/put-test.js (@juliangruber)

2.1.4 - 2015-04-28

Fixed

2.1.3 - 2015-04-28

Changed

2.1.2 - 2015-04-27

Changed

2.1.1 - 2015-04-27

Changed

Added

Fixed

  • Include .nonErrorValues() test in abstract/put-get-del-test.js (@hden)
  • rvagg/node-abstract-leveldown moved to level/abstract-leveldown (@ralphtheninja)
  • Fix Travis for 0.8 (@ralphtheninja)

2.1.0 - 2014-11-09

Changed

  • Use setTimeout instead of process.nextTick (@bigeasy)

Added

Fixed

  • Don't fail if no value is returned by ._get (@watson)
  • Use error test function when testing for errors (@watson)

2.0.3 - 2014-10-02

No change.

2.0.2 - 2014-10-02

Added

2.0.1 - 2014-09-01

Changed

  • Set default values for options to .open, .get, .put, .del and .batch (@watson)
  • Update pattern for setting default options for the iterator (@watson)
  • Allow boolean options to be falsy/truthy (@watson)

Removed

  • Remove default options that are too LevelDOWN specific (@watson)

2.0.0 - 2014-08-26

Changed

  • Switch to allowing writes of empty values, null, undefined, '', [] and empty buffer (@juliangruber)
  • Rename AbstractLevelDOWN#_checkKeyValue to AbstractLevelDOWN#_checkKey (@rvagg)

1.0.0 - 2014-08-24

Changed

  • Ensure Boolean iterator options are Boolean (@watson)

Added

Removed

  • Remove options.start hackery (@rvagg)

0.12.4 - 2014-08-20

Changed

Added

  • Test that simple-iterator returns buffers (@kesla)
  • Test implicit snapshots (@kesla)

0.12.3 - 2014-06-27

Changed

0.12.2 - 2014-04-26

Changed

  • Have isTypedArray check for existence of ArrayBuffer and Uint8Array constructors before usage (@rvagg)

0.12.1 - 2014-04-26

Changed

  • Set default BufferType in abstract/put-get-del-test.js to Buffer instead of ArrayBuffer (@maxogden)

0.12.0 - 2014-03-12

Changed

  • Revert to pure Buffer and remove usage of Uint16Array (@rvagg)

0.11.4 - 2014-03-11

Removed

  • Remove duplicate call to t.end() (@maxogden)

0.11.3 - 2014-01-26

Changed

  • Loosen the buffer type check (@rvagg)

0.11.2 - 2013-12-05

Added

Fixed

  • Fix iterator tests in test.js (@rvagg)

0.11.1 - 2013-11-15

Changed

  • Adjust abstract/approximate-size-test.js to account for snappy compression (@rvagg)

0.11.0 - 2013-10-14

Added

  • Normalize iterator() options with AbstractLevelDOWN#_setupIteratorOptions (@rvagg)

0.10.2 - 2013-09-06

Changed

  • Refactor duplicated versions of isTypedArray into abstract/util.js (@rvagg)
  • Refactor duplicated versions of 'NotFound' checks into abstract/util.js, fixed too-strict version in get-test.js (@rvagg)

0.10.1 - 2013-08-29

Changed

  • Relax check for Not Found error message to be case insensitive in get-test.js (@rvagg)

Added

0.10.0 - 2013-08-19

Added

0.9.0 - 2013-08-11

Changed

  • Make AbstractChainedBatch extensible (@kesla)
  • Export AbstractChainedBatch from abstract-leveldown.js (@kesla)

Added

  • Test simultaneous get's (@kesla)
  • Test AbstractChainedBatch extensibility (@kesla)

Fixed

  • Fix broken test assertion in abstract/get-test.js (@rvagg)
  • Fix tests that weren't running properly (@kesla)

0.8.2 - 2013-08-02

No changes. Merely published changes made in 0.8.1.

0.8.1 - 2013-08-02

The version in package.json was changed from 0.7.4 to 0.8.1. The 0.8.1 tag exists but this version was never published to npm.

Changed

  • Remove use of const in testCommon.js (@rvagg)

0.8.0 - 2013-08-02

It seems the version in package.json was never changed to 0.8.0 in the git history, even though the 0.8.0 tag exists. Most likely package.json was modified locally during npm publish but was never committed.

Changed

  • Use process.browser check instead of process.title == 'browser' (@rvagg)

Added

  • Add BufferType parameter to abstract/put-get-del-test.js for bops support (@rvagg)
  • Add isTypedArray function which checks ArrayBuffer or Uint8Array for bops support (@rvagg)

Fixed

  • Fix cleanup function not calling back when browserified (@rvagg)

0.7.4 - 2013-08-02

Fixed

  • Fix problems related to browserify and rimraf (@rvagg)

0.7.3 - 2013-07-26

Added

0.7.2 - 2013-07-08

Changed

  • Freeze chained batch state after .write() has been called (@rvagg)
  • Make NotFound error case insensitive (@rvagg)
  • Use self rather than binding functions to this (@juliangruber)

Added

  • Add AbstractChainedBatch#_checkWritten (@rvagg)
  • Test delete on non-existent key (@rvagg)
  • Test iterator with start after database end (@juliangruber)

Fixed

  • Don't coerce values to strings in browser (@maxogden)
  • Make tests work in node and browser (@maxogden)

0.7.1 - 2013-05-15

Changed

  • Adjust tests to be browserable (@rvagg)

0.7.0 - 2013-05-14

Added

  • Add AbstractChainedBatch#clear (@rvagg)

0.6.1 - 2013-05-14

Changed

  • Make AbstractIterator call back with an error instead of throwing on nexting and ending (@mcollina)

0.6.0 - 2013-05-14

Changed

  • Split t.deepEqual() into multiple t.equal() in abstract/iterator-test.js (@rvagg)
  • Make AbstractIterator call back with an error instead of throwing on nexting and ending (@mcollina)

0.5.0 - 2013-05-14

Changed

  • Make iterator.end(cb) and iterator.next(cb) call back with an error instead of throwing (@mcollina)

0.4.0 - 2013-05-14

Changed

  • Move AbstractIterator from abstract-leveldown.js to abstract-iterator.js (@rvagg)

Added

  • Add AbstractChainedBatch (@rvagg)
  • Add AbstractLevelDOWN#_chainedBatch (@rvagg)
  • Add abstract/batch-test.js and abstract/chained-batch-test.js (@rvagg)

0.4.0-1 - 2013-05-14

Added

0.3.0 - 2013-05-04

Changed

  • Use this._checkKeyValue() instead of local function (@rvagg)
  • Use this._isBuffer() instead of Buffer.isBuffer() (@rvagg)

Added

  • Restore test for opening the database without options (@rvagg)
  • Add AbstractLevelDOWN#_isBuffer so it can be overridden (@rvagg)
  • Add AbstractLevelDOWN#_checkKeyValue so it can be overridden (@rvagg)

0.2.3 - 2013-05-04

Removed

  • Remove test for opening the database without options (@rvagg)

0.2.2 - 2013-05-04

Changed

  • Split .open() tests into .open() and .openAdvanced() (@rvagg)

0.2.1 - 2013-05-04

Changed

  • Convert values to string in abstract/put-get-del-test.js if Buffer is undefined (@rvagg)

0.2.0 - 2013-05-04

Changed

  • Convert values to string in abstract/get-test.js if Buffer is undefined (@rvagg)
  • Don't stringify keys and values in abstract/iterator-test.js (@maxogden)

Added

  • Add process.browser check for start and end keys in browser (@maxogden)
  • Add levelup contributors (@rvagg)

Fixed

0.1.0 - 2013-04-23

Added

  • Import abstract tests from leveldown (@maxogden)

Fixed

0.0.2 - 2013-03-18

Changed

  • Export checkKeyValue (@rvagg)

Added

  • Add node 0.10 to Travis (@rvagg)
  • Add Buffer.isBuffer() checks to keys and values (@rvagg)

0.0.1 - 2013-03-18

Added

  • Add checkKeyValue function for more complete error checking (@rvagg)

0.0.0 - 2013-03-15

First release. :seedling: