{"id":43426303,"url":"https://github.com/walnuthq/stylusdb","last_synced_at":"2026-02-06T21:02:19.471Z","repository":{"id":284884952,"uuid":"952397351","full_name":"walnuthq/stylusdb","owner":"walnuthq","description":"LLDB based debugger for Arbitrum Stylus","archived":false,"fork":false,"pushed_at":"2026-02-02T17:10:20.000Z","size":194,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-02-03T06:33:42.971Z","etag":null,"topics":["arbitrum","rust"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walnuthq.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-21T08:04:56.000Z","updated_at":"2026-01-30T09:43:49.000Z","dependencies_parsed_at":"2025-09-14T14:33:02.815Z","dependency_job_id":"583efded-0cd4-48a5-b310-f8fb5d8bd0ca","html_url":"https://github.com/walnuthq/stylusdb","commit_stats":null,"previous_names":["walnuthq/walnut-dbg","walnuthq/stylusdb"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/walnuthq/stylusdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walnuthq%2Fstylusdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walnuthq%2Fstylusdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walnuthq%2Fstylusdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walnuthq%2Fstylusdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walnuthq","download_url":"https://codeload.github.com/walnuthq/stylusdb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walnuthq%2Fstylusdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29175826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T20:14:21.878Z","status":"ssl_error","status_checked_at":"2026-02-06T20:14:21.443Z","response_time":59,"last_error":"SSL_read: 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":["arbitrum","rust"],"created_at":"2026-02-02T19:03:09.497Z","updated_at":"2026-02-06T21:02:19.466Z","avatar_url":"https://github.com/walnuthq.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stylusdb\nModern debugger for blockchain transactions.\n\n## Quick Start\n\n### Option 1: Automated Build Script (Recommended)\n\nClone the repository and run the automated build script:\n\n```bash\ngit clone https://github.com/walnuthq/stylusdb.git\ncd stylusdb\n./build.sh\n```\n\nThe script will:\n- Install all required dependencies automatically\n- Download and build LLDB if needed (macOS only, cached for future builds)\n- Build stylusdb\n- Optionally install it system-wide\n\n### Option 2: Download Pre-built Binaries (Easiest)\n\nDownload the latest installer from [GitHub Releases](https://github.com/walnuthq/stylusdb/releases):\n\n1. Download the appropriate package for your system:\n   - **Apple Silicon (M1/M2/M3)**: `StylusDB-0.1.0-macOS-aarch64.pkg`\n   - **Intel**: `StylusDB-0.1.0-macOS-x86_64.pkg`\n2. Double-click the package to install\n3. Follow the installation wizard\n\nThe package includes:\n- `stylusdb` - Main debugger\n- `rust-stylusdb` - Rust debugging wrapper\n- `pretty-print-trace` - Trace visualization tool\n- All required LLDB/LLVM libraries\n\nAfter installation, run `/usr/local/bin/stylusdb` to start using the debugger\n\n#### Install the package for all users (requires admin password)\n\nYou can also install the package from the terminal:\n```bash\n# Download the package (choose the right one for your architecture)\n# For Apple Silicon (M1/M2/M3):\ncurl -L -O https://github.com/walnuthq/stylusdb/releases/download/v0.1.0/StylusDB-0.1.0-macOS-aarch64.pkg\n\n# Or for Intel:\n# curl -L -O https://github.com/walnuthq/stylusdb/releases/download/v0.1.0/StylusDB-0.1.0-macOS-x86_64.pkg\n\n# Install the package (requires admin password)\nsudo installer -pkg StylusDB-0.1.0-macOS-aarch64.pkg -target /\n\n# Verify installation\n/usr/local/bin/stylusdb --version\n```\n\n### Prerequisites for `usertrace`\n\nInstall Python colorama for pretty-printed traces:\n```bash\npython3 -m venv myvenv\nsource ./myvenv/bin/activate\npip3 install colorama\n```\n\n### Option 3: Manual Build\n\n\u003cdetails\u003e\n\u003csummary\u003eClick to expand manual build instructions\u003c/summary\u003e\n\n#### Prerequisites\n\n##### macOS\n```bash\nbrew install llvm@19 lit swig ninja cmake\n```\n\n##### Linux (Ubuntu/Debian)\n```bash\nwget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- 19\nsudo apt-get install -y cmake ninja-build llvm-19-dev liblldb-19-dev lldb-19 swig\n```\n\n#### Build Steps\n\n##### macOS Only: Build LLDB from source\n```bash\nwget https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-19.1.7.zip\nunzip llvmorg-19.1.7.zip\ncd llvm-project-llvmorg-19.1.7/ \u0026\u0026 mkdir build_lldb \u0026\u0026 cd build_lldb\ncmake ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=\"clang;lldb\" \\\n  -DLLVM_ENABLE_ASSERTIONS=ON -DLLDB_INCLUDE_TESTS=OFF -DLLDB_ENABLE_PYTHON=1 -GNinja\nninja\n```\n\n##### Build stylusdb\n\n###### macOS\n```bash\ncd /path/to/stylusdb\nmkdir build \u0026\u0026 cd build\ncmake -GNinja .. \\\n  -DLLVM_DIR=/opt/homebrew/opt/llvm@19/lib/cmake/llvm \\\n  -DLLVM_BUILD_ROOT=/path/to/llvm-project-llvmorg-19.1.7/build_lldb \\\n  -DLLVM_SRC=/path/to/llvm-project-llvmorg-19.1.7/ \\\n  -DLLVM_TABLEGEN_EXE=/opt/homebrew/opt/llvm@19/bin/llvm-tblgen \\\n  -DCMAKE_CXX_FLAGS=\"-Wno-deprecated-declarations\" \\\n  -DLLVM_LIB_PATH=/opt/homebrew/opt/llvm@19/lib/libLLVM.dylib\nsudo ninja \u0026\u0026 sudo ninja install\n```\n\n###### Linux\n```bash\ncd /path/to/stylusdb\nmkdir build \u0026\u0026 cd build\ncmake -GNinja .. \\\n  -DLLVM_DIR=/usr/lib/llvm-19/lib/cmake/llvm \\\n  -DLLVM_BUILD_ROOT=/usr/lib/llvm-19 \\\n  -DLLVM_SRC=/usr/include/llvm-19 \\\n  -DCMAKE_CXX_FLAGS=\"-Wno-deprecated-declarations\"\nsudo ninja \u0026\u0026 sudo ninja install\n```\n\n\u003c/details\u003e\n\n## Usage\n\nStylusDB is integrated with [cargo-stylus](https://github.com/walnuthq/cargo-stylus) to provide advanced debugging capabilities for Stylus smart contracts on Arbitrum. For complete documentation, see the [Stylus Debugger Guide](https://github.com/walnuthq/cargo-stylus/blob/feature/usertrace/docs/StylusDebugger.md).\n\n### Function Call Tracing with `usertrace`\n\nTrace user function calls in a transaction to understand the execution flow:\n\n```bash\n# Basic usage - traces your contract functions\ncargo stylus usertrace \\\n  --tx=0x88b0ad9daa0b701d868a5f9a0132db7c0402178ba44ed8dec4ba76784c7194fd \\\n  --endpoint=$RPC_URL\n```\n\nOutput:\n```bash\n=== STYLUS FUNCTION CALL TREE ===\n└─ #1 stylus_hello_world::__stylus_struct_entrypoint::h09ecd85e5c55b994 (lib.rs:33)\n    input = size=4\n    \u003canon\u003e = stylus_sdk::host::VM { 0=\u003cunavailable\u003e }\n  └─ #2 stylus_hello_world::Counter::increment::h5b9fb276c23de4f4 (lib.rs:64)\n      self = 0x000000016fdeaa78\n    └─ #3 stylus_hello_world::Counter::set_number::h5bd2c4836637ecb9 (lib.rs:49)\n        self = 0x000000016fdeaa78\n        new_number = ruint::Uint\u003c256, 4\u003e { limbs=unsigned long[4] { [0]=1, [1]=0, [2]=0, [3]=0 } }\n```\n\n#### Advanced Tracing Options\n\n```bash\n# Include SDK calls\ncargo stylus usertrace --tx \u003cTX_HASH\u003e --endpoint=$RPC_URL --verbose-usertrace\n\n# Trace specific external crates\ncargo stylus usertrace --tx \u003cTX_HASH\u003e --endpoint=$RPC_URL \\\n  --trace-external-usertrace=\"std,core,other_contract\"\n```\n\n### Interactive Debugging with `replay`\n\nUse StylusDB for interactive debugging sessions:\n\n```bash\n# Basic replay with stylusdb\ncargo stylus replay --debugger stylusdb --tx \u003cTX_HASH\u003e --endpoint=$RPC_URL\n```\n\nThis will:\n1. Launch StylusDB\n2. Load your contract's debug symbols\n3. Stop at breakpoints you can set\n4. Allow stepping through code and inspecting variables with contract programming sugar (e.g. pretty-print `uint256` and other well-known types)\n\n#### Multi-Contract Debugging\n\nDebug transactions involving multiple contracts:\n\n```bash\ncargo stylus replay --debugger stylusdb --tx \u003cTX_HASH\u003e \\\n  --contracts 0x123...:./contractA,0x456...:./contractB \\\n  --endpoint=$RPC_URL\n```\n\nIn the debugger:\n```bash\n(stylusdb) stylus-contract breakpoint 0x456... ContractB::some_function\nSet breakpoint on ContractB::some_function in contract 0x456... (ID: 1, 1 locations)\n(stylusdb) continue\n```\n\n#### Mixed Stylus/Solidity Debugging\n\nDebug transactions that call both Stylus and Solidity contracts:\n\n```bash\ncargo stylus replay --debugger stylusdb --tx \u003cTX_HASH\u003e \\\n  --addr-solidity=0xda52b25ddb0e3b9cc393b0690ac62245ac772527 \\\n  --endpoint=$RPC_URL\n```\n\nWhen execution reaches a Solidity contract:\n```bash\n(stylusdb)\n════════ Solidity Contract Call ════════\nContract: 0xda52b25ddb0e3b9cc393b0690ac62245ac772527\nFunction selector: 0xd09de08a (increment())\nNOTE: This is a Solidity contract - skipping to next contract\n```\n\n### Direct StylusDB Usage\n\nYou can also use StylusDB directly without cargo-stylus:\n\n```bash\n# Start interactive debugger\n/usr/local/bin/stylusdb\n\n# Common commands\n(stylusdb) target create ./target/release/my_contract.so\n(stylusdb) breakpoint set --name user_entrypoint\n(stylusdb) run\n(stylusdb) continue\n(stylusdb) quit\n```\n\n## Troubleshooting\n\n### macOS: \"liblldb.dylib not found\"\nThe automated build script handles this, but if building manually, ensure LLDB libraries are copied to `/usr/local/lib/`.\n\n### Linux: Missing LLDB headers\nInstall the development packages:\n```bash\nsudo apt-get install liblldb-19-dev lldb-19\n```\n\n## License\n\nSee [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalnuthq%2Fstylusdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalnuthq%2Fstylusdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalnuthq%2Fstylusdb/lists"}