Giter Site home page Giter Site logo

trufflesuite / ganache-cli-archive Goto Github PK

View Code? Open in Web Editor NEW
3.4K 120.0 695.0 8.75 MB

Fast Ethereum RPC client for testing and development. See https://github.com/trufflesuite/ganache for current development.

Home Page: https://www.trufflesuite.com/ganache

License: MIT License

JavaScript 96.44% Dockerfile 3.56%

ganache-cli-archive's Introduction

NOTICE: ganache-cli has moved to ganache


npm npm Build Status

Welcome to Ganache CLI

Ganache CLI, part of the Truffle suite of Ethereum development tools, is the command line version of Ganache, your personal blockchain for Ethereum development.

Ganache CLI uses ethereumjs to simulate full client behavior and make developing Ethereum applications faster, easier, and safer. It also includes all popular RPC functions and features (like events) and can be run deterministically to make development a breeze.

Looking for TestRPC?

If you came here expecting to find the TestRPC, you're in the right place! Truffle has taken the TestRPC under its wing and made it part of the Truffle suite of tools. From now on you can expect better support along with tons of new features that help make Ethereum development safer, easier, and more enjoyable. Use ganache-cli just as you would testrpc.

Installation

ganache-cli is written in JavaScript and distributed as a Node.js package via npm. Make sure you have Node.js (>= v8) installed.

Using npm:

npm install -g ganache-cli

or, if you are using Yarn:

yarn global add ganache-cli

ganache-cli utilizes ganache-core internally, which is distributed with optional native dependencies for increased performance. If these native dependencies fail to install on your system ganache-cli will automatically fallback to ganache-core’s pre-bundled JavaScript build.

Having problems? Be sure to check out the FAQ and if you're still having issues and you're sure its a problem with ganache-cli please open an issue.

Using Ganache CLI

Command Line

$ ganache-cli <options>

Options:

  • -a or --accounts: Specify the number of accounts to generate at startup.
  • -e or --defaultBalanceEther: Amount of ether to assign each test account. Default is 100.
  • -b or --blockTime: 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 flag is discouraged unless you have tests which require a specific mining interval.
  • -d or --deterministic: Generate deterministic addresses based on a pre-defined mnemonic.
  • -n or --secure: Lock available accounts by default (good for third party transaction signing)
  • -m or --mnemonic: Use a bip39 mnemonic phrase for generating a PRNG seed, which is in turn used for hierarchical deterministic (HD) account generation.
  • -p or --port: Port number to listen on. Defaults to 8545.
  • -h or --host or --hostname: Hostname to listen on. Defaults to 127.0.0.1 (defaults to 0.0.0.0 for Docker instances of ganache-cli).
  • -s or --seed: Use arbitrary data to generate the HD wallet mnemonic to be used.
  • -g or --gasPrice: The price of gas in wei (defaults to 20000000000)
  • -l or --gasLimit: The block gas limit (defaults to 0x6691b7)
  • --callGasLimit: 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)
  • -k or --hardfork: Allows users to specify which hardfork should be used. Supported hardforks are byzantium, constantinople, petersburg, istanbul, and muirGlacier (default).
  • -f or --fork: Fork from another currently running Ethereum client at a given block. 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.
  • forkCacheSize: number - The maximum size, in bytes, of the in-memory cache for queries on a chain fork. Defaults to 1_073_741_824 bytes (1 gigabyte). You can set this to 0 to disable caching (not recommended), or to -1 for unlimited (will be limited by your node process).
  • -i or --networkId: Specify the network id ganache-cli will use to identify itself (defaults to the current time or the network id of the forked blockchain if configured)
  • --chainId: Specify the Chain ID ganache-cli will use for eth_chainId RPC and the CHAINID opcode. For legacy reasons, the default is currently 1337 for eth_chainId RPC and 1 for the CHAINID opcode. Setting this flag will align the chainId values. This will be fixed in the next major version of ganache-cli and ganache-core!
  • --db: Specify a path to a directory to save the chain database. If a database already exists, ganache-cli will initialize that chain instead of creating a new one.
  • --debug: Output VM opcodes for debugging
  • --mem: Output ganache-cli memory usage statistics. This replaces normal output.
  • -q or --quiet: Run ganache-cli without any logs.
  • -v or --verbose: Log all requests and responses to stdout
  • -? or --help: Display help information
  • --version: Display the version of ganache-cli
  • --account_keys_path or --acctKeys: Specifies a file to save accounts and private keys to, for testing.
  • --noVMErrorsOnRPCResponse: Do not transmit transaction failures as RPC errors. Enable this flag for error reporting behaviour which is compatible with other clients such as geth and Parity.
  • --allowUnlimitedContractSize: Allows unlimited contract sizes while debugging. By enabling this flag, the check within the EVM for contract size limit of 24KB (see EIP-170) is bypassed. Enabling this flag will cause ganache-cli to behave differently than production environments.
  • --keepAliveTimeout: Sets the HTTP server's keepAliveTimeout in milliseconds. See the NodeJS HTTP docs for details. 5000 by default.
  • -t or --time: Date (ISO 8601) that the first block should start. Use this feature, along with the evm_increaseTime method to test time-dependent code.

Special Options:

  • --account: Specify --account=... (no 's') any number of times passing arbitrary private keys and their associated balances to generate initial addresses:

    $ ganache-cli --account="<privatekey>,balance" [--account="<privatekey>,balance"]
    

    Note that private keys are 64 characters long, and must be input as a 0x-prefixed hex string. Balance can either be input as an integer or 0x-prefixed hex value specifying the amount of wei in that account.

    An HD wallet will not be created for you when using --account.

  • -u or --unlock: Specify --unlock ... any number of times passing either an address or an account index to unlock specific accounts. When used in conjunction with --secure, --unlock will override the locked state of specified accounts.

    $ ganache-cli --secure --unlock "0x1234..." --unlock "0xabcd..."
    

    You can also specify a number, unlocking accounts by their index:

    $ ganache-cli --secure -u 0 -u 1
    

    This feature can also be used to impersonate accounts and unlock addresses you wouldn't otherwise have access to. When used with the --fork feature, you can use ganache-cli to make transactions as any address on the blockchain, which is very useful for testing and dynamic analysis.

Usage

As a Web3 provider:

const ganache = require("ganache-core");
const web3 = new Web3(ganache.provider());

If web3 is already initialized:

const ganache = require("ganache-core");
web3.setProvider(ganache.provider());

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

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

As an ethers.js provider:

const ganache = require("ganache-cli");
const provider = new ethers.providers.Web3Provider(ganache.provider());

As a general HTTP and WebSocket server:

const ganache = require("ganache-cli");
const server = ganache.server();
server.listen(port, function(err, blockchain) {...});

Options

