Skip to content

Latest commit

 

History

History
191 lines (147 loc) · 7.26 KB

modules.md

File metadata and controls

191 lines (147 loc) · 7.26 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:
  enabled: true # whether auto-config should run - default is `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:
  enabled: true # whether auto-config should run - default is `true`
  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.

cln-grpc-client

A module containing a spring boot starter for a CLN gRPC API client. The starter will automatically create injectable NodeStub, NodeFutureStub and NodeBlockingStub beans:

org.tbk.lightning.cln.grpc:
  enabled: true # whether auto-config should run - default is `true`
  host: localhost
  port: 19935
  ca-cert-file-path: '/home/user/.lightning/regtest/ca.pem'
  client-cert-file-path: '/home/user/.lightning/regtest/client.pem'
  client-key-file-path: '/home/user/.lightning/regtest/client-key.pem'

or

org.tbk.lightning.cln.grpc:
  host: localhost
  port: 19935
  ca-cert-base64: '...yv66vg=='
  client-cert-base64: '...yv66vg=='
  client-key-base64: '...yv66vg=='

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 # whether auto-config should run - default is `true`
  host: localhost
  port: 10009
  macaroon-file-path: '/home/user/.lnd/data/chain/bitcoin/regtest/admin.macaroon'
  cert-file-path: '/home/user/.lnd/tls.cert'

or

org.tbk.lightning.lnd.grpc:
  host: localhost
  port: 10009
  macaroon-base64: '...yv66vg=='
  cert-base64: '...yv66vg=='

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

Moved to a distinct repo: https://github.com/theborakompanioni/tor-spring-boot-starter

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.