Giter Site home page Giter Site logo

rpctestgen's Introduction

rpctestgen

rpctestgen is a test fixture generator for the execution layer JSON-RPC API.

Conceptually, it is similar to retesteth, which generates consensus tests, in that it takes test definitions (in rpctestgen's case, go functions), executes them against a client, and outputs the exchange.

The full API specification can be found in ethereum/exeuction-apis.

Usage

rpctestgen runs with sane defaults. The tests will be filled with whatever binary geth matches in the $PATH. By default, tests are not sealed. To seal with ethash, run with the --ethash flag. For a full list of options, see rpctestgen --help.

Quick Start

To fill all tests with ethash seal, simply run make fill.

$ make fill
go build .
./rpctestgen  --ethash
sealing block 1
sealing block 2
sealing block 3
starting client
filling tests...
generating tests/eth_blockNumber/simple-test.io  done.
generating tests/eth_getBlockByNumber/get-genesis.io  done.
generating tests/eth_getBlockByNumber/get-block-n.io  done.

This will write the generated test fixtures to tests/ directory. In addition to JSON-RPC exchange, a chain.rlp and genesis.json will be included so that the exchange can be verified on all clients.

Fixture format

The fixtures are very simple. Each statement is delimited by a newline. The >> prefix denotes a request sent to the client. The << prefix denotes the client's response.

>> {"jsonrpc":"2.0","id":1,"method":"eth_blockNumber"}
<< {"jsonrpc":"2.0","id":1,"result":"0x3"}

rpctestgen's People

Contributors

lightclient avatar fjl avatar

Watchers

 avatar

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.