Skip to content

Commit

Permalink
ARCO-175: document callbacker microservice (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszos4chain authored Aug 21, 2024
1 parent d357d5e commit cbd83ac
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
File renamed without changes.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. The format

## Table of Contents
- [Unreleased](#unreleased)
- [1.3.0](#130---2024-08-21)
- [1.2.0](#120---2024-08-13)
- [1.1.91](#1191---2024-06-26)
- [1.1.87](#1187---2024-06-10)
Expand All @@ -17,6 +18,11 @@ All notable changes to this project will be documented in this file. The format

## [Unreleased]

## [1.3.0] - 2024-08-21

### Changed
- The functionality for callbacks has been moved from the `metamorph` microservice to the new `callbacker` microservice.

## [1.2.0] - 2024-08-13

### Added
Expand Down
6 changes: 3 additions & 3 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ possible to connect to a large number of nodes without incurring large bandwidth

The ARC design decouples the core functions of a transaction processor and encapsulates them as microservices with the ability to scale horizontally adaptively. Interaction between microservices is decoupled using asynchronous messaging where possible.

ARC consists of 3 core microservices: [API](#API), [Metamorph](#Metamorph) and [BlockTx](#BlockTx), which are all described below.
ARC consists of 4 core microservices: [API](#API), [Metamorph](#Metamorph), [Callbacker](#Callbacker) and [BlockTx](#BlockTx), which are all described below.

All the microservices are designed to be horizontally scalable, and can be deployed on a single machine or on multiple machines. Each one has been programmed with a store interface. The default store is postgres, but any database that implements the store interface can be used.

Expand Down Expand Up @@ -84,9 +84,9 @@ When possible, the API is responsible for rejecting transactions that would be u

Metamorph is a microservice that is responsible for processing transactions sent by the API to the Bitcoin network. It takes care of re-sending transactions if they are not acknowledged by the network within a certain time period (60 seconds by default).

#### Callbacks
### Callbacker

Metamorph also can send callbacks to a specified URL. To register a callback, the client must add the `X-CallbackUrl` header to the request. The callbacker will then send a POST request to the URL specified in the header, with the transaction ID in the body.
Callbacker is a microservice that sends callbacks to a specified URL. To register a callback, the client must add the `X-CallbackUrl` header to the request. The callbacker will then send a POST request to the URL specified in the header, with the transaction ID in the body.

The following example shows the format of a callback body

Expand Down
Binary file modified doc/building_block_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 11 additions & 9 deletions doc/building_block_diagram.puml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
```plantuml
@startuml
digraph arc {
rankdir=TB;
Expand All @@ -14,16 +13,15 @@ digraph arc {
color=black;

api [shape=rectangle, label="API", style=filled, fillcolor=yellow]
api -> metamorph

validation [shape=rectangle, label="validation"]
api -> validation

{ rank=same; api; validation; }
{ rank=same; metamorph; blocktx; }
empty [width=0 height=0 label="" margin="0.5,0" color="white"] // to adjust nodes to the left

api -> {validation metamorph }

{ rank=same; api; validation; empty; }
{ rank=same; metamorph; blocktx; callbacker; }

metamorph -> blocktx [style="dashed", dir="both"]
metamorph -> {blocktx [style="dashed", dir="both"] callbacker}

subgraph cluster_mtm {
label = "metamorph";
Expand All @@ -33,14 +31,18 @@ digraph arc {
metamorph -> node_connection [style="dashed", arrowhead=none]
}


subgraph cluster_blocktx {
label = "blocktx";
blocktx_store [shape=cylinder, label="store", style=filled]
blocktx [shape=rectangle, label="service", style=filled, fillcolor=yellow]
blocktx -> blocktx_store
blocktx -> node_connection [style="dashed", arrowhead=none]
}

subgraph cluster_callbacker {
label = "callbacker";
callbacker [shape=rectangle, label="service", style=filled, fillcolor=yellow]
}
}

subgraph cluster_nodes {
Expand Down

0 comments on commit cbd83ac

Please sign in to comment.