New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@carnesen/bitcoin-config-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@carnesen/bitcoin-config-cli

A Node.js command-line interface (CLI) for bitcoin server software configuration

latest
Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

@carnesen/bitcoin-config-cli Build Status

A Node.js command-line interface (CLI) for bitcoin server software configuration

Install

npm install --global @carnesen/bitcoin-config-cli

^^ This installs this package to your global node_modules area. Probably you can now invoke this CLI from anywhere using the command bitcoin-config. If not you'll need modify your PATH.

Usage

By default this CLI reads/writes the default bitcoin configuration file location, e.g. ~/.bitcoin/bitcoin.conf on Linux.

The CLI can take a JSON-serialized configuration object and write it as an INI-serialized string as expected by the bitcoin server software:

$ bitcoin-config write --json '{"regtest": true, "daemon": true}'

Let's check the contents of the configuration file:

$ bitcoin-config read --format ini
# This is a bitcoin configuration file written using @carnesen/bitcoin-config

# Run this node on its own independent test network.
regtest=1

# Spawn bitcoin as a background process
daemon=1

Looks good! Now suppose later we want to update a configuration file with a specific value:

$ bitcoin-config set --acceptnonstdtxn 1

The "set" command preserves existing values and adds the one(s) specified:

$ bitcoin-config read
{ regtest: true, daemon: true, acceptnonstdtxn: true }

By now there are a TON of available bitcoin configuration options:

$ bitcoin-config set --help
Usage: bitcoin-config set <options>

Options:

   [--acceptnonstdtxn <str>] : Relay and mine non-standard transactions
                               Allowed values {'0', '1'}
   [--addresstype <str>] : p2sh-segwit, legacy, or bech32
   [--addnode <str0> [...]] : Add a node IP address to attempt to connect to
   [--addrmantest <str>] : allows you to test address relay locally
                           Allowed values {'0', '1'}
   [--alertnotify <str>] : Execute a command when an alert or long fork is received.
                           "%s" in the command string is replaced by the alert message.
...

Usage as a library

In addition to providing a CLI, this npm package can also be used as a library in conjunction with @carnesen/cli:

import { bitcoinConfig } from '@carnesen/bitcoin-config-cli';
import { branch, cli } from '@carnesen/cli';

export const root = branch({
  commandName: 'awesome',
  subcommands: [bitcoinConfig],
})

if (module === require.main) {
  cli(root)();
}
  • @carnesen/bitcoin-config: Constants, utilities, and TypeScript types for bitcoin server software configuration with Node.js
  • @carnesen/cli: A library for building Node.js command-line interfaces

License

MIT © Chris Arnesen

FAQs

Package last updated on 09 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts