vulpemventures / neutrino-elements

MIT License
3 stars 4 forks source link

First implementation of services #2

Closed louisinger closed 2 years ago

louisinger commented 2 years ago

This PR proposes the first implementation of NodeService and ScannerService.

The terminology of services and methods can differ from the ones discussed in #1. I finally splited the code into two services:

Elements Full node (NodeService)

Scanner service (BIP158)

How to quick test

This PR provides a simple CLI using to test this POC full node + filter scanner, u can run the following:

go run ./cmd start 

(or build the binary)

The start command lets u run a full node which will sync with your nigiri instance. It also silently run a ScannerService and sends a ScanRequest on the following address:

el1qq2enu72g3m306antkz6az3r8qklsjt62p2vt3mlfyaxmc9mwg4cl24hvzq5sfkv45ef9ahnyrr6rnr2vr63tzl5l3jpy950z7

As soon as you faucet this address, the scanner will log a report with txid.

PS: Note that this "WatchItem" is an AddressWatchItem, we can also watch for outpoint to be spent with OutpointWatchItem or whatever implementing WatchItem interface.

About WASM

it closes #1

@tiero @altafan please, can u review this (consider this as a proof of concept, not a polished work I think the full node needs extra work to be a "real" full node for instance)