{"id":18534143,"url":"https://github.com/btcsuite/btcsim","last_synced_at":"2025-04-09T15:31:32.256Z","repository":{"id":65406582,"uuid":"20267638","full_name":"btcsuite/btcsim","owner":"btcsuite","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-01T23:02:07.000Z","size":175,"stargazers_count":38,"open_issues_count":11,"forks_count":31,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-24T08:21:35.549Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/btcsuite.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":"2014-05-28T18:18:11.000Z","updated_at":"2025-03-04T02:11:29.000Z","dependencies_parsed_at":"2023-01-23T10:00:09.259Z","dependency_job_id":null,"html_url":"https://github.com/btcsuite/btcsim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btcsuite%2Fbtcsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btcsuite%2Fbtcsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btcsuite%2Fbtcsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btcsuite%2Fbtcsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btcsuite","download_url":"https://codeload.github.com/btcsuite/btcsim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248057967,"owners_count":21040668,"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","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-06T19:14:46.372Z","updated_at":"2025-04-09T15:31:31.995Z","avatar_url":"https://github.com/btcsuite.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"btcsim\n=======\n\n[![Build Status](http://img.shields.io/travis/btcsuite/btcsim.svg)](https://travis-ci.org/btcsuite/btcsim)\n[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org)\n[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/btcsuite/btcsim)\n\nbtcsim implements a simulation test driver using the `simnet` network provided\nby `btcd`. It launches the required nodes, manages them, runs the simulation\nand cleans up when done, all by itself, so there's no manual setup/teardown\ninvolved. btcsim uses `btcrpcclient` to interface with the RPC servers.\n\nThe input is read from a CSV file with the following headers:\n\n    | block height | minimum utxos required | transactions required |\n\nExample:\n\n    20000,40000,20000\n    20001,60000,30000\n\nBased on the input, the minimum required number of utxos are generated by\ncreating transactions using the existing utxos and dividing them until the\nrequired number is reached.\n\nThe required number of transactions are generated by simulating transactions\nbetween multiple actors and using the utxos generated previously.\n\nMining is controlled using the RPC clients to ensure that the blocks are\ngenerated only when required i.e. when the minimum required number of utxos and\ntransactions are created.\n\n## Components\n\n### Node\n\nThis is the first `btcd` node that is launched. It acts as the server for all\nActors and as a peer for the miner.\n\n### Actor\n\nAn Actor simulates a wallet \"Agent\" by launching a `btcwallet` instance which\nconnects to the node server. It is responsible for generating\ntransactions among itself as well as other actors. Multiple actors can be\nlaunched simultaneously to simulate a large load due to a heavy multi-user\nsystem.\n\n### Miner\n\nThe Miner launches a `btcd` instance and simulates a mining node. It is\nconnected to the node server using the `addnode` RPC call. It is\nresponsible for collecting transactions and mining them when required.\n\n## Installation\n\nbtcsim depends on `btcd` and `btcwallet`, so install those first\n\n```bash\n$ go get github.com/btcsuite/btcd\n```\n\n```bash\n$ go get github.com/btcsuite/btcwallet\n```\n\nNow install btcsim\n\n```bash\n$ go get github.com/btcsuite/btcsim\n```\n\n## Usage\n\nInvoking the command `btcsim` without any flags initializes a single actor\nsimulation, using a default linear curve of 0-10,000 transactions per block:\n\n```bash\n$ btcsim\n```\n\nFor more options, see:\n\n```bash\n$ btcsim --help\n```\n\n## Debugging\n\nTo debug `btcsim` itself, you can turn on profiling using the `--profile` flag.\nTo debug the processes spawned by `btcsim` i.e. `btcd` and `btcwallet`, you can\ncheck the logs written to `~/.btcsim/`.\n\n## License\n\nPackage btcsim is licensed under the [copyfree](http://copyfree.org) ISC\nLicense.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtcsuite%2Fbtcsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtcsuite%2Fbtcsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtcsuite%2Fbtcsim/lists"}