A general purpose append-only log for capturing filtered Bitcoin events
1. What is Eventchain?
If Planaria is an event-driven application backend framework, Eventchain is a general purpose event log which filters and stores the events themselves in a file and leaves the rest to you: the developer.
There is no convention. There is no framework. There is no restriction. You simply read the self updating append-only log file yourself, whichever way you want, and process the events to build your own backend, your way.
Build a NoSQL DB, Build a Relational SQL Database, Build a Graph Database, Build a File System, Build a Bitcoin Transaction, Train an AI, Use Java, Use C#, Use Ruby, Use Python, Use PHP, Use C++, Use Go...
Do whatever you want, with whichever programming language you want.
A. Versatile Append-only Log
Eventchain lets developers filter and capture Bitcoin events as a reusable append-only log file instead of firing once and forgetting. Because it's stored as a flat plain text file, you can easily:
- Use any programming language to read and process the events.
- Process the events in any way you want. Example: rewind or fast forward in time, batch process events, etc.
- Prune older events you don't need anymore.
B. Bitcoinless Bitcoin Event Emitter
Powered by Bitbus, Eventchain lets you build your own Bitcoin-powered backend WITHOUT having to run a Bitcoin full node yourself. The whole architecture is designed with the following qualities in mind:
- Portable: The Eventchain is deliberately stored as a plain text file, there is no complicated system to ensure immutability because that part is taken care of by Bitcoin.
- Robust: If you have been using Bitsocket to filter application specific blockchain events in realtime, you may have wanted a way to store the events first and then process them next, instead of processing them all in realtime in an ephemeral manner. This is what Eventchain lets you do.
- Business Friendly: Because all events are stored first before being processed, businesses can be sure they have all the trace of the events they processed, allowing them to implement accountability.
- Convertible: Currently Eventchain is powered by Bitbus, but in the future it will support both Bitbus AND Bitcoin as host (once Neon Planaria supports this feature), so developers have the option to switch back and forth between running their own Bitcoin full node and using Bitbus. Learn more about how this will be implemented
2. Eventchain vs. Bitbus
Eventchain is powered by Bitbus at a low level. When you start an Eventchain, it first constructs a Bitbus, and then derives the corresponding linear chain of events from it.
Unlike Bitbus whose main purpose is to synchronize a subset of the blockchain on a per-block basis (590000.json
, 590001.json
, mempool.json
), Eventchain is a single file (chain.txt
) that stores the entire history in a linear log file.
This means you can easily:
- Seek to certain point in time
- Listen to the tail of the log file to process events in realtime.
- Prune older events you don't need.
3. Eventchain vs. Planaria
Unlike Planaria which immediately fires events as they happen and expects developers to implement the event handlers to build a state machine backend, Eventchain simply stores the events in a file. And from there developers can do whatever they want with it.
This unbundles the processing of events from emitting of events, making it highly flexible and versatile.
- Language Agnostic: Because it's a plain text file, you can use any programming language to read and process it. Use your favorite language or favorite application framework to build your own backend from Bitcoin.
- Business Friendly: By keeping a separate event log file instead of firing and forgetting, You can keep track of all the events you've processed. This is important for mission critical businesses because it lets you construct a very robust system which keeps track of all the processed events.
- Flexible: Because it's just a file, you can do whatever you want with the events. There is no framework. It doesn't constrain you into doing things in certain ways.
- Time Travel: Because Eventchain stores every event without losing any, you don't even need to construct the backend in realtime. Pause, Resume, Rewind, Fast Forward, Replay. No constraints. You can even jump back and forth in time.
- Seekable: Every event is uniquely identified by a combination of
unix timestamp
andhash
(block hash foronblock
and transaction hash foronmempool
), so you can programmatically rewind or fast forward to any point in time. - Prunable: Because it's based on a single self-updating file, you can prune older events if you want.
- Replayable: Because it's built on top of Bitbus, you can effortlessly reconstruct the tape at anytime, as long as you don't prune your Bitbus.
In fact, the Eventchain itself is internally a self-contained Neon Planaria machine which autonomously updates the append-only log file.