Fabric is an experimental approach to the secure establishment and execution of
peer-to-peer agreements, up to and including financial transactions. With a
robust library of common components, npm i @fabric/core
provides all the tools
one might require
during the development of a well-researched application of
decentralization technology.
🚨 Heads up! |
---|
Use of Fabric in production is not recommended in its current state. Please wait for an official release before deploying to production environments, or proceed at your own risk. |
If you're already familiar with node
and have a project already started, try
npm install --save @fabric/core
to install Fabric Core,
the primary library used for most Fabric-based applications.
You'll also want bitcoind
installed, and fully synchronized with your
preferred network. You can use scripts/playnet.sh
to run a local playnet
node, for which you can use the faucet: https://faucet.playnet.fabric.pub
Fork and clone the Fabric GitHub repository and launch a local
web server with npm run examples
to view the examples, or npm run docs
once
you're ready to integrate Fabric into your application.
See also BUILD.md
for a full guide, including Bitcoin and Lightning.
git clone [email protected]:FabricLabs/fabric.git
cd fabric
git checkout feature/v0.1.0-RC1
npm install -g
npm run build
npm run cli
provides a direct command-line interface to the Fabric network.npm run dev
serves a developer interface over localhost HTTP.npm run docs
creates a local HTTP server for browsing documentation.npm run examples
creates a local HTTP server for interacting with examples.npm start
creates a local Fabric node.
Installing Fabric from npm (npm i @fabric/core
) will generally compile the
following dependencies from the local system:
secp256k1
level
zeromq
The Fabric reference implementation exposes a simple message-passing interface using the actor model, enabling your downstream applications to subscribe to simple events for rapid prototyping of distributed applications.
Using the EventEmitter
pattern, you can create an instance of Fabric to use
it as an event source.
const Fabric = require('@fabric/core');
const fabric = new Fabric();
fabric.on('message', function (message) {
console.log('Received message from Fabric:', message);
});
fabric.start();
service
now contains a full instance of Fabric, including SET
and GET
methods for publishing and retrieving documents. Use npm run examples
to see
more.
Message types are as follows:
The generic message event.
Properties:
@type
name of the event type.@data
the content of the event, if any.
Fabric generates a fabric.min.js
bundle, which can be included with any HTML
document to expose the API in a browser.
Several other projects have used the name Fabric, as it's a great way to describe a network of things, conjuring feelings of nets and webs. Here are some links to them, as they offer some interesting things completely unrelated to our goals.
- Fabric python project (#fabric on Freenode)
- Fabric application framework by Twitter
- HyperLedger Fabric, by IBM
Fabric is an extensible framework, supporting a variety of plugins.
Package | Description | Status |
---|---|---|
@fabric/http |
serve Fabric apps to the legacy web (HTTP) | |
@fabric/github |
interact with GitHub through Fabric | |
@fabric/matrix |
connect to Matrix servers | |
@fabric/twilio |
send (and receive) SMS and phone calls | |
@fabric/zapier |
interact with arbitrary zapier triggers | |
@fabric/doorman |
an artificially intelligent assistant |
Several successful projects are built with or are running on Fabric, including:
- Doorman, an artificially intelligent assistant
- IdleRPG, a simple RPG game which rewards you for remaining idle
- Verse, a virtual universe simulator
To add your project to the list, read the API docs, create a public repository for the source code, then edit this file to include a link to your work.
The best place to get started is in the #learning channel, a collection of empassioned educators eager to help you.
Fabric on Twitter: @FabricProtocol