{"id":18556821,"url":"https://github.com/urbit/urbit-bitcoin-rpc","last_synced_at":"2026-02-27T07:42:18.869Z","repository":{"id":37707394,"uuid":"304609447","full_name":"urbit/urbit-bitcoin-rpc","owner":"urbit","description":"bitcoind and ElectRS Dockerized for use in Urbit","archived":false,"fork":false,"pushed_at":"2023-01-16T22:21:31.000Z","size":93,"stargazers_count":15,"open_issues_count":3,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T14:21:24.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/urbit.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}},"created_at":"2020-10-16T11:38:32.000Z","updated_at":"2023-03-10T12:07:28.000Z","dependencies_parsed_at":"2023-02-10T06:30:42.953Z","dependency_job_id":null,"html_url":"https://github.com/urbit/urbit-bitcoin-rpc","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/urbit%2Furbit-bitcoin-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Furbit-bitcoin-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Furbit-bitcoin-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Furbit-bitcoin-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urbit","download_url":"https://codeload.github.com/urbit/urbit-bitcoin-rpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140556,"owners_count":21054301,"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-06T21:33:31.327Z","updated_at":"2025-10-16T09:19:05.933Z","avatar_url":"https://github.com/urbit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Utilities for Running an Urbit Bitcoin Full Node\n\n**NOTE 1**\nMake sure that your `bitcoin.conf` settings match those of the included `bitcoin.conf`. In particular, if you don't have `blockfilterindex=1` set, the server won't work.\n\n**NOTE 2**\n`src/dumb.js` works, but is not currently implemented on the Hoon side. Use the scripts in the manner done in `mainnet-start.sh` and `testnet-start.sh` for now.\n\n## Simple Usage\n\n1. Initialize and build electrs\n\n```\ngit submodule init\ngit submodule update\ncd electrs\ncargo build --locked --release\ncd ..\n```\n\n2. Set the `$DRIVE` variable at the top of `mainnet-start.sh`, `testnet-start.sh`, or `regnet-start.sh` to a directory that contains a `BTC` directory for Bitcoin core data.\n3. Copy the included `bitcoin.conf` to the `/BTC` directory in that `DRIVE`\n4. Run `./mainnet-start.sh` or `./testnet-start.sh`\n5. When done, kill with `Ctrl-C`, and wait to see `Shutdown: done` from Bitcoin core.\n\n## Components\n\n- Electrs as a submodule (for random lookup of address info)\n- JS Proxy to act as an API\n- Scripts to start the above with `bitcoind`\n\n## Auth Notes\n\nThis uses `.cookie` authentication. To find the username and password for BTC RPC, open the `.cookie` file in the Bitcoin datadir. It has the format:\n\n- username: `__cookie__`\n- password: everything after `:`\n\n## Sample Calls\n\ncurl http://localhost:50002/addresses/info/bc1qm7cegwfd0pvv9ypvz5nhstage00xkxevtrpshc\ncurl http://localhost:50002/addresses/info/bc1qlwd7mw33uea5m8r2lsnsrkc7gp2qynrxsfxpfm\ncurl http://localhost:50002/addresses/info/bc1qglkc9zfcn04vcc88nn0ljtxcpu5uxfznc3829k\n:: first is an address w balance\n:: second has no balance but is used\n:: third is unused\n\ncurl http://localhost:50002/getblockinfo\ncurl http://localhost:50002/getrawtx/f107fd63c7b78df447dd4355d39e474786998d78ff1c152602fafe7e96c10e4d\ncurl http://localhost:50002/getblockcount\n\n## Raspberry Pi Setup\n\nRust install weirdness:\nhttps://www.raspberrypi.org/forums/viewtopic.php?t=289963\n\n```\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nDo a Custom Install, and set the triple to:\n\n```\narmv7-unknown-linux-gnueabihf\n```\n\n---\n\n## NEW: dumb.js, a dumb proxy\n\nStart with `testnet-dumb-proxy.sh` or `mainnet-dumb-proxy.sh`.\n\n## Regtest notes\n\nFor quicker testing the server be ran in regtest mode. To do so follow steps 1 - 4 under Simple Usage. Once the server is running you can then generate new blocks by running:\n\n```\nbitcoin-cli -regtest createwallet \u003cwallet_name\u003e\nbitcoin-cli -regtest -rpcwallet=\u003cwallet_name\u003e -generate 101\n\n# you should see a single utxo with a value of 50 BTC\nbitcoin-cli -regtest -rpcwallet=\u003cwallet_name\u003e listunspent\n```\n\nYou should now be able to call any bitcoin-cli command and test as needed.\nFor more info on regtest take a look at the [btc testing docs](https://developer.bitcoin.org/examples/testing.html) or [this guide](https://gist.github.com/System-Glitch/cb4e87bf1ae3fec9925725bb3ebe223a#file-how_to_regtest-md)\n\n### Example calls\n\ntestnet\n\n```bash\n# BTC-RPC\ncurl http://localhost:50002/btc-rpc -X POST -d '{\"jsonrpc\":\"1.0\",\"id\":\"curltext\",\"method\":\"getblockchaininfo\",\"params\":[]}' -H 'Content-Type: application/json' \u0026\u0026 echo \"\"\n\n# Electrs RPC on testnet\ncurl http://localhost:50002/electrs-rpc -X POST -H 'Content-Type: application/json' -d '{\"jsonrpc\": \"2.0\", \"id\": \"get-address-info\", \"method\": \"blockchain.scripthash.listunspent\", \"params\": [\"34aae877286aa09828803af27ce2315e72c4888efdf74d7d067c975b7c558789\"]}' \u0026\u0026 echo \"\"\n```\n\nmainnet\n\n```bash\n# BTC-RPC\ncurl http://localhost:50002/btc-rpc -X POST -d '{\"jsonrpc\":\"1.0\",\"id\":\"curltext\",\"method\":\"getblockchaininfo\",\"params\":[]}' -H 'Content-Type: application/json' \u0026\u0026 echo \"\"\n\n# Electrs RPC\ncurl http://localhost:50002/electrs-rpc -X POST -H 'Content-Type: application/json' -d '{\"jsonrpc\": \"2.0\", \"id\": \"get-address-info\", \"method\": \"blockchain.scripthash.listunspent\", \"params\": [\"32259e322cd3a03b39a86160ced01e5aeda3bce36c4958cb0a185baf365ed878\"]}' \u0026\u0026 echo \"\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbit%2Furbit-bitcoin-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furbit%2Furbit-bitcoin-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbit%2Furbit-bitcoin-rpc/lists"}