<commit_before>.. _tut-overview:

********
Overview
********

Broadly speaking the main services in libbitcoin can be divided down three
lines.

*Network services*:

these services are concerned with the network side of things.

* :class:`channel`
* :class:`network`
* :class:`protocol`
* :class:`hosts`
* :class:`handshake`

*Blockchain services*:

Bitcoin's blockchain is usually disk oriented. Backends all implement the
blockchain interface allowing programs to utilise backends using the same code.

* :class:`blockchain` (abstract interface for blockchain backends)
* :class:`bdb_blockchain`
* :class:`leveldb_blockchain`

*Supporting services*:

These services utilise other services and provide additional
functionality. They can be thought of as composed services.

* :class:`poller`
* :class:`transaction_pool`
* :class:`session`

.. C++11 library.

Rationale
=========

Core Concepts and Functionality
===============================

Basic libbitcoin Anatomy
------------------------

Threadpools and Services
------------------------

Theory
^^^^^^

Practice
^^^^^^^^

Data Types
----------

These core types are used around the library in multiple places where
working with hashes or raw data chunks.

.. cpp:type:: data_chunk

   Raw bytes. A chunk of data. This type is equivalent to
   ``std::vector<uint8_t>``.

.. cpp:type:: hash_digest

   32 byte result of a SHA256 hash. Same type as ``std::array<uint8_t, 32>``.

.. cpp:type:: short_hash<commit_msg>doc: moved section about services to libbitcoin anatomy<commit_after>.. _tut-overview:

********
Overview
********

Rationale
=========

Core Concepts and Functionality
===============================

Basic libbitcoin Anatomy
------------------------

Broadly speaking the main services in libbitcoin can be divided down three
lines.

*Network services*:

these services are concerned with the network side of things.

* :class:`channel`
* :class:`network`
* :class:`protocol`
* :class:`hosts`
* :class:`handshake`

*Blockchain services*:

Bitcoin's blockchain is usually disk oriented. Backends all implement the
blockchain interface allowing programs to utilise backends using the same code.

* :class:`blockchain` (abstract interface for blockchain backends)
* :class:`bdb_blockchain`
* :class:`leveldb_blockchain`

*Supporting services*:

These services utilise other services and provide additional
functionality. They can be thought of as composed services.

* :class:`poller`
* :class:`transaction_pool`
* :class:`session`

Threadpools and Services
------------------------

Theory
^^^^^^

Practice
^^^^^^^^

Data Types
----------

These core types are used around the library in multiple places where
working with hashes or raw data chunks.

.. cpp:type:: data_chunk

   Raw bytes. A chunk of data. This type is equivalent to
   ``std::vector<uint8_t>``.

.. cpp:type:: hash_digest

   32 byte result of a SHA256 hash. Same type as ``std::array<uint8_t, 32>``.

.. cpp:type:: short_hash
{'fraction_non_alphanumeric': 0.1678463094034378, 'fraction_numerical': 0.006740815638692282, 'mean_word_length': 4.090909090909091, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6114443', 'n_tokens_mistral': 868, 'n_tokens_neox': 822, 'n_words': 308}