Giter Site home page Giter Site logo

braydonf / storj-complex Goto Github PK

View Code? Open in Web Editor NEW

This project forked from storj-archived/complex

0.0 2.0 0.0 808 KB

Manage many renter nodes with the same identity with remote control capabilities.

Home Page: https://storj.io

License: GNU Affero General Public License v3.0

JavaScript 97.86% Shell 2.14%

storj-complex's Introduction

Storj Complex

Build Status Coverage Status NPM License

Manage many renter nodes with the same identity with remote control capabilities! Complete documentation can be found here.

Prerequisites

Installation

Command Line Interface

npm install -g storj-complex

Programmatic

npm install storj-complex --save

Usage

Command Line Interface

storj-complex -c <path/to/config.json>

Programmatic

Set up a renter service and landlord to control it.

var complex = require('storj-complex');
var landlord = complex.createLandlord({ /* landlord config */ });
var renter = complex.createRenter({ /* renter config */ });

// Landlords boss around renters...
// Rather they control all renters connected to the same RabbitMQ
landlord.start(function(err) {
  // Landlord is connected and service listening for RPC commands
});

// Renters do what landlords tell them...
// Rather they listen for tasks and coordinate to appease their masters
renter.start(function(err) {
  // Renter is connected to the storj network and listening for work
});

// Landlords and Renters are ReadableStreams
// The pump out newline-terminated JSON strings for logging information
landlord.pipe(process.stdout);
renter.pipe(process.stdout);

Create a client to issue RPC commands to the landlord:

var complex = require('storj-complex');
var client = complex.createClient({ /* options */ });
var contract = new storj.Contract({ /* contract data */ });

// The client mimics storj-lib's RenterInterface
client.getStorageOffer(contract, function(err, farmer, contract) {
  // Storage offer received and accepted for the supplied farmer
});

Generating an HD Key

Here are the detailed steps for creating an HD key for configuration:

// require necessary libs, get entropy, and create a key
const HDKey = require('hdkey');
const seed = require('crypto').randomBytes(64);
const hdkey = HDKey.fromMasterSeed(seed);

// to keep for other future uses
console.log(hdkey.privateExtendedKey);

// deriving the key for complex use (detailed in sip32)
const complexKey = hdkey.derive("m/3000'/0'");

// this will output expected private key used in configs
console.log(complexKey.privateExtendedKey);

// for this config value in complex
let options = {};
options.networkPrivateExtendedKey = complexKey.privateExtendedKey;

// this is the key used in contracts and contacts
console.log(complexKey.publicExtendedKey);

The above has been simplified into a utility, and can be used via:

const {randomBytes} = require('crypto');
const {createComplexKeyFromSeed} = require('storj-lib').utils;
const complexKey = createComplexKeyFromSeed(randomBytes(64));

For more details see SIP32:

License

Storj Complex - Manage many renter nodes with remote control capabilities Copyright (C) 2016 Storj Labs, Inc

This program 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 http://www.gnu.org/licenses/.

storj-complex's People

Contributors

braydonf avatar bookchin avatar phutchins avatar navillasa avatar bryanchriswhite avatar littleskunk avatar mobyvb avatar pgerbes1 avatar aleitner avatar dylanlott avatar marcbachmann avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.