Both .provider() and .server() take a single object which allows you to specify behavior of ganache-cli. This parameter is optional. Available options are:

  • "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.
  • "debug": boolean - Output VM opcodes for debugging
  • "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.
  • "logger": Object - Object, like console, that implements a log() function.
  • "mnemonic": Use a specific HD wallet mnemonic to generate initial addresses.
  • "port": number Port number to listen on when running as a server.
  • "seed": Use arbitrary data to generate the HD wallet mnemonic to be used.
  • "default_balance_ether": number - The default account balance, specified in ether.
  • "total_accounts": number - Number of accounts to generate at startup.
  • "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.
  • "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. forkCacheSize: number - The maximum size, in bytes, of the in-memory cache for queries on a chain fork. Defaults to 1_073_741_824 bytes (1 gigabyte). You can set this to 0 to disable caching (not recommended), or to -1 for unlimited (will be limited by your node/browser process).
  • "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)
  • "time": Date - Date that the first block should start. Use this feature, along with the evm_increaseTime method to test time-dependent code.
  • "locked": boolean - whether or not accounts are locked by default.
  • "unlocked_accounts": Array - array of addresses or address indexes specifying which accounts should be unlocked.
  • "db_path": String - Specify a path to a directory to save the chain database. If a database already exists, ganache-cli 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.
  • "db": Object - Specify an alternative database instance, for instance MemDOWN.
  • "ws": boolean Enable a websocket server. This is true by default.
  • "account_keys_path": String - Specifies a file to save accounts and private keys to, for testing.
  • "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.
  • "hdPath": The hierarchical deterministic path to use when generating accounts. Default: "m/44'/60'/0'/0/"
  • "hardfork": String Allows users to specify which hardfork should be used. Supported hardforks are byzantium, constantinople, petersburg, istanbul, and muirGlacier (default).
  • "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) is bypassed. Setting this to true will cause ganache-cli to behave differently than production environments. (default: false; ONLY set to true during debugging).
  • "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).
  • "gasLimit": String::hex | number Sets the block gas limit. Must be specified as a hex string or number. Defaults to "0x6691b7".
  • "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).
  • "keepAliveTimeout": number If using .server() - Sets the HTTP server's keepAliveTimeout in milliseconds. See the NodeJS HTTP docs for details. 5000 by default.

Implemented Methods

The RPC methods currently implemented are:

Management API Methods

Custom Methods

Special non-standard methods that aren’t included within the original RPC specification:

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

    curl -H "Content-Type: application/json" -X POST --data \
            '{"id":1337,"jsonrpc":"2.0","method":"evm_snapshot","params":[]}' \
            http://localhost:8545
    { "id": 1337, "jsonrpc": "2.0", "result": "0x1" }
  • 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.

    # Ex: ID "1" (hex encoded string)
    curl -H "Content-Type: application/json" -X POST --data \
            '{"id":1337,"jsonrpc":"2.0","method":"evm_revert","params":["0x1"]}' \
            http://localhost:8545
    { "id": 1337, "jsonrpc": "2.0", "result": true }
  • 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.

    # Ex: 1 minute (number)
    curl -H "Content-Type: application/json" -X POST --data \
            '{"id":1337,"jsonrpc":"2.0","method":"evm_increaseTime","params":[60]}' \
            http://localhost:8545
    { "id": 1337, "jsonrpc": "2.0", "result": "060" }
  • evm_mine : Force a block to be mined. Takes one optional parameter, which is the timestamp a block should setup as the mining time. Mines a block independent of whether or not mining is started or stopped.

    # Ex: new Date("2009-01-03T18:15:05+00:00").getTime()
    curl -H "Content-Type: application/json" -X POST --data \
            '{"id":1337,"jsonrpc":"2.0","method":"evm_mine","params":[1231006505000]}' \
            http://localhost:8545
    { "id": 1337, "jsonrpc": "2.0", "result": "0x0" }
  • evm_unlockUnknownAccount : Unlocks any unknown account. Accounts known to the personal namespace and accounts returned by eth_accounts cannot be unlocked using this method; use personal_unlockAccount instead.

    # Ex: account: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
    curl -H "Content-Type: application/json" -X POST --data \
            '{"id":1337,"jsonrpc":"2.0","method":"evm_unlockUnknownAccount","params":["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"]}' \
            http://localhost:8545
    { "id": 1337, "jsonrpc": "2.0", "result": true }
  • evm_lockUnknownAccount : Locks any unknown account. Accounts known to the personal namespace and accounts returned by eth_accounts cannot be locked using this method; use personal_lockAccount instead.

    # Ex: account: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
    curl -H "Content-Type: application/json" -X POST --data \
            '{"id":1337,"jsonrpc":"2.0","method":"evm_lockUnknownAccount","params":["0x742d35Cc6634C0532925a3b844Bc454e4438f44e"]}' \
            http://localhost:8545
    { "id": 1337, "jsonrpc": "2.0", "result": true }

Unsupported Methods

  • eth_compileSolidity: If you'd like Solidity compilation in Javascript, please see the solc-js project.

Docker

The Simplest way to get started with the Docker image:

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

To pass options to ganache-cli through Docker simply add the arguments to the run command:

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

The Docker container adds an environment variable DOCKER=true; when this variable is set to true (case insensitive), ganache-cli use 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-cli:latest --host XXX.XXX.XXX.XXX
                                                                        ^^^^^^^^^^^^^^^^^^^^^^

To build and run the Docker container from source:

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

then:

docker build --tag trufflesuite/ganache-cli .
docker run --publish 8545:8545 trufflesuite/ganache-cli

or

npm run docker

Contributing to Ganache CLI

The Ganache CLI repository contains the cli logic and Docker config/build only. It utilizes ganache-core, the core logic powering Ganache, internally.

You can contribute to the core code at ganache-core.

To contribue to ganache-cli, run:

git clone https://github.com/trufflesuite/ganache-cli.git && cd ganache-cli
npm install

You'll need Python 2.7 installed, and on Windows, you'll likely need to install windows-build-tools from an Administrator PowerShell Prompt via npm install --global windows-build-tools.

PR Message format:

<type>(<scope>): <subject>

Where type must be one of the following:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation

see: https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines

License

MIT

ganache-cli-archive's People

Contributors

0xcaff avatar aakilfernandes avatar area avatar axic avatar benjamincburns avatar cgewecke avatar ckeenan avatar conroydamien avatar davidmurdoch avatar funkym avatar iurimatias avatar johnmcdowall avatar kojinkai avatar kumavis avatar logvinovleon avatar mattkanwisher avatar micahzoltu avatar mikeislearning avatar mikeseese avatar mpolci avatar mrchico avatar nebojsa94 avatar nicholasjpaterno avatar roderik avatar roppa avatar semantic-release-bot avatar simondlr avatar tcoulter avatar yusefnapora avatar zhouer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ganache-cli-archive's Issues

Unable to install testrpc in Windows 2012 R2

Hi,
I am trying to install ethereumjs-testrpc in Windows 2012 R2 64-bit OS machine and getting the following error, any help will be greatly appreciated. The PATH env variable has git, python etc. 2.7.11 is the python version that I got from anaconda.
Thanks,

