Coder Social home page Coder Social logo

sheepreaper / bitcoinnodeservice Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 39 KB

A Windows service wrapper for bitcoind. Enables automatic, unattended startup, and fast initial synchronization.

License: MIT License

C# 50.59% PowerShell 48.15% Batchfile 1.25%

bitcoinnodeservice's Introduction

CodeQL Release Build

Bitcoin Node Daemon Service

This service provides a convenient way to monitor and manage a Bitcoin node daemon on a Windows system. It ensures that the Bitcoin daemon (bitcoind) is running and provides RPC authentication credentials for secure communication.

Why?

Starting bitcoind for the first time takes ages to complete the initial block download. A little-known bottleneck on Windows is that writing to the Console is a blocking operation. The synchronization process is slowed down significantly by writing to it. Launching bitcoind manually, explicitly without a window speeds up the process significantly. From there, I had the itch to wrap it into a service that could start automatically, and even run unattended.

Features

  • Automatic start of the Bitcoin node daemon (bitcoind) as a Windows service.
  • Generation of RPC authentication credentials for secure communication with the Bitcoin node.
  • Support for custom arguments passed to bitcoind and bitcoin-cli.

Requirements

  • bitcoind and bitcoin-cli. Both are provided by installing bitcoin core
  • If you plan on using the unattended startup, install bitcoin core and this application to a location that is not within a User directory, specifically, it needs to be accessible to NT AUTHORITY\NetworkService. This is an identity with minimal privilege, one step above Local Service, so that it can access the network.

Additional Steps

  • This documentation only covers the wrapper service. bitcoind requires additional configuration. Please reference bitcoin.org for complete documentation of bitcoind.
  • Any command line arguments you would need to pass to either bitcoind or bitcoin-cli can be instead placed in appsettings.json.

Installation

  1. Download the latest release from the Releases page.

  2. Extract the contents of the downloaded ZIP archive to a desired location. (You may not change this location after the service is installed!)

  3. Right-Click install.bat and select Run as Administrator to install the Bitcoin Node Daemon service. The install script is interactive and will prompt you to generate RPC credentials if desired. It will also offer to start the service for the first time.

    install.bat

Configuration

Before starting the service, ensure that the appsettings.json file is updated correctly for your system. The most important properties to configure are:

  • BitcoinD.BinPath: The file path to the bitcoind executable.
  • BitcoinD.StartArgs[]: An array of arguments to pass to the bitcoind executable.
  • BitcoinCli.BinPath: The file path to the bitcoin-cli executable.
  • BitcoinCli.StartArgs[]: An array of arguments to pass to the bitcoin-cli executable.

Each argument is passed literally to the executables, so any arguments they support are also supported by this service.

Uninstallation

To uninstall the Bitcoin Node Daemon service, Right-Click uninstall.bat and select Run as Administrator:

uninstall.bat

Troubleshooting

  • If the service does not start after installation, verify that the appsettings.json file is correctly configured with the correct paths and arguments for bitcoind and bitcoin-cli.
  • Ensure that the service is installed and run with Administrator privileges.

License

MIT

Contributing

Contributing

bitcoinnodeservice's People

Contributors

renovate[bot] avatar sheepreaper avatar

Watchers

 avatar  avatar

bitcoinnodeservice's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Branch Automerge

These updates await pending status checks before automerging. Click on a checkbox to abort the branch automerge, and create a PR instead.

  • Update actions/checkout action to v4.1.6

Detected dependencies

github-actions
.github/workflows/release.yml
  • actions/checkout v4.1.5@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
  • actions/setup-dotnet v4@4d6c8fcf3c8f7a60068d26b594648e99df24cee3
.github/workflows/test-build.yml
  • actions/checkout v4.1.5@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
  • actions/setup-dotnet v4@4d6c8fcf3c8f7a60068d26b594648e99df24cee3
  • actions/upload-artifact v4@65462800fd760344b1a7b4382951275a0abb4808
nuget
src/node-service/BitcoinNodeService.csproj
  • Microsoft.Extensions.Hosting.WindowsServices 8.0.0
  • microsoft.extensions.hosting 8.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.