{"id":21697377,"url":"https://github.com/web3space/velas","last_synced_at":"2026-05-09T01:34:25.522Z","repository":{"id":41716696,"uuid":"239492228","full_name":"web3space/velas","owner":"web3space","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-29T05:36:34.000Z","size":7429,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-03-20T15:13:32.269Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web3space.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-10T11:09:21.000Z","updated_at":"2020-02-12T15:21:42.000Z","dependencies_parsed_at":"2022-08-10T11:46:24.569Z","dependency_job_id":null,"html_url":"https://github.com/web3space/velas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/web3space/velas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3space%2Fvelas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3space%2Fvelas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3space%2Fvelas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3space%2Fvelas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3space","download_url":"https://codeload.github.com/web3space/velas/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3space%2Fvelas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32804190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T19:25:21.436Z","updated_at":"2026-05-09T01:34:25.505Z","avatar_url":"https://github.com/web3space.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm Version](https://img.shields.io/npm/v/ganache-core.svg)](https://www.npmjs.com/package/ganache-core)\n[![npm Downloads](https://img.shields.io/npm/dm/ganache-core.svg)](https://www.npmjs.com/package/ganache-core)\n[![Build Status](https://travis-ci.org/trufflesuite/ganache-core.svg?branch=master)](https://travis-ci.org/trufflesuite/ganache-core)\n[![Coverage Status](https://coveralls.io/repos/github/trufflesuite/ganache-core/badge.svg?branch=develop)](https://coveralls.io/github/trufflesuite/ganache-core?branch=develop)\n# Ganache Core\n\nThis is the core code that powers the Ganache application and the Ganache command line tool.\n\n[Usage](#usage) | [Options](#options) | [Implemented Methods](#implemented-methods) | [Custom Methods](#custom-methods) | [Unsupported Methods](#unsupported-methods) | [Testing](#testing)\n\n## Installation\n\n`ganache-core` is written in JavaScript and distributed as a Node.js package via `npm`. Make sure you have Node.js (\u003e= v8.9.0) installed, and your environment is capable of installing and compiling `npm` modules.\n\n**macOS** Make sure you have the XCode Command Line Tools installed. These are needed in general to be able to compile most C based languages on your machine, as well as many npm modules.\n\n**Windows** See our [Windows install instructions](https://github.com/trufflesuite/ganache-cli/wiki/Installing-ganache-cli-on-Windows).\n\n**Ubuntu/Linux** Follow the basic instructions for installing [Node.js](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions) and make sure that you have `npm` installed, as well as the `build-essential` `apt` package (it supplies `make` which you will need to compile most things). Use the official Node.js packages, *do not use the package supplied by your distribution.*\n\nUsing npm:\n\n```Bash\nnpm install ganache-core\n```\n\nor, if you are using [Yarn](https://yarnpkg.com/):\n\n```Bash\nyarn add ganache-core\n```\n\n\n## Usage\n\nAs a [Web3](https://github.com/ethereum/web3.js/) provider:\n\n```javascript\nconst ganache = require(\"ganache-core\");\nconst web3 = new Web3(ganache.provider());\n```\nIf web3 is already initialized:\n```javascript\nconst ganache = require(\"ganache-core\");\nweb3.setProvider(ganache.provider());\n```\nNOTE: depending on your web3 version, you may need to set a number of confirmation blocks\n```javascript\nconst web3 = new Web3(provider, null, { transactionConfirmationBlocks: 1 });\n```\n\nAs an [ethers.js](https://github.com/ethers-io/ethers.js/) provider:\n\n```javascript\nconst ganache = require(\"ganache-core\");\nconst provider = new ethers.providers.Web3Provider(ganache.provider());\n```\n\nAs a general HTTP and WebSocket server:\n\n```javascript\nconst ganache = require(\"ganache-core\");\nconst server = ganache.server();\nconst provider = server.provider;\nserver.listen(port, function(err, blockchain) { ... });\n```\n\n## Options\n\nBoth `.provider()` and `.server()` take a single object which allows you to specify behavior of the Ganache instance. This parameter is optional. Available options are:\n\n* `\"accounts\"`: `Array` of `Object`'s. Each object should have a `balance` key with a hexadecimal value. The key `secretKey` can also be specified, which represents the account's private key. If no `secretKey`, the address is auto-generated with the given balance. If specified, the key is used to determine the account's address.\n* `\"debug\"`: `boolean` - Output VM opcodes for debugging\n* `\"blockTime\"`: `number` - Specify blockTime in seconds for automatic mining. If you don't specify this flag, ganache will instantly mine a new block for every transaction. Using the `blockTime` option is discouraged unless you have tests which require a specific mining interval.\n* `\"logger\"`: `Object` - Object, like `console`, that implements a `log()` function.\n* `\"mnemonic\"`: Use a specific HD wallet mnemonic to generate initial addresses.\n* `\"port\"`: `number` Port number to listen on when running as a server.\n* `\"seed\"`: Use arbitrary data to generate the HD wallet mnemonic to be used.\n* `\"default_balance_ether\"`: `number` - The default account balance, specified in ether.\n* `\"total_accounts\"`: `number` - Number of accounts to generate at startup.\n* `\"fork\"`: `string` or `object` - Fork from another currently running Ethereum client at a given block.  When a `string`, input should be the HTTP location and port of the other client, e.g. `http://localhost:8545`. You can optionally specify the block to fork from using an `@` sign: `http://localhost:8545@1599200`. Can also be a `Web3 Provider` object, optionally used in conjunction with the `fork_block_number` option below.\n* `\"fork_block_number\"`: `string` or `number` - Block number the provider should fork from, when the `fork` option is specified. If the `fork` option is specified as a string including the `@` sign and a block number, the block number in the `fork` parameter takes precedence.\n* `\"network_id\"`: Specify the network id ganache-core will use to identify itself (defaults to the current time or the network id of the forked blockchain if configured)\n* `\"time\"`: `Date` - Date that the first block should start. Use this feature, along with the `evm_increaseTime` method to test time-dependent code.\n* `\"locked\"`: `boolean` - whether or not accounts are locked by default.\n* `\"unlocked_accounts\"`: `Array` - array of addresses or address indexes specifying which accounts should be unlocked.\n* `\"db_path\"`: `String` - Specify a path to a directory to save the chain database. If a database already exists, `ganache-core` will initialize that chain instead of creating a new one. Note: You will not be able to modify state (accounts, balances, etc) on startup when you initialize ganache-core with a pre-existing database.\n* `\"db\"`: `Object` - Specify an alternative database instance, for instance [MemDOWN](https://github.com/level/memdown).\n* `\"ws\"`: `boolean` Enable a websocket server. This is `true` by default.\n* `\"account_keys_path\"`: `String` - Specifies a file to save accounts and private keys to, for testing.\n* `\"vmErrorsOnRPCResponse\"`: `boolean` - Whether or not to transmit transaction failures as RPC errors. Set to `false` for error reporting behaviour which is compatible with other clients such as geth and Parity. This is `true` by default to replicate the error reporting behavior of previous versions of ganache.\n* `\"hdPath\"`: The hierarchical deterministic path to use when generating accounts. Default: \"m/44'/60'/0'/0/\"\n* `\"hardfork\"`: `String` Allows users to specify which hardfork should be used. Supported hardforks are `byzantium`, `constantinople`, `petersburg`, `istanbul`, and `muirGlacier` (default).\n* `\"allowUnlimitedContractSize\"`: `boolean` - Allows unlimited contract sizes while debugging (NOTE: this setting is often used in conjuction with an increased `gasLimit`). By setting this to `true`, the check within the EVM for contract size limit of 24KB (see [EIP-170](https://git.io/vxZkK)) is bypassed. Setting this to `true` **will** cause `ganache-core` to behave differently than production environments. (default: `false`; **ONLY** set to `true` during debugging).\n* `\"gasPrice\"`: `String::hex` Sets the default gas price for transactions if not otherwise specified. Must be specified as a `hex` encoded string in `wei`. Defaults to `\"0x77359400\"` (2 `gwei`).\n* `\"gasLimit\"`: `String::hex | number` Sets the block gas limit. Must be specified as a `hex` string or `number`(integer). Defaults to `\"0x6691b7\"`.\n* `\"callGasLimit\"`: `number` Sets the transaction gas limit for `eth_call` and `eth_estimateGas` calls. Must be specified as a `hex` string. Defaults to `\"0x1fffffffffffff\"` (`Number.MAX_SAFE_INTEGER`).\n* `\"keepAliveTimeout\"`:  `number` If using `.server()` - Sets the HTTP server's `keepAliveTimeout` in milliseconds. See the [NodeJS HTTP docs](https://nodejs.org/api/http.html#http_server_keepalivetimeout) for details. `5000` by default.\n\n## Implemented Methods\n\nThe RPC methods currently implemented are:\n\n* [eth_accounts](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_accounts)\n* [eth_blockNumber](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_blockNumber)\n* [eth_call](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_call)\n* `eth_chainId`\n* [eth_coinbase](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_coinbase)\n* [eth_estimateGas](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_estimateGas)\n* [eth_gasPrice](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gasPrice)\n* [eth_getBalance](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getBalance)\n* [eth_getBlockByNumber](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getBlockByNumber)\n* [eth_getBlockByHash](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getBlockByHash)\n* [eth_getBlockTransactionCountByHash](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getBlockTransactionCountByHash)\n* [eth_getBlockTransactionCountByNumber](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getBlockTransactionCountByNumber)\n* [eth_getCode](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getCode)\n* [eth_getCompilers](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getCompilers)\n* [eth_getFilterChanges](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getFilterChanges)\n* [eth_getFilterLogs](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getFilterLogs)\n* [eth_getLogs](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getLogs)\n* [eth_getStorageAt](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getStorageAt)\n* [eth_getTransactionByHash](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getTransactionByHash)\n* [eth_getTransactionByBlockHashAndIndex](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getTransactionByBlockHashAndIndex)\n* [eth_getTransactionByBlockNumberAndIndex](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getTransactionByBlockNumberAndIndex)\n* [eth_getTransactionCount](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getTransactionCount)\n* [eth_getTransactionReceipt](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_getTransactionReceipt)\n* [eth_hashrate](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_hashrate)\n* [eth_mining](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_mining)\n* [eth_newBlockFilter](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_newBlockFilter)\n* [eth_newFilter](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_newFilter)\n* [eth_protocolVersion](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_protocolVersion)\n* [eth_sendTransaction](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendTransaction)\n* [eth_sendRawTransaction](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendRawTransaction)\n* [eth_sign](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign)\n* `eth_signTypedData`\n* [eth_subscribe](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_subscribe)\n* [eth_unsubscribe](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_unsubscribe)\n* [shh_version](https://github.com/ethereum/wiki/wiki/JSON-RPC#shh_version)\n* [net_version](https://github.com/ethereum/wiki/wiki/JSON-RPC#net_version)\n* [net_peerCount](https://github.com/ethereum/wiki/wiki/JSON-RPC#net_peerCount)\n* [net_listening](https://github.com/ethereum/wiki/wiki/JSON-RPC#net_listening)\n* [eth_uninstallFilter](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_uninstallFilter)\n* [eth_syncing](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_syncing)\n* [web3_clientVersion](https://github.com/ethereum/wiki/wiki/JSON-RPC#web3_clientVersion)\n* [web3_sha3](https://github.com/ethereum/wiki/wiki/JSON-RPC#web3_sha3)\n* `bzz_hive`\n* `bzz_info`\n\n#### Management API Methods\n\n* [debug_traceTransaction](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#debug_tracetransaction)\n* [miner_start](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#miner_start)\n* [miner_stop](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#miner_stop)\n* [personal_sendTransaction](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sendTransaction)\n* [personal_unlockAccount](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_unlockAccount)\n* [personal_importRawKey](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_importRawKey)\n* [personal_newAccount](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_newAccount)\n* [personal_lockAccount](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_lockAccount)\n* [personal_listAccounts](https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_listaccounts)\n\n## Custom Methods\n\nSpecial non-standard methods that aren’t included within the original RPC specification:\n* `evm_snapshot` : Snapshot the state of the blockchain at the current block. Takes no parameters. Returns the integer id of the snapshot created. A snapshot can only be used once. After a successful `evm_revert`, the same snapshot id cannot be used again. Consider creating a new snapshot after each `evm_revert` *if you need to revert to the same point multiple times*.\n  ```bash\n  curl -H \"Content-Type: application/json\" -X POST --data \\\n          '{\"id\":1337,\"jsonrpc\":\"2.0\",\"method\":\"evm_snapshot\",\"params\":[]}' \\\n          http://localhost:8545\n  ```\n  ```json\n  { \"id\": 1337, \"jsonrpc\": \"2.0\", \"result\": \"0x1\" }\n  ```\n* `evm_revert` : Revert the state of the blockchain to a previous snapshot. Takes a single parameter, which is the snapshot id to revert to. This deletes the given snapshot, as well as any snapshots taken after (Ex: reverting to id `0x1` will delete snapshots with ids `0x1`, `0x2`, `etc`...  If no snapshot id is passed it will revert to the latest snapshot. Returns `true`.\n  ```bash\n  # Ex: ID \"1\" (hex encoded string)\n  curl -H \"Content-Type: application/json\" -X POST --data \\\n          '{\"id\":1337,\"jsonrpc\":\"2.0\",\"method\":\"evm_revert\",\"params\":[\"0x1\"]}' \\\n          http://localhost:8545\n  ```\n  ```json\n  { \"id\": 1337, \"jsonrpc\": \"2.0\", \"result\": true }\n  ```\n* `evm_increaseTime` : Jump forward in time. Takes one parameter, which is the amount of time to increase in seconds. Returns the total time adjustment, in seconds.\n  ```bash\n  # Ex: 1 minute (number)\n  curl -H \"Content-Type: application/json\" -X POST --data \\\n          '{\"id\":1337,\"jsonrpc\":\"2.0\",\"method\":\"evm_increaseTime\",\"params\":[60]}' \\\n          http://localhost:8545\n  ```\n  ```json\n  { \"id\": 1337, \"jsonrpc\": \"2.0\", \"result\": \"060\" }\n  ```\n* `evm_mine` : Force a block to be mined (independent of mining status: started | stopped). Takes one **optional** parameter, which is the timestamp a block should setup as the mining time. NOTE: the timestamp parameter should be specified in `seconds`. In JavaScript you would calculate it like this: `Math.floor(Date.now() / 1000);`\n  ```bash\n  # Ex: new Date(\"2009-01-03T18:15:05+00:00\").getTime()\n  curl -H \"Content-Type: application/json\" -X POST --data \\\n          '{\"id\":1337,\"jsonrpc\":\"2.0\",\"method\":\"evm_mine\",\"params\":[1231006505000]}' \\\n          http://localhost:8545\n  ```\n\n  ```json\n  { \"id\": 1337, \"jsonrpc\": \"2.0\", \"result\": \"0x0\" }\n  ```\n\n## Unsupported Methods\n\n* `eth_compileSolidity`: If you'd like Solidity compilation in Javascript, please see the [solc-js project](https://github.com/ethereum/solc-js).\n\n\n## Testing\n\nRun tests via:\n\n```\n$ npm test\n```\n\n## License\n[MIT](https://tldrlegal.com/license/mit-license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3space%2Fvelas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3space%2Fvelas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3space%2Fvelas/lists"}