1.0.3 • Published 1 year ago

bufnita v1.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

🦉 Bufnița

Bufnița is a contract observer and indexer library, that reads events from a web3 provider, stores them into a MongoDB database, notify them to webhooks and execute callbacks.

1. Usage

Bufnița can be used as library or as command line interface.

1.1 Command Line Interface

# Installation
npm i -g bufnita

# Execution

bufnita [manifest-file, default=manifest.yml]

1.2 Library

// Typescript
import Bufnita from "bufnita";
// Javascript
const Bufnita = require("bufnita");

Bufnita.create(options).then(() => {
	console.log("Observer has been initialized.");
});

1. Manifest File / Bufnița Options

The manifest file and Bufnița options share the same schema, but they are in different situations. Manifest file is the input for the command line, and the Bufnița options object is the input for the Bufnița library.

interface  IManifest {
	version:  string; // Version = "1"
	mongoUrl:  string; // MongoDB URL to connect
	web3Rpc:  string; // Web3 RPC to connect, websockets recommended
	interval?:  number; // How many time between http requests (Http web3rpc only)
	
	contracts?: { // Contracts to observe
		[contractName:  string]:  { // Contract Name
			address:  string; // Contract Address
			events?:  string[] // Events to Observe, All by default
			abi:  string; // ABI Json File Path
			callbacks?: { // Not available in yml, callbacks
				[event:  string]: (data:  any) =>  any // Callbacks are executed by event name
			}
		}
	}
	
	collections?: { // Mongodb data where events & contract meta will be stored
		events?:  string; // default = bufnita-events
		contracts?:  string; // default = bufnita-contracts
	}
	
	rsa?: { // RSA Keys to sign webhooks, default = no signature
		priv:  string; // Path to rsa priv key
		pub:  string; // Path to rsa pub key
	}
	
	webhooks?:  string[]; // List of url where events will be notified
}

3. Flowchart

enter image description here

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.1-d

1 year ago

1.0.1-c

1 year ago

1.0.2-a

1 year ago

1.0.1-b

1 year ago

1.0.1-a

1 year ago

1.0.0-h

1 year ago

1.0.0-g

1 year ago

1.0.0-f

1 year ago

1.0.0-e

1 year ago

1.0.0-d

1 year ago

1.0.0-c

1 year ago

1.0.0-b

1 year ago

1.0.0-a

1 year ago

1.0.0

1 year ago