Skip to content

Latest commit

 

History

History
161 lines (124 loc) · 6.56 KB

File metadata and controls

161 lines (124 loc) · 6.56 KB

bitcoin-spring-boot-starter Modules

See readme.md for general information about the project.

Modules

bitcoin-jsonrpc-client

A module containing a spring boot starter for a ConsensusJ Bitcoin Core JSON-RPC API client. The starter will automatically create an injectable BitcoinClient bean:

org.tbk.bitcoin.jsonrpc.client:
  enabled: true
  network: mainnet
  rpchost: http://localhost
  rpcport: 8332
  rpcuser: myrpcuser
  rpcpassword: 'myrpcpassword'

bitcoin-zeromq-client

A module containing a spring boot starter for a Bitcoin Core ZeroMq API client. The starter will automatically create injectable ZeroMqMessagePublisherFactory beans for every zmq endpoint:

org.tbk.bitcoin.zeromq:
  network: mainnet
  zmqpubrawblock: tcp://localhost:28332
  zmqpubrawtx: tcp://localhost:28333
  zmqpubhashblock: tcp://localhost:28334
  zmqpubhashtx: tcp://localhost:28335

Also, if you have bitcoinj in the classpath, it will create a bean of type BitcoinjTransactionPublisherFactory and BitcoinjBlockPublisherFactory which will emit bitcoinj types for your convenience.

lnd-grpc-client

A module containing a spring boot starter for a LightningJ lnd gRPC API client. The starter will automatically create injectable AsynchronousLndAPI and SynchronousLndAPI beans:

org.tbk.lightning.lnd.grpc:
  enabled: true
  rpchost: localhost
  rpcport: 10009
  macaroon-file-path: '/lnd/.lnd/data/chain/bitcoin/regtest/admin.macaroon'
  cert-file-path: '/lnd/.lnd/tls.cert'

bitcoin-fee

A generalized and extensible interface of multiple Bitcoin Fee Recommendation APIs. The following providers are available out of the box:

  • Bitcoin Core JSON-RPC Api (estimatestmartfee)
  • bitcoiner.live API
  • Bitgo API
  • Bitcore API
  • Blockchain.info API (deprecated - will be removed as it is not compatible with "block target" recommendations)
  • Blockchair API
  • BlockCypher API
  • Blockstream.info API
  • BTC.com API
  • earn.com API
  • mempool.space API

spring-xchange

A module containing a spring boot starter for automatically creating and configuring XChange beans! This starter makes it easy to fetch the current price of bitcoin, programmatically place orders, withdraw your bitcoin or manage your account!

org.tbk.xchange:
  enabled: true # whether auto-config should run - default is `true`
  specifications: # provide specifications for all exchange you want to use - default is empty (no beans created)
    krakenExchange:
      exchange-class: org.knowm.xchange.kraken.KrakenExchange
      api-key: 'your-api-key' # change this value to your api key
      secret-key: 'your-secret-key' #  change this value to your secret key

spring-tor

A module containing a spring boot starter for an embedded Tor daemon. The starter will automatically expose your application as hidden service!

org.tbk.tor:
  enabled: true  # whether auto-config should run - default is `true`
  auto-publish-enabled: true # auto publish the web port as hidden service - default is `true`
  working-directory: 'my-tor-directory' # the working directory for tor - default is `tor-working-dir`
  startup-timeout: 30s # max startup duration for tor to successfully start - default is `60s`

bitcoin-jsr354

Contains a JSR354 compliant CurrentyUnit implementation representing Bitcoin.

spring-jsr354

A module containing a spring boot starter for convenient handling of JSR354 beans. This module creates an application context aware JSR354 Service Provider (javax.money.spi.ServiceProvider) that provides beans in the application context to be used by JSR354 factories (javax.money.Monetary).

xchange-jsr354

A module containing a spring boot starter for integrating XChange in JSR354 currency conversions. Provides a javax.money.convert.ExchangeRateProvider implementation that uses org.knowm.xchange.Exchange beans to supply exchange rates from popular Bitcoin exchanges.

e.g.

CurrencyConversion btcToUsdConversion = MonetaryConversions.getConversion(ConversionQueryBuilder.of()
    .setBaseCurrency(Monetary.getCurrency("BTC"))
    .setTermCurrency(Monetary.getCurrency("USD"))
    .build());

Money singleBitcoin = Money.of(BigDecimal.ONE, "BTC");
Money singleBitcoinInUsd = singleBitcoin.with(btcToUsdConversion);

log.info("{} equals {}", singleBitcoin, singleBitcoinInUsd);
// e.g. "BTC 1.00 equals USD 13806.90"

spring-testcontainer

This module contains a fast and easy way to start one or multiple instances of external services within docker containers programmatically directly from your application. Please note, that these modules are intended to be used in regtest mode only.

Start and run:

Most of these spring boot starter modules contain a simple example application. They can be used in combination with other modules like bitcoin-jsonrpc-client, bitcoin-zeromq-client, lnd-grpc-client, etc.

bitcoin-regtest

A module containing spring boot starters for integration and regression testing your own application. It includes functionality to create and fund addresses, send transactions, mine blocks and much more.

incubator

This subproject is home to all almost-ready modules.

tbk-electrum-daemon-client

A module containing a spring boot starter for an Electrum daemon JSON-RPC API client. It can be used in combination with spring-testcontainer-electrum-daemon-starter!

spring-lnurl

The spring-lnurl module contains classes and spring security configurations for authentication with lnurl-auth.