Constructor
new Fabric(config)
The Fabric type implements a peer-to-peer protocol for
establishing and settling of mutually-agreed upon proofs of
work. Contract execution takes place in the local node first,
then is optionally shared with the network.
Utilizing
Parameters:
Name | Type | Description |
---|---|---|
config |
Vector | Initial configuration for the Fabric engine. This can be considered the "genesis" state for any contract using the system. If a chain of events is maintained over long periods of time, `state` can be considered "in contention", and it is demonstrated that the outstanding value of the contract remains to be settled. |
- Source:
Fires:
- Fabric#event:thread
- Fabric#event:step Emitted on a `compute` step.
Methods
compute() → {Fabric}
Process the current stack.
- Source:
Returns:
Resulting instance of the stack.
- Type
- Fabric
push(value) → {Stack}
Push an instruction onto the stack.
Parameters:
Name | Type | Description |
---|---|---|
value |
Instruction |
- Source:
Returns:
- Type
- Stack
(async) register(service)
Register an available Service using an ES6 Class.
Parameters:
Name | Type | Description |
---|---|---|
service |
Class | The ES6 Class. |
- Source:
trust(source) → {Fabric}
Blindly consume messages from a Source, relying on `this.chain` to
verify results.
Parameters:
Name | Type | Description |
---|---|---|
source |
EventEmitter | Any object which implements the `EventEmitter` pattern. |
- Source:
Returns:
Returns itself.
- Type
- Fabric