--------- ERROR ---------------------------
24837 verbose lifecycle [email protected]install: CWD: C:\Users\119078\AppData\Roaming\npm\node_modules\ethereumjs-testrpc\node_modules\secp256k1
24838 silly lifecycle [email protected]
install: Args: [ '/d /s /c', 'npm run rebuild' ]
24839 silly lifecycle [email protected]install: Returned: code: 1 signal: null
24840 info lifecycle [email protected]
install: Failed to exec install script
24841 verbose unlock done using C:\Users\119078\AppData\Roaming\npm-cache_locks\staging-179b54b46d2bd924.lock for C:\Users\119078\AppData\Roaming\npm\node_modules.staging
24842 silly rollbackFailedOptional Starting
24843 silly rollbackFailedOptional Finishing
24844 silly runTopLevelLifecycles Starting
24845 silly runTopLevelLifecycles Finishing
24846 silly install printInstalled
24847 verbose stack Error: [email protected] install: npm run rebuild
24847 verbose stack Exit status 1
24847 verbose stack at EventEmitter. (C:\Users\119078\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:239:16)
24847 verbose stack at emitTwo (events.js:100:13)
24847 verbose stack at EventEmitter.emit (events.js:185:7)
24847 verbose stack at ChildProcess. (C:\Users\119078\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:24:14)
24847 verbose stack at emitTwo (events.js:100:13)
24847 verbose stack at ChildProcess.emit (events.js:185:7)
24847 verbose stack at maybeClose (internal/child_process.js:850:16)
24847 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
24848 verbose pkgid [email protected]
24849 verbose cwd C:\Users\119078
24850 error Windows_NT 6.3.9600

2.0.1 broken

See the following tracebacks. Probably comes from recent merge from eth-lightwallet. Downgrading to 2.0.0 fixes the issue.

Austins-MBP:MountainOfMoney Gross$ testrpc
/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/node_modules/tweetnacl/nacl-fast.js:2152
       throw new TypeError('unexpected type ' + t + ', use Uint8Array');
             ^
TypeError: unexpected type [object Object], use Uint8Array
    at checkArrayTypes (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/node_modules/tweetnacl/nacl-fast.js:2152:14)
    at Object.nacl.secretbox (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/node_modules/tweetnacl/nacl-fast.js:2201:3)
    at Function.KeyStore._encryptString (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/lib/keystore.js:113:21)
    at new KeyStore (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/lib/keystore.js:91:29)
    at new Blockchain (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:45:19)
    at new Manager (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/manager.js:14:21)
    at Object.Server.provider (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/server.js:153:19)
    at Object.Server.server (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/server.js:23:25)
    at Object.TestRPC.server (/usr/local/lib/node_modules/ethereumjs-testrpc/index.js:23:26)
    at Object.<anonymous> (/usr/local/lib/node_modules/ethereumjs-testrpc/bin/testrpc:42:22)
Austins-MBP:ethereumjs-testrpc Gross$ npm test

> [email protected] test /usr/local/lib/node_modules/ethereumjs-testrpc
> mocha ./test/**/*.js

/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/node_modules/tweetnacl/nacl-fast.js:2152
       throw new TypeError('unexpected type ' + t + ', use Uint8Array');
             ^
TypeError: unexpected type [object Object], use Uint8Array
    at checkArrayTypes (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/node_modules/tweetnacl/nacl-fast.js:2152:14)
    at Object.nacl.secretbox (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/node_modules/tweetnacl/nacl-fast.js:2201:3)
    at Function.KeyStore._encryptString (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/lib/keystore.js:113:21)
    at new KeyStore (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/lib/keystore.js:91:29)
    at new Blockchain (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:45:19)
    at new Manager (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/manager.js:14:21)
    at Object.Server.provider (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/server.js:153:19)
    at Object.TestRPC.provider (/usr/local/lib/node_modules/ethereumjs-testrpc/index.js:27:28)
    at Suite.<anonymous> (/usr/local/lib/node_modules/ethereumjs-testrpc/test/requests.js:507:28)
    at context.describe.context.context (/usr/local/lib/node_modules/mocha/lib/interfaces/bdd.js:47:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/ethereumjs-testrpc/test/requests.js:505:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at /usr/local/lib/node_modules/mocha/lib/mocha.js:219:27
    at Array.forEach (native)
    at Mocha.loadFiles (/usr/local/lib/node_modules/mocha/lib/mocha.js:216:14)
    at Mocha.run (/usr/local/lib/node_modules/mocha/lib/mocha.js:468:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/mocha/bin/_mocha:403:18)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
npm ERR! Test failed.  See above for more details.

Intermittent failure when running truffle tests

I have two very similar tests for a pair of contracts that, when run using truffle, one of them intermittently fails. I have a MWE at https://github.com/area/testrpc_bug_reproduce

The tests 'never' fail (I looped them for an hour with no failures) when using the python based eth-testrpc, which is why I'm reporting this as a bug in testrpc rather than truffle.

Everything I've seen points to there being some sort of race condition, unfortunately.

  • Intermittent
  • More attempts are required to fail on lower-powered machines where the tests take longer.

I have put the output when using truffle test --verbose-rpc at https://gist.github.com/area/82654cad5db14932c48f for a passing pair of tests and then a run where the intermittent test fails.

EDIT: I've realised that I have the order of the tests reversed in that gist. https://gist.github.com/area/e67899bc16f61468231f has the output from the tests in the same order as they appear in the repository.

Valid estimateGas call crashes testrpc

I've been trying to use the newly released version of testrpc, but the behaviour of estimateGas has changed with the release compared to my original pull request. When an address without enough balance to fund the transaction tries to estimate the gas, testrpc crashes:

        var result = ethUtil.addHexPrefix(results.gasUsed.toString('hex'))
                                                         ^

TypeError: Cannot read property 'toString' of undefined
    at <snip>/testrpc/node_modules/web3-provider-engine/subproviders/vm.js:56:58

The value of results is:

{ error: [Error: sender doesn't have enough funds to send tx. The upfront cost is: 3141592 and the senders account only has: 0] }

In geth (which I am using as the arbiter of 'valid'), the call succeeds. It seems this is due to offloading the handling of estimateGas and ethCall into web3-provider-engine.

Further digging while writing this issue appears to suggest you are probably already aware of this (I presume you're the tim in ethereumjs/ethereumjs-monorepo#41, which is certainly related) but I've opened this anyway in case you're not aware of the crashing side of it.

Events don't work

I get the following error in a web3 watch() callback for an solidity event, where I'm listening on a specific event. The code works on geth.

[Error: Method not found]

I read in other in other simulators that events aren't supported but it doesn't say so explicitly in the README here.

If events aren't supported, what's the alternative to getting transaction logs? It appears that web3's default log gathering capability is via events.

slow contract setup

have a contract deployment setup which takes about 20s with ethereumjs-testrpc but <1s with eth-testrpc
it basically chains 6 contracts by doing

Foo.new(...).then(function(newFoo) { return Bar.new(newFoo.address).then(function(newBar) { ...

I'm guessing there's one block between each deployment, but not sure why it's so much slower with ethereumjs-testrpc
wondering if I'm using promises incorrectly and there's a way to deploy all contracts sequentially in one block

Add `net_version` method.

Over at Metamask, we're adding a feature to provide blockchain-explorer links for transactions.

To do this intelligently, we have to check what blockchain we're on.

The net_version method lets a web3 client ask what blockchain version is being used. Main net returns 1, the morden test-net returns 2, and testrpc throws an error:

├─ id: 1
├─ jsonrpc: 2.0
└─ error
   ├─ message: Error: RPC method net_version not supported.

I think it would be cool to support this method, and just return something, like maybe a large random number, or maybe the string testrpc. Something useful.

Thoughts?

Run testrpc on 0.0.0.0 rather than localhost

Is there a way to run testrpc on 0.0.0.0 rather than localhost? I'm running the testrpc server on a docker container and would like to link it to another docker container. Thanks!

mining disabled

Hi,

I did not find any way to enable mining and mining is disabled by default:

$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_hashrate","params":[],"id":71}'  http://127.0.0.1:8545
{"id":71,"jsonrpc":"2.0","result":"0x0"}

How can one enable mining ?

Regards,

testrpc 2.0.0 - cannot find module 'memdown'

Trying to get testrpc (2.0.0) working on an ubuntu virtualbox, and getting this error when I run it:

mowliv@u4:~$ testrpc
module.js:341
    throw err;
    ^

Error: Cannot find module 'memdown'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/merkle-patricia-tree/baseTrie.js:3:17)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)

Have tried npm update -g and sudo npm install -g memdown but those didn't help. Maybe I'm being bitten by a major new (2.0.0) release?

Add flag to run in unauthenticated mode

Some users developing for clients (like MetaMask) that do the transaction signing have run into the confusing situation that they can either ask MetaMask to sign a transaction, OR just submit the transaction, which succeeds on TestRPC, since it runs in authenticated mode.

It would be nice to disable the authenticated accounts, so devs can enforce that they're correctly signing code.

Feature request: Mine a chosen amount blocks per transaction.

Some dapps watch for a certain amount of blocks before accepting a transaction as finalised.

Would be useful to have a feature/setting to allow testrpc to mine a certain amount of blocks for each tx. And set it upon running it. Something like:

testrpc --blockspertx 10

Wrong Blockhash in transaction receipt

I created a transaction by calling a function in a contract. The contract function writes an event. All these were done from web3 against TestRPC running at localhost. After the transaction is added to network, I call the following :
web3.eth.getTransactionReceipt(tx, function (err,objTx) {
if (objTx != null) {
console.log(objTx.log);
}
})
It returns the receipt with the event data in the log. But the blockhas in the transation receipt and the blockhash inside the log is different. Should be same.

blockHash: "0x4a9cfaee8eb83857eac751ec87b529a1557fdbaf7e665cf19267da1593ef9daa"
blockNumber: 60
contractAddress: null
cumulativeGasUsed: 182322
gasUsed: 182322
logs: Array[1]
0: Object
address: "0x4c5a0ef079f1b71227e3281f7e735e9261523e26"
blockHash: "0x9af250903bb2431be098e4bd77c1146730a8882d1801f298385a360f0c4c8d24"
blockNumber: 60
data: "0x000000000000000000000000083ce37b3f31d51821a3996ae4d4cad87635774200000000000000000000000000000000000000000000000000000000000001bc0000000000000000000000000000000000000000000000000000000000000036"
logIndex: 0
topics: Array[1]
transactionHash: "0x6b1790ade62f1213ccef43395dab3c6c897e6a73f71b2ecd71f9f8906f62b472"
transactionIndex: 0
type: "mined"
proto: Object
length: 1
proto: Array[0]
transactionHash: "0x6b1790ade62f1213ccef43395dab3c6c897e6a73f71b2ecd71f9f8906f62b472"
transactionIndex: 0

Feature: Use HD wallet

TODO:

  • allow -m/--mnemonic to input an HD wallet mnemonic
  • print out private keys
  • print out mnemonic
  • -d option uses a default mnemonic instead of default seed
  • Finally, create accounts through the HD wallet rather than generating them randomly like we do now.

Sample code provided by @axic:

const bip39 = require('bip39')
const hdkey = require('ethereumjs-wallet/hdkey')

var mnemonic = 'awake book subject inch gentle blur grant damage process float month clown'
var wallet = hdkey.fromMasterSeed(bip39.mnemonicToSeed(mnemonic)

var account = wallet.derivePath("m/44'/60'/0'/0/" + index) // index is a number
var address = account.getWallet().getAddressString() // 0x prefixed String
var publicKey = account.getWallet().getPublicKey() // Buffer
var secretkey = account.getWallet().getPrivateKey() // Buffer

Problem with the installation of the latest build

I have an issue when I try to install the latest build on windows using the latest version of node.js v5.6.0
it failed t the [email protected] install script 'npm run rebuild'
please find attached the log
I use the following version of node.js and rpm
node v5.6.0
npm v3.7.3

I am very new here so my error might be quite simple to resolve
thanks

npm-debug.txt

Behaviour on throw differs from geth

testrpc and geth behave in very different ways when encountering a throw in a contract, which is making writing tests that check invalid calls to contracts are correctly prevented in truffle difficult.

testrpc throws an error:

[Error: Error: VM Exception while executing transaction: invalid JUMP
    at /Users/user/.node/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:471:18
    at Object.async.eachSeries (/Users/user/.node/lib/node_modules/ethereumjs-testrpc/node_modules/async-eventemitter/node_modules/async/lib/async.js:130:20)
    at VM.AsyncEventEmitter.emit (/Users/user/.node/lib/node_modules/ethereumjs-testrpc/node_modules/async-eventemitter/lib/AsyncEventEmitter.js:42:9)
    at afterBlock (/Users/user/.node/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/runBlock.js:55:10)
    at /Users/user/.node/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/runBlock.js:179:9
    at /Users/user/.node/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/cache.js:137:7
    at /Users/user/.node/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:52:16
    at iterate (/Users/user/.node/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:260:24)
    at Object.async.forEachOfSeries.async.eachOfSeries (/Users/user/.node/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:281:9)
    at Object.async.forEachSeries.async.eachSeries (/Users/user/.node/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:214:22)]

throw is indeed meant to create an invalid jump error, but it should still create a transaction without erroring as geth does. From https://www.ethereum.org/token :

'throw' will cancel all contract execution, revert any changes that transaction could have made and the sender will lose all ether he sent on gas.

In order to get tests to pass in both testrpc and geth, currently a special catch in the promise chain is required deal with the possibility the tests might be running on testrpc. I does seem to be true that testrpc correctly spends all the gas bought by the key making the transaction - it's just throwing the VM error all the way up.

I can't figure out what the lines https://github.com/ethereumjs/testrpc/blob/master/lib/blockchain.js#L469-L473 are meant to be doing. I don't think an error should be thrown here, ultimately - a VM exception still produces a 'valid' transaction, right? Removing these lines gives me the behaviour I'd expect to see, I think, but there are no tests for 'invalid' transactions, so I'm certainly hesitant to do anything about it without properly understanding what's going on. I feel like I'm way out of my depth here...(!)

how to use evm_snapshot

Hi, I have tried to use evm_snapshot using

server.provider.manager.evm_snapshot(function(err,snapshotId){...});

but I get some error in web3 in the test using snapsho and revert.

I am not sure I am using it correctly

I initialise testrpc this way (in mocha code):

var TestRPC = require("ethereumjs-testrpc");
var server = TestRPC.server();
before(function(done){
    server.listen(8545, function() {
        web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));
        done();
    });
})

the only test that fail is the one using the snapshot feature. any help woudl be appreciated
Thanks

please improve install instructions for ubuntu user

Tried to install using sudo npm install -g ethereumjs-testrpc (after first installing npm on ubuntu), and it failed with below errors. Please advise - thanks.

[email protected] rebuild /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-util/node_modules/secp256k1
node-gyp rebuild

npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/elliptic
npm http 304 https://registry.npmjs.org/bn.js
npm http 304 https://registry.npmjs.org/drbg.js
npm http 304 https://registry.npmjs.org/nan
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 4.2.0-34-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-util/node_modules/secp256k1
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/secp256k1/node_modules/nan'
npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir '/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/secp256k1/node_modules/nan']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/secp256k1/node_modules/nan' }
npm ERR! weird error 1
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/secp256k1/node_modules/elliptic/lib/elliptic/curve/edwards.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 4.2.0-34-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "ethereumjs-testrpc"
npm ERR! cwd /home/michael
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/secp256k1/node_modules/elliptic/lib/elliptic/curve/edwards.js
npm ERR! fstream_path /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/secp256k1/node_modules/elliptic/lib/elliptic/curve/edwards.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/secp256k1/node_modules/bn.js/lib/bn.js'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 4.2.0-34-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "ethereumjs-testrpc"
npm ERR! cwd /home/michael
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/secp256k1/node_modules/bn.js/lib/bn.js
npm ERR! fstream_path /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/secp256k1/node_modules/bn.js/lib/bn.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat '/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/aes-js/~/.grip/style-cache/github2-27099ff875724b3da49fac6911968f783aa96ed08970c77185d963ce6c21af75.css'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 4.2.0-34-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "ethereumjs-testrpc"
npm ERR! cwd /home/michael
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/aes-js//.grip/style-cache/github2-27099ff875724b3da49fac6911968f783aa96ed08970c77185d963ce6c21af75.css
npm ERR! fstream_path /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/aes-js/
/.grip/style-cache/github2-27099ff875724b3da49fac6911968f783aa96ed08970c77185d963ce6c21af75.css
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! tar pack Error reading /home/michael/tmp/npm-8718-BCqEhiQ4/1459746703831-0.9252500941511244/package
npm ERR! addLocalDirectory Could not pack "/home/michael/tmp/npm-8718-BCqEhiQ4/1459746703831-0.9252500941511244/package" to "/home/michael/.npm/sha3/1.2.0/package.tgz"
npm http GET https://registry.npmjs.org/pbkdf2

[email protected] preinstall /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-wallet/node_modules/scrypt.js/node_modules/scrypt
node node-scrypt-preinstall.js

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm http 304 https://registry.npmjs.org/pbkdf2
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/michael/npm-debug.log
npm ERR! not ok code 0

eth_getFilterLogs returns empty array after eth_getTransactionReceipt return logs

Hi.
When I'm running big test suits it reproduced 90% of the time. Here is the testrpc log:

eth_newFilter
eth_sendTransaction

  Gas usage: 102749
  Block Number: 0x09

eth_getTransactionByHash
eth_getTransactionReceipt
eth_getFilterLogs

Every time there is an event caused by transaction, most of the time eth_getFilterLogs produces nothing, while eth_getTransactionReceipt before it clearly reports that logs are there.
If I run this test without other tests, it always works.

If this is not a bug, than what am I really interested in, is how to know that logs from transaction is already there, so I can check there was or there wasn't any logs?

If you think that there might be a race condition, than there is probably not, cause I'm specifically calling eth_getFilterLogs after I'm sure there is logs in receipt.

testrpc crashes at launch with "Error: Cannot find module 'sha3'" on Linux

The only line in the error trace that doesn't reference node internals is:
at Object.<anonymous> (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/keccakjs/index.js:1:80)
This is after having only used npm install -g ethererumjs-testrpc
I tried gulp as well on the same machine and it's working fine, which looks to isolate the issue to testrpc.

Error: the tx doesn't have the correct nonce. account has nonce of: 2 tx has nonce of: 1

I'm doing some experiments with lists and ran in to an error with js testrpc that does not happen when using geth.
Using the following contract:

contract haslist {
    address[] public List;
    uint256 public size = 0;
    function addElement(address element) {
        List[size]=element;
        size++;
    }
}

I call the function addElement through rpc with:

> listhandle = haslistContract.at("0x4875ec1a939f7518e8ec707e261806c4fd233b3a");
> web3.eth.defaultAccount = web3.eth.accounts[0];
'0x269c8f830dbb1fbf59d9a354b7f9f353ae4c3f58'
> listhandle.addElement('0x4875ec1a939f7518e8ec707e261806c4fd233b3a');
Error: VM Exception while executing transaction: invalid JUMP
    at Object.module.exports.InvalidResponse (/home/martin/node_modules/web3/lib/web3/errors.js:35:16)
    at RequestManager.send (/home/martin/node_modules/web3/lib/web3/requestmanager.js:61:22)
    at Eth.send [as sendTransaction] (/home/martin/node_modules/web3/lib/web3/method.js:145:58)
    at SolidityFunction.sendTransaction (/home/martin/node_modules/web3/lib/web3/function.js:133:26)
    at SolidityFunction.execute (/home/martin/node_modules/web3/lib/web3/function.js:219:37)
    at repl:1:12
    at REPLServer.defaultEval (repl.js:164:27)
    at bound (domain.js:250:14)
    at REPLServer.runBound [as eval] (domain.js:263:12)
    at REPLServer.<anonymous> (repl.js:393:12)
> listhandle.addElement('0x4875ec1a939f7518e8ec707e261806c4fd233b3a');
Error: the tx doesn't have the correct nonce. account has nonce of: 3 tx has nonce of: 2
    at Object.module.exports.InvalidResponse (/home/martin/node_modules/web3/lib/web3/errors.js:35:16)
    at RequestManager.send (/home/martin/node_modules/web3/lib/web3/requestmanager.js:61:22)
    at Eth.send [as sendTransaction] (/home/martin/node_modules/web3/lib/web3/method.js:145:58)
    at SolidityFunction.sendTransaction (/home/martin/node_modules/web3/lib/web3/function.js:133:26)
    at SolidityFunction.execute (/home/martin/node_modules/web3/lib/web3/function.js:219:37)
    at repl:1:12
    at REPLServer.defaultEval (repl.js:164:27)
    at bound (domain.js:250:14)
    at REPLServer.runBound [as eval] (domain.js:263:12)
    at REPLServer.<anonymous> (repl.js:393:12)

Manipulate timestamp

I need to test some contract calls against testrpc that have a time constraint (after "x" hours can see the posted value) so I would like to change the timestamp in order to test if I get the expected result.

Thanks

VM Error for generic calls don't propagate

Let A, B be two contracts. A has an instance of B and B has a function that throws (function gothrow(){ throw; }). If this function is called via solidity interface (e.g. b.gothrow()) the error is propagated to the caller (A) and results in an overall throw of the transaction. If the function is called in a generic way (address(b).call(bytes4(sha("gothrow()")));) an error in B is thrown but NOT propagated and the calling function proceeds with its transaction!

I suppose this is not the expected behavior.

An minimal example with truffle/ testrpc and a detailed error description can be found here: https://github.com/mhhf/testrpc_error_propagation

initial accounts balance not respected?

passing an accounts param to the options passed in to testrpc provider does not seem to work
The doc mentions passing a 2d array but looking at the code it actually accept an object {balance:, secretKey:}
Either way the resulting balance is way off : 1.208925819614629174706176e+24 instead of 100 ether

Any idea?

Speed Hacks

Here are some sneaky things you can do to get some speedups

  • use the fake stateTrie if you don't care about state roots
    ( you can still checkpoint and revert )
  • skip proper tx signing by overriding the from: field
  • skip tx signing for eth_call's
transaction.from = new Buffer(ethUtil.stripHexPrefix(txParams.from), 'hex')

calls() don't work if not from a node address

For a call(), the "from" address is optional.

But testrpc fails when using another "from" address. Notably when using hookedweb3provider in a lightwallet.

/usr/local/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:469
  var privateKey = new Buffer(this.accounts[from].secretKey, 'hex');
                                                 ^
TypeError: Cannot read property 'secretKey' of undefined
    at Blockchain.processCall (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:469:50)
    at Blockchain.processNextAction (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:356:10)
    at Blockchain.queueAction (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:322:8)
    at Blockchain.queueCall (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:255:8)
    at Manager.eth_call (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/manager.js:83:19)
    at wrapped (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/server.js:39:8)
    at eval (eval at giveArity (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/server.js:21:41), <anonymous>:1:29)
    at Method.execute (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/jayson/lib/method.js:129:22)
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/jayson/lib/server.js:290:12
    at maybeParse (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/jayson/lib/server.js:407:5)
    at Server.call (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/jayson/lib/server.js:235:3)

calls should be able to take an arbitrary address to use as tx.origin.

Apparently Wrong Event implementation

Following are the issues I see with Test RPC. Please correct me if I am wrong.

Currently when

  1. Event is watched it does not populate all the past events based on filter option.
  2. calling get does not fire watch
  3. calling get clears the event logs. 2nd call does not return anything.

TypeError: Cannot read property 'get' of undefined

I've been getting a lot of this error lately:

eth_getBalance
/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/merkle-patricia-tree/baseTrie.js:117
    db.get(key, {
      ^

TypeError: Cannot read property 'get' of undefined
    at dbGet (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/merkle-patricia-tree/baseTrie.js:117:7)
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/merkle-patricia-tree/util.js:64:5
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:181:20
    at iterate (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:262:13)
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:274:29
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:44:16
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/merkle-patricia-tree/util.js:69:7
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/merkle-patricia-tree/baseTrie.js:122:9
    at dispatchError (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/merkle-patricia-tree/node_modules/levelup/lib/util.js:64:35)
    at /usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/merkle-patricia-tree/node_modules/levelup/lib/levelup.js:222:14

This causes testrpc to crash.
I don't know exactly what causes it, because if I restart testrpc and truffle deploy and build my project again it doesn't necessarily happen again. I think it happens when I do a lot of calls at the same time
Seems non-deterministic.

--debug doesn't work

If I try and run with the --debug flag, then on deployment (with truffle) I get

     Error deploying Contract:

     Error: VM Exception while executing transaction: ReferenceError: logger is not defined
         at /Users/user/.node/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:506:18

TypeError: unexpected type [object Object], use Uint8Array while running

I've upgraded to the latest version on OS X but it fails when I run testrpc:

       throw new TypeError('unexpected type ' + t + ', use Uint8Array');
             ^
TypeError: unexpected type [object Object], use Uint8Array
    at checkArrayTypes (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/node_modules/tweetnacl/nacl-fast.js:2152:14)
    at Object.nacl.secretbox (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/node_modules/tweetnacl/nacl-fast.js:2201:3)
    at Function.KeyStore._encryptString (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/lib/keystore.js:113:21)
    at new KeyStore (/usr/local/lib/node_modules/ethereumjs-testrpc/node_modules/eth-lightwallet/lib/keystore.js:91:29)
    at new Blockchain (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:45:19)
    at new Manager (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/manager.js:14:21)
    at Object.Server.provider (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/server.js:153:19)
    at Object.Server.server (/usr/local/lib/node_modules/ethereumjs-testrpc/lib/server.js:23:25)
    at Object.TestRPC.server (/usr/local/lib/node_modules/ethereumjs-testrpc/index.js:23:26)
    at Object.<anonymous> (/usr/local/lib/node_modules/ethereumjs-testrpc/bin/testrpc:42:22)

I have [email protected] and in install logs I see that it's using [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]). The latest tweetnacl version is 0.14.3 but probably the old version is cached somewhere in dependencies.

I'm not deep in nodejs so I don't understand how to fix it :(

wrong return value for web3.eth.getAccounts

Here is my code:

var web3 = new Web3();
web3.setProvider(TestRPC.provider());

web3.eth.getAccounts((err, acc) => {
    console.log(acc);
});

Here is what I get:

[ '0x871f46e97b6419ce887073a9ccb99b964d438bdd',
  '0x728ef897367608fd7ce8b9dbc66eb840d9cbc63c',
  '0x4f7aef45c0a6c311e15a16a766ac95673978886f',
  '0x92dce6468f51c35266c70b176c6771ac648eb305',
  '0xaf4381f1861c78d399dcdc3c0f36d6fff22086af',
  '0x11d9e50c259ffe93e9fd6f95967599387c4c1ee1',
  '0x55ef102990a7c9fe26d9756da1de372e91e3aaf8',
  '0xe06e79a7c975d1d94ad32ada38855ca701d9dd8a',
  '0x99a17f3c5e4ce7a684d1aa4a805b720ccde276b9',
  '0x513fd961555c0687c81a8465a9ea0a855a408457' ]

Here is what I have in the testrpc logs:

EthereumJS TestRPC v2.0.0

Available Accounts
==================
(0) 0x4e4134b36b3e7f8fca80a2fbfe6d54549e5f0f93

Private Keys
==================
(0) 81aa38abb2b5d5aa3bbc0c852423cca1118dc90ef1a83c18fc8010fb276ec378

But if I use the classic HTTP Provider, the account list is correct:

var web3 = new Web3();
web3.setProvider(new web3.providers.HttpProvider("http://127.0.0.1:8545"));

web3.eth.getAccounts((err, acc) => {
    console.log(acc);
});
[ '0x4e4134b36b3e7f8fca80a2fbfe6d54549e5f0f93' ]

But then nothing gets mined...
Any idea what's wrong?

Thanks,

INVALID_PARAMS eth_sendTransaction

VERSION: latest 1.0

was using truffle deploy; one get this error;

with normal geth at latest its fine to deploy

truffle deploy --verbose-rpc
Using environment development.
   > {
   >   "jsonrpc": "2.0",
   >   "method": "eth_accounts",
   >   "params": [],
   >   "id": 1
   > }
 <   {
 <     "id": 1,
 <     "jsonrpc": "2.0",
 <     "result": [
 <       "0x00691bf743f75a397cee603b6a91d22531d8a9eb",
 <       "0x006a7cdbcdd1e98a534ae5c5228766e10cc1afec"
 <     ]
 <   }
Checking sources...
Compiling ConvertLib.sol...
Compiling MetaCoin.sol...
Collecting dependencies...
   > {
   >   "jsonrpc": "2.0",
   >   "method": "eth_sendTransaction",
   >   "params": [
   >     {
   >       "from": "0x00691bf743f75a397cee603b6a91d22531d8a9eb",
   >       "gas": "0x2fefd8",
   >       "gasPrice": "0x174876e800",
   >       "data": "606060405260358060106000396000f365020191a6b35f50606060405260e060020a600035046396e4ee3d81146024575b6007565b602435600435026060908152602090f3"
   >     }
   >   ],
   >   "id": 2
   > }
 <   {
 <     "error": {
 <       "code": -32602,
 <       "data": null,
 <       "message": "INVALID_PARAMS: Invalid method parameters (invalid name and/or type) recognised"
 <     },
 <     "id": 2,
 <     "jsonrpc": "2.0"
 <   }
Error deploying MetaCoin:

INVALID_PARAMS: Invalid method parameters (invalid name and/or type) recognised

Add a block lag feature

Sometimes you want to test your app under real blockchain-type conditions, where transactions succeed, but the change isn't seen for up to 15 seconds.

Developers should have an easy way to experience that lag in development, so they can build their UI's around it.

It would be really great if testrpc provided a flag for lagging the block addition, to help this process.

eth_call incorrect RPC return value

In [email protected] when using the call method (in this case using ether-pudding) the following error occurs:

Debug: internal, implementation, error
    BigNumber Error: Uncaught error: new BigNumber() not a base 16 number:
    at raise (/Users/nunofmn1/app/node_modules/bignumber.js/bignumber.js:1177:25)
    at /Users/nunofmn1/app/node_modules/bignumber.js/bignumber.js:1165:33
    at new BigNumber (/Users/nunofmn1/app/node_modules/bignumber.js/bignumber.js:212:28)
    at formatOutputString [as _outputFormatter] (/Users/nunofmn1/app/node_modules/web3/lib/solidity/formatters.js:217:19)
    at /Users/nunofmn1/app/node_modules/web3/lib/solidity/type.js:237:25
    at SolidityType.decode (/Users/nunofmn1/app/node_modules/web3/lib/solidity/type.js:238:11)
    at /Users/nunofmn1/appnode_modules/web3/lib/solidity/coder.js:219:29
    at Array.map (native)
    at SolidityCoder.decodeParams (/Users/nunofmn1/app/node_modules/web3/lib/solidity/coder.js:218:26)
    at SolidityFunction.unpackOutput (/Users/nunofmn1/app/node_modules/web3/lib/web3/function.js:90:24)
    at Object.callback (/Users/nunofmn1/app/node_modules/web3/lib/web3/function.js:118:30)
    at /Users/nunofmn1/Documents/app/node_modules/web3/lib/web3/method.js:142:25
    at /Users/nunofmn1/Documents/app/node_modules/web3/lib/web3/requestmanager.js:89:9
    at request.onreadystatechange (/Users/nunofmn1/app/node_modules/web3/lib/web3/httpprovider.js:114:13)
    at dispatchEvent (/Users/nunofmn1/app/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
    at setState (/Users/nunofmn1/app/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)

With further debugging is possible to verify that the problem is in the formatOutputString function, and is related with the JSON returned by the testrpcclient:

{
  id: 2,
  jsonrpc: "2.0",
  result: "0x"
}

Which seems related with web3/web3.js#231.

callback is not a function

getting an error from testrpc 1.2.1

╭─kumavis@xyzs-MacBook-Pro  ~/dev/sxsw-demo   
╰─$ curl -d '{"jsonrpc":"2.0","method":"eth_getBalance","params": ["0xa28d9923203601efb12fe777a9ab934d489e45c5"], "id":1}' -X POST http://139.196.191.70:8545 | jsonogram
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1296    0  1188  100   108   2144    194 --:--:-- --:--:-- --:--:--  2144
├─ id: 1
├─ jsonrpc: 2.0
└─ error
   ├─ message: TypeError: callback is not a function
    at /usr/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:166:7
    at /usr/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/stateManager.js:63:5
    at Cache.getOrLoad (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/cache.js:75:5)
    at StateManager.proto.getAccount (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/stateManager.js:37:14)
    at StateManager.proto.getAccountBalance (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/stateManager.js:61:8)
    at Blockchain.getBalance (/usr/lib/node_modules/ethereumjs-testrpc/lib/blockchain.js:159:24)
    at Manager.eth_getBalance (/usr/lib/node_modules/ethereumjs-testrpc/lib/manager.js:96:19)
    at Manager.handleRequest (/usr/lib/node_modules/ethereumjs-testrpc/lib/manager.js:59:10)
    at next (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/web3-provider-engine/index.js:93:18)
    at VmSubprovider.handleRequest (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/web3-provider-engine/subproviders/vm.js:42:12)
   └─ code: -32000

eth_estimateGas returns wrong estimation

Hi, I'm currently playing around with browser-solidity connected to the testrpc, they have a logic there, that before each transaction to the real node (and they assume testrpc to be real node of course) they call estimateGas, then adjust gas for transaction to what was returned by estimation, then send transaction. The problem is, that for a transaction that will actually eat 225444 gas, it estimates only 75444. There is also situations when the estimate is bigger than actual use.

Stack underflow while sending a transaction

I got the following error while sending a transaction:

Error: VM Exception while executing transaction: stack underflow

The same code succeeded with the Python testrpc. I don't have a good way for anyone to reproduce this issue yet.

infinite event loop

I get this error with testrpc:

"Error: Error: sender doesn't have enough funds to send tx. The upfront cost is: 19999980000000000 and the senders account only has: 19218460000000000
    at runCall (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/ethereumjs-vm/lib/runTx.js:93:10)
    at /usr/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:718:13
    at Immediate.iterate [as _onImmediate] (/usr/lib/node_modules/ethereumjs-testrpc/node_modules/async/lib/async.js:262:13)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

First of all, I don't get this error with geth.
But also after this error, an event which is supposed to be emitted at the very end of the smart contract function is emitted in a infinite loop:

{"name":"ballot-queue-worker","hostname":"local.cocorico.cc-local","pid":6571,"level":30,"balance":"19218460000000000","event":{"logIndex":0,"transactionIndex":0,"transactionHash":"0x966daa499879fe93a1c8c43cdb69dec5843166c47f3088d5af76fbb0c4f845c7","blockHash":"0xd6701b9c7eacb014cb2374012b22297e417ea83ae50844fdc0b75982db06d41c","blockNumber":7,"address":"0x01cf04804565c1f45aec92cf94a2a78e239aa231","type":"mined","event":"Ballot","args":{"voter":"0xb4d0b2358bd40fabd1d260eee60871e4c0c0e176","proposal":"0"}},"msg":"ballot event","time":"2016-04-03T20:33:07.479Z","v":0}
{"name":"ballot-queue-worker","hostname":"local.cocorico.cc-local","pid":6571,"level":30,"balance":"19218460000000000","event":{"logIndex":0,"transactionIndex":0,"transactionHash":"0x966daa499879fe93a1c8c43cdb69dec5843166c47f3088d5af76fbb0c4f845c7","blockHash":"0xd6701b9c7eacb014cb2374012b22297e417ea83ae50844fdc0b75982db06d41c","blockNumber":7,"address":"0x01cf04804565c1f45aec92cf94a2a78e239aa231","type":"mined","event":"Ballot","args":{"voter":"0xb4d0b2358bd40fabd1d260eee60871e4c0c0e176","proposal":"0"}},"msg":"ballot event","time":"2016-04-03T20:33:07.653Z","v":0}
{"name":"ballot-queue-worker","hostname":"local.cocorico.cc-local","pid":6571,"level":30,"balance":"19218460000000000","event":{"logIndex":0,"transactionIndex":0,"transactionHash":"0x966daa499879fe93a1c8c43cdb69dec5843166c47f3088d5af76fbb0c4f845c7","blockHash":"0xd6701b9c7eacb014cb2374012b22297e417ea83ae50844fdc0b75982db06d41c","blockNumber":7,"address":"0x01cf04804565c1f45aec92cf94a2a78e239aa231","type":"mined","event":"Ballot","args":{"voter":"0xb4d0b2358bd40fabd1d260eee60871e4c0c0e176","proposal":"0"}},"msg":"ballot event","time":"2016-04-03T20:33:07.837Z","v":0}
{"name":"ballot-queue-worker","hostname":"local.cocorico.cc-local","pid":6571,"level":30,"balance":"19218460000000000","event":{"logIndex":0,"transactionIndex":0,"transactionHash":"0x966daa499879fe93a1c8c43cdb69dec5843166c47f3088d5af76fbb0c4f845c7","blockHash":"0xd6701b9c7eacb014cb2374012b22297e417ea83ae50844fdc0b75982db06d41c","blockNumber":7,"address":"0x01cf04804565c1f45aec92cf94a2a78e239aa231","type":"mined","event":"Ballot","args":{"voter":"0xb4d0b2358bd40fabd1d260eee60871e4c0c0e176","proposal":"0"}},"msg":"ballot event","time":"2016-04-03T20:33:08.118Z","v":0}
...

Since the transaction cannot occur, it would be surprisingly to have this event emitted even once.
But here it's emitted in a loop.

Any idea what's wrong?

Thank you !

'from' is required for estimateGas call

Unlike geth, the 'from' field is required when making an estimateGas call. Without it, the following is returned:

"AssertionError: false == true
    at Object.exports.pubToAddress.exports.publicToAddress (/Users/alex/Projects/Colony/testrpc/node_modules/ethereumjs-util/index.js:301:3)
    at FakeTransaction.Transaction.getSenderAddress (/Users/alex/Projects/Colony/testrpc/node_modules/ethereumjs-tx/index.js:147:24)
    at populateCache (/Users/alex/Projects/Colony/testrpc/node_modules/ethereumjs-vm/lib/runTx.js:73:20)
    at /Users/alex/Projects/Colony/testrpc/node_modules/async/lib/async.js:718:13
    at iterate (/Users/alex/Projects/Colony/testrpc/node_modules/async/lib/async.js:262:13)
    at async.forEachOfSeries.async.eachOfSeries (/Users/alex/Projects/Colony/testrpc/node_modules/async/lib/async.js:281:9)
    at _parallel (/Users/alex/Projects/Colony/testrpc/node_modules/async/lib/async.js:717:9)
    at Object.async.series (/Users/alex/Projects/Colony/testrpc/node_modules/async/lib/async.js:739:9)
    at VM.module.exports [as runTx] (/Users/alex/Projects/Colony/testrpc/node_modules/ethereumjs-vm/lib/runTx.js:40:9)
    at VmSubprovider.runVm (/Users/alex/Projects/Colony/testrpc/node_modules/web3-provider-engine/subproviders/vm.js:111:6)

The workaround for eth_call can be seen at https://github.com/ethereumjs/testrpc/blob/master/lib/blockchain.js#L325-L326 , but as estimateGas is dealt with by web3-provider-engine, I don't think a similar fix can be applied here.

nonce errors on any exception

If there's any exception such as insufficient gas, subsequent transactions fail with a bad nonce, even though I properly catch the exception in the code.

Error: the tx doesn't have the correct nonce. account has nonce of: 8 tx has nonce of: 7

Below is a patch to ethereum-pudding's test code to show the problem:

This is not reproducible using geth. Simulation != real world issue.

diff --git a/test/contracts.js b/test/contracts.js
index 76e430a..9e2d0e9 100644
--- a/test/contracts.js
+++ b/test/contracts.js
@@ -18,6 +18,7 @@ var binary = compiled.bytecode;
 // Setup
 var web3 = new Web3();
 web3.setProvider(TestRPC.provider());
+//web3.setProvider(new web3.providers.HttpProvider("http://localhost:8110"));
 Pudding.setWeb3(web3);

 var tests = function(contract_instantiator) {
@@ -109,6 +110,7 @@ var tests = function(contract_instantiator) {
       // BigNumber passed in a transaction.
       return example.setValue(new Pudding.BigNumber(25));
     }).then(function(tx) {
+      console.log(tx);
       return example.value.call();
     }).then(function(value) {
       assert.equal(value.valueOf(), 25, "Ending value should be twenty-five");
@@ -118,10 +120,31 @@ var tests = function(contract_instantiator) {
       assert.equal(parrot_value.valueOf(), 865, "Parrotted value should equal 865")
     }).then(done).catch(done);
   });
+
+  it("should throw when running out of gas", function(done) {
+    var example;
+    Example.new().then(function(instance) {
+      example = instance;
+      return example.value.call();
+    }).then(function(value) {
+      assert.equal(value.valueOf(), 1, "Starting value should be 1");
+      return example.setValue(5, {gas: 20000});
+    }).then(function(tx) {
+      return example.value.call();
+    }).then(function(value) {
+      assert.equal(value.valueOf(), 5, "Ending value should be five");
+    }).then(done).catch(function(err) {
+      console.log("properly caught out of gas error");
+      console.log(err);
+      done();
+    });
+  });
 };

 describe("Contract abstractions", function() {

+  this.timeout(40000);  // enough for stock real node e.g. geth
+
   describe("when using .whisk()", function() {
     tests(function(callback) {
       callback(null, Pudding.whisk({

persistent data

Hello,

is there a way to make the testrpc data persistent?
I'm especially interested in being able to reuse my existing contracts after restarting testrpc.

Thank you,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.