All Projects → enigmampc → Enigma P2p

enigmampc / Enigma P2p

Licence: agpl-3.0
The Enigma Worker Peer-to-Peer (P2P) package written in Node.js based on libp2p-js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Enigma P2p

Covenantsql
A decentralized, trusted, high performance, SQL database with blockchain features
Stars: ✭ 1,148 (+3603.23%)
Mutual labels:  blockchain, p2p, decentralized
Bitcoin Kit Ios
Full Bitcoin library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash and Dash blockchains.
Stars: ✭ 134 (+332.26%)
Mutual labels:  blockchain, p2p, decentralized
Conceal Core
Conceal Core - Daemon & Wallets (CLI)
Stars: ✭ 72 (+132.26%)
Mutual labels:  blockchain, p2p, decentralized
Dawn
global hosting, financial automation, server-less web components
Stars: ✭ 40 (+29.03%)
Mutual labels:  blockchain, p2p, decentralized
Gun
An open source cybersecurity protocol for syncing decentralized graph data.
Stars: ✭ 15,172 (+48841.94%)
Mutual labels:  blockchain, p2p, decentralized
Particl Desktop
The GUI application for Particl Markeplace and PART coin wallet. A decentralized peer to peer marketplace –free, secure, private, untraceable.
Stars: ✭ 131 (+322.58%)
Mutual labels:  blockchain, p2p, decentralized
Lbry Sdk
The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
Stars: ✭ 7,169 (+23025.81%)
Mutual labels:  blockchain, p2p, decentralized
Gym Fx
Forex trading simulator environment for OpenAI Gym, observations contain the order status, performance and timeseries loaded from a CSV file containing rates and indicators. Work In Progress
Stars: ✭ 151 (+387.1%)
Mutual labels:  blockchain, p2p, decentralized
Unstoppable Wallet Ios
A secure and decentralized Bitcoin and other cryptocurrency wallet for iPhone. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 180 (+480.65%)
Mutual labels:  blockchain, p2p, decentralized
Unstoppable Wallet Android
A secure and decentralized Bitcoin and other cryptocurrency wallet for Android phones. Supports Bitcoin, Ethereum, EOS, Binance Chain, Bitcoin Cash, DASH, ...
Stars: ✭ 165 (+432.26%)
Mutual labels:  blockchain, p2p, decentralized
Decentralized Internet
A SDK/library for decentralized web and distributing computing projects
Stars: ✭ 406 (+1209.68%)
Mutual labels:  blockchain, p2p, decentralized
Axe
decentralized cryptocurrency
Stars: ✭ 273 (+780.65%)
Mutual labels:  blockchain, p2p, decentralized
Awesome Ethereum
⚡️ Awesome Ethereum Resources
Stars: ✭ 459 (+1380.65%)
Mutual labels:  blockchain, p2p, decentralized
Orbit Db
Peer-to-Peer Databases for the Decentralized Web
Stars: ✭ 6,381 (+20483.87%)
Mutual labels:  p2p, decentralized
Js Ipfs
IPFS implementation in JavaScript
Stars: ✭ 6,129 (+19670.97%)
Mutual labels:  p2p, decentralized
Monero
Monero: the secure, private, untraceable cryptocurrency
Stars: ✭ 6,503 (+20877.42%)
Mutual labels:  blockchain, p2p
Rust Ipfs
The InterPlanetary File System (IPFS), implemented in Rust.
Stars: ✭ 739 (+2283.87%)
Mutual labels:  p2p, decentralized
Dtube
📺 d.tube app. A full-featured video sharing website, decentralized.
Stars: ✭ 569 (+1735.48%)
Mutual labels:  blockchain, decentralized
Ocsystem
🚀ONLYCHAIN blockchain underlying system-OCSystem
Stars: ✭ 713 (+2200%)
Mutual labels:  blockchain, p2p
Decentralized Energy Fabric On Ibp20
Set up a network on the IBM Blockchain Platform and deploy a decentralized energy smart contract on the network.
Stars: ✭ 29 (-6.45%)
Mutual labels:  blockchain, decentralized

enigma-p2p

The Enigma Worker P2P package written in Node.js based on libp2p-js

The P2P implementation of the Enigma Worker. This implementation is part of the Node stack running as a process on the OS communicating both with Core and the outside world.

Branch Build Code Coverage
Master Build Status codecov
Develop Build Status codecov

Table of Contents

Getting Started

Prerequisites

Installing

For using the released version (corresponding to the main branch of this repository) download it from npm:

npm i enigma-p2p

For installing a different branch of the repository:

git clone this repository

If running with Docker

cd into the project directory and type:

docker build .

To run later, save the final build hash or give it a name.

To run the node inside a container from the project directory type:

 docker run -v "$PWD":/usr/src/app -ti --net="host" <image-build-id> /bin/bash

Installing globally with nvm

  1. install nvm
  2. install some node version : $nvm install 10.16
  3. type npm install -g enigma-p2p
  4. to run global type : enigma-p2p-test <flags>

Incase of missing modules such as connect and tempdir install them in the same way.

npm install -g <missing module name>

Running the Node

Currently the node is started based on a command line interface (CLI). The node can be started from a single configuration file or with default configuration and CLI flags.

For usage example of a single configuration file see unit-test.

To launch the node using the CLI:

First enter the relevant directory:

cd ./src/cli

For help type:

$node cli_app.js -h

For interactive options help type help while running.

Example:

  1. launch a Bootstrap node:
node cli_app.js -i B1 -p B1 --core 127.0.0.1:1543 --proxy 3346 --random-db --mock-core
  1. launch a regular worker node that will connect to the bootstrap:
node cli_app.js -b B1 --core 127.0.0.1:6000 --random-db --mock-core
  1. launch ANOTHER regular worker node that will connect to the bootstrap:
node cli_app.js -b B1 --core 127.0.0.1:6001 --random-db --mock-core

In this example:

--core <ip>:<port> enigma-core uri. In this example we will be using a core simulation.

--mock-core launch a core simulation.

--proxy <port> will start up the JSON-RPC server as well.

--random-db is a must to generate a temporary database for the task management during testing.

-b flag for the bootstrap node, B1 is hard-coded for testing.

-i load specific node id from a hardcoded path.

-p run on a specific port since the bootstrap node is the first node everyone will connect to.

Running the tests

Tests are based on Mocha and can invoked by typing:

$npm test

Interacting with the node

JSON RPC API

The API for interacting with a proxy node.

Usage example:

  1. Start a bootstrap node which is also a Proxy
node cli_app.js -i B1 -p B1 --core 127.0.0.1:1543 --mock-core --proxy 3346 --random-db
  1. Start a regular worker that is NOT a proxy
node cli_app.js -b B1 --core 127.0.0.1:6000 --mock-core --random-db
  1. IMPORTANT: assuming the worker from #2 is the selected one, type selfSubscribe in the CLI so that the worker will subscribe to its own sign key. The key will be printed to std, copy it:
   [Wed Mar 27 2019 17:41:06 GMT+0200 (Israel Standard Time)] DEBUG subscribed to [0xd71c1bccb4b238cea332201bab1cd0fa70bec080] self signKey
  1. User wanting to call getWorkerEncryptionKey with curl see example and use the key from step 3 as the workerAddress parameter.

streams flow

Node health check

The node health check currently consists of the following checks:

  • The ability to interact with core
  • The ability to interact with Ethereum

To enable the health check, start the node with --health parameter. For example:

node cli_app.js -i B1 -p B1 --core 127.0.0.1:1543 --mock-core --health 12345

To query node status, curl can be used:

curl http://localhost:12345/healthcheck

Built With

Developers

If you wish to learn more about the project and contribute make sure to checkout:

  1. On boarding guide
  2. In depth design

Authors

License

The Enigma Worker P2P is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].