{"id":29873883,"url":"https://github.com/0xsequence/ethtestserver","last_synced_at":"2025-07-30T23:38:34.902Z","repository":{"id":301273325,"uuid":"1007804793","full_name":"0xsequence/ethtestserver","owner":"0xsequence","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-22T23:50:59.000Z","size":399,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-23T01:23:32.762Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xsequence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-24T14:54:44.000Z","updated_at":"2025-07-07T14:55:10.000Z","dependencies_parsed_at":"2025-07-23T01:14:38.033Z","dependency_job_id":"94165a03-6f4e-4a57-ba63-d10f409fc941","html_url":"https://github.com/0xsequence/ethtestserver","commit_stats":null,"previous_names":["0xsequence/ethtestserver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/0xsequence/ethtestserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethtestserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethtestserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethtestserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethtestserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xsequence","download_url":"https://codeload.github.com/0xsequence/ethtestserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fethtestserver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267961045,"owners_count":24172514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-07-30T23:38:22.441Z","updated_at":"2025-07-30T23:38:34.874Z","avatar_url":"https://github.com/0xsequence.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ETHTestServer\n\nA Go package for creating local Ethereum test environments.\n\n## Purpose\n\nETHTestServer provides a high-level API for spinning up a complete Ethereum\nblockchain environment for testing, development, and experimentation.  It's\nbuilt on top of `go-ethereum` and designed to make complex blockchain testing\nscenarios easy to implement.\n\n## Features\n\n- **Reorg Testing**: Simulate chain reorganizations to test application\n  resilience\n- **Custom Genesis**: Define initial blockchain state with custom accounts and\n  contracts\n- **Artifact Management**: Load and deploy contracts from JSON artifacts\n- **State Persistence**: Maintain test state across server restarts\n- **Runtime Controls**: Set mining limits by block count or duration\n\n## Use Cases\n\n- **Integration Testing**: Test services that interact with Ethereum networks\n- **CI/CD**: Automated testing pipelines requiring blockchain environments\n\n## Not Intended For\n\n- **Production Use**: This package is not designed for production blockchain\n  networks.\n- **Contract Development**: While it supports contract deployment, it is not a\n  substitute for dedicated contract development tools.\n- **High-Performance Requirements**: It is optimized for testing scenarios, not\n  for high-throughput applications.\n\n## Quick Start\n\n```go\nimport \"github.com/0xsequence/ethtestserver\"\n\n// Create and start a test server\nserver, err := ethtestserver.NewETHTestServer(\u0026ethtestserver.ETHTestServerConfig{\n    AutoMining: true,\n    MineRate:   2 * time.Second,\n})\nif err != nil {\n    log.Fatal(err)\n}\n\n// Run the server\nctx := context.Background()\ngo server.Run(ctx)\n\n// Your tests here...\n// server.HTTPEndpoint() provides the RPC URL\n\n// Cleanup\nserver.Stop(ctx)\n```\n\n## CLI Usage\n\n`ETHTestServer` also includes a powerful command-line interface (CLI) that runs\nthe test server as a standalone process. This is ideal for when you don't want\nto integrate the server directly into your Go test suite.\n\nThe CLI also includes \"monkey\" operators to automatically generate a variety of\ntransaction types for simulating blockchain noise.\n\n### Installation\n\n```\ngo install github.com/0xsequence/ethtestserver/cmd/ethtestserver\n```\n\n### Basic Usage\n\nTo start a default server with auto-mining enabled every second:\n\n```sh\nethtestserver --auto-mine\n```\n\nThe server will start and print its RPC endpoint (default:\n`http://localhost:8545`).\n\n#### 1. High-Load Stress Test\n\nThis command simulates a busy network with a high volume of diverse\ntransactions, running for 10,000 blocks.\n\n```sh\nethtestserver \\\n  --auto-mine \\\n  --run-all \\\n  --min-transactions-per-block=50 \\\n  --max-transactions-per-block=100 \\\n  --max-blocks=10000 \\\n  --data-dir=./data-stress-test\n```\n\n#### 2. Deep Chain Reorganization Test\n\nThis command runs a simulation with a 10% chance of a very deep reorg (50-90\nblocks) occurring after each block is mined.\n\n```sh\nethtestserver \\\n  --auto-mine \\\n  --run-all \\\n  --max-blocks=10000 \\\n  --reorg-probability=0.1 \\\n  --reorg-depth-min=50 \\\n  --reorg-depth-max=90 \\\n  --data-dir=./data-reorg-test\n```\n\n#### 3. Maximum Throughput Benchmark\n\nThis command configures the server for maximum transaction throughput by\nreducing mining and transaction generation intervals.\n\n```sh\nethtestserver \\\n  --auto-mine \\\n  --run-all \\\n  --min-transactions-per-block=120 \\\n  --max-transactions-per-block=180 \\\n  --auto-mine-interval=1 \\\n  --monkey-mine-interval=1 \\\n  --max-blocks=50000 \\\n  --data-dir=./data-throughput-test\n```\n\n### All Options\n\nFor a full list of available flags and their descriptions, run:\n\n```sh\nethtestserver --help\n```\n\n*ETHTestServer is designed for testing and development environments. It is not\nintended for production blockchain networks.*\n\n## License\n\n[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Fethtestserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xsequence%2Fethtestserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Fethtestserver/lists"}