Bitcoin Core – New block observer.

guys I need to create a bitcoin observer, who will subscribe to the new block event of the bitcoin node and perform some operations with mined transactions.
To start the node I use
bitcoind -testnet -datadir = / home / ubuntu / bitcoin / -rpcuser = user -rpcpassword = password
And use it in Node.js through the Bitcoin Core library
I found only one way to interact with a new block event:
Here the solution. But it was an answer five years ago. I hope it can be a much better solution to subscribe to new blocks without using bcoin or else frameworks, which work with own nodes and have no possibility of connecting to an external node through the link.
I would be able to use Node.js v10.12

Is the sequence diagram for the extraction model for the observer pattern the same as the insertion model?

I have been looking at examples of sequence diagrams for the observer pattern, but most implemented an insertion model where the subject updates the observers. In an extraction model, how would it be different because, technically, the subject updates the observers even when there is a change only because the observer activates the data extraction?

magento 1.9 – Creation of a personalized event observer for after sales

I am trying to create a custom observer that will be activated after a successful purchase has been made. I assume that sales_order_save_after It is the correct event to use.

What the Observer will do is verify that the order comes from the correct store and then add some data to a new table. I thought I had done it correctly, but I could not make it work. After changing a few things a little, I eventually had an error in my test account where I was shopping. You now receive this error every time you try to make the payment: this invoice ID has already been paid (# 10412: duplicate invoice)

In any case, this is what I have:


getEvent () -> getOrder ();
$ storeId = $ order-> getStoreId ();

$ incrementId = $ order-> getIncrementId ();
$ entity_id = $ order-> getEntityId ();

yes ($ storeId == 3) {
// save data through the query


                    Save data

Everything seems right here? I realized that I had Namespace_Module_Model_Observer / Observer as the class before copying the code here. However, before that, I still did not get anything for the most part. There are no errors / exceptions. However, I have not attempted to add a real record release to the observer. It would simply be that:
Mage :: log ($ observer-> getEvent () -> getName (), null, & # 39; event.log & # 39;);?

magento2 – Obtain order increase in observer ID

I have created a module to store the details of the order in a customized mysql table after completing the payment process. Everything works fine, but the order identification is saved in the format "210" (order_id) instead of "1000000210" (increment_id). How can I get this format?
My observer looks like this:

public function execute (observer $ observer)

$ orderId = $ observer-> getEvent () -> getOrderIds ()[0];
$ order = $ this-> orderRepository-> get ($ orderId);
$ this-> postSaverModel-> create () -> doSync ($ orderId);


cron – Magento 2: I need to run the observer in crontab.xml. But it is not working

I am running observer in crontab.xml. This is not working.

Here is my code


            * * * * * 


namespace Abc  Abandon  Observer;

use Magento  Framework  Event  Observer;
use Magento  Framework  Event  ObserverInterface;

Abandon class implements ObserverInterface

protected $ scopeConfig;

public function __constructed (

 Magento  Framework  App  Config  ScopeConfigInterface $ scopeConfig

$ this-> scopeConfig = $ scopeConfig;

public function execute (observer $ observer)

$ productName = array ();
$ productNames = & # 39; & # 39 ;;
$ itemsArray = $ observer-> getCart () -> getQuote () -> getItems ();
foreach ($ itemsArray as $ item) {
$ productName[] = $ item-> getName ();
if (is_array ($ productName)) {
$ productNames. = implode (& # 39 ;; & # 39 ;, $ productName);

$ abdata['productNames'] = $ productNames;
returns $ abdata;

magento2 – Magento2: I need to perform the role of observer through the work Cron

NO, it is not a difficult requirement to run the observer in cron. Here I am using the cron / run.php file to use in cronjob. But I'm not getting quote data in this file.

Here is my code:

namespace ABC Abandon Cron;

use Psr Log LoggerInterface;
class run {

protected $ logger;
protected $ scopeConfig;
public function __constructed (
LoggerInterface $ logger,
Magento Framework App Config ScopeConfigInterface $ scopeConfig
) {
$ this-> logger = $ logger;
$ this-> scopeConfig = $ scopeConfig;


public function execute () {

$ objectManager = Magento Framework App ObjectManager :: getInstance ();
$ cartObj = $ objectManager-> get (& # 39; Magento Checkout Model Cart & # 39;);
$ quoteId = $ cartObj-> getQuote () -> getId ();
$ itemsArray = $ cartObj-> getQuote () -> getAllItems ();
foreach ($ itemsArray as $ item) {
$ productName[] = $ item-> getName ();
if (is_array ($ productName)) {
$ productNames. = implode (& # 39 ;; & # 39 ;, $ productName);
$ abdata[‘productNames’] = $ productNames;
$ abdata[‘quoteid’] = $ quoteId;
returns $ abdata;


magento2.3 – Extra column in catalog_product_entity_tier_price that is not saved / updated as an observer in Magento 2.3

Trying to make this work in Magento 2.3

The additional column in catalog_product_entity_tier_price is not saved / updated in the observer

Progress so far

You can get the column to show, but it will not be saved. Also, if you manually edit in db, the value is deleted in the next saved if the price or quantity changes.

Does anyone have this change working in Magento 2.3?

magento2: how to get event data from custom page events for the observer in magento 2?

I have a custom observer module in Magento 2


after the event happened I want the
details of the page – data


how can I do this

So, if I create an order observer, I get an order from the observer

Observer pattern IS-A Command pattern?

This is the observer pattern

enter the description of the image here

This is the command pattern, with a highlight to make it similar to the observer pattern

UML modified from command pattern

The only differences are:

  • Receiver IS-A Invoker in observer pattern
  • Observer Pattern knows when to call Run() in the command pattern


How many observer interface for observer pattern?

I'm reading about Observer Pattern of GoF, the UML in the book: UML of the observer pattern

How many observer interfaces are there in a system? Let's say I have two different ConcreteSubjects, would they share the same Observer interface? Or is it that each theme must have its own observer interface to which those ConcreteObserver can subscribe?

If the whole system shares an observer interface, how can a class object subscribe to many different ConcreteSubjects? So it seems that each different Subject / ConcreteSubject should have its own observer interface?