• This repository has been archived on 30/Oct/2018
  • Stars
    star
    333
  • Rank 126,599 (Top 3 %)
  • Language
    JavaScript
  • License
    GNU Affero Genera...
  • Created about 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deprecated. Docker Daemon + CLI for farming data on the Storj v2 network.

Notice: Development on this repo is on pause until we finish our v3 rearchitecture. Please see https://github.com/storj/storj for ongoing v3 development.

Storj Share Daemon

Build Status Coverage Status NPM License Docker

Daemon + CLI for farming data on the Storj network, suitable for standalone use or inclusion in other packages.

Installation via Arch User Repositories

storjshare daemon is also available for Arch Linux as a package on the AUR as storjshare-daemon. Install it via your favourite AUR helper.

Manual Installation

Make sure you have the following prerequisites installed:

  • Git
  • Node.js LTS (8.x.x)
  • NPM
  • Python 2.7
  • GCC/G++/Make

Node.js + NPM

GNU+Linux & Mac OSX

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash

Close your shell and open an new one. Now that you can call the nvm program, install Node.js (which comes with NPM):

nvm install --lts

Windows

Download Node.js LTS for Windows, launch the installer and follow the setup instructions. Restart your PC, then test it from the command prompt:

node --version
npm --version

Build Dependencies

GNU+Linux

Debian based (like Ubuntu)

apt install git python build-essential

Red Hat / Centos

yum groupinstall 'Development Tools'

You might also find yourself lacking a C++11 compiler - see this

Mac OSX

xcode-select --install

Windows

npm install --global windows-build-tools

Install

Once build dependencies have been installed for your platform, install the package globally using Node Package Manager:

npm install --global storjshare-daemon

Usage (CLI)

Once installed, you will have access to the storjshare program, so start by asking it for some help.

storjshare --help

  Usage: storjshare [options] [command]


  Commands:

    start       start a farming node
    stop        stop a farming node
    restart     restart a farming node
    status      check status of node(s)
    logs        tail the logs for a node
    create      create a new configuration
    destroy     kills the farming node
    killall     kills all shares and stops the daemon
    daemon      starts the daemon
    help [cmd]  display help for [cmd]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

You can also get more detailed help for a specific command.

storjshare help create

  Usage: storjshare-create [options]

  generates a new share configuration

  Options:

    -h, --help                 output usage information
    --storj <addr>             specify the STORJ address (required)
    --key <privkey>            specify the private key
    --storage <path>           specify the storage path
    --size <maxsize>           specify share size (ex: 10GB, 1TB)
    --rpcport <port>           specify the rpc port number
    --rpcaddress <addr>        specify the rpc address
    --maxtunnels <tunnels>     specify the max tunnels
    --tunnelportmin <port>     specify min gateway port
    --tunnelportmax <port>     specify max gateway port
    --manualforwarding         do not use nat traversal strategies
    --logdir <path>            specify the log directory
    --noedit                   do not open generated config in editor
    -o, --outfile <writepath>  write config to path

Usage (Programmatic)

The Storj Share daemon uses a local dnode server to handle RPC message from the CLI and other applications. Assuming the daemon is running, your program can communicate with it using this interface. The example that follows is using Node.js, but dnode is implemented in many other languages.

const dnode = require('dnode');
const daemon = dnode.connect(45015);

daemon.on('remote', (rpc) => {
  // rpc.start(configPath, callback);
  // rpc.stop(nodeId, callback);
  // rpc.restart(nodeId, callback);
  // rpc.status(callback);
  // rpc.destroy(nodeId, callback);
  // rpc.save(snapshotPath, callback);
  // rpc.load(snapshotPath, callback);
  // rpc.killall(callback);
});

You can also easily start the daemon from your program by creating a dnode server and passing it an instance of the RPC class exposed from this package.

const storjshare = require('storjshare-daemon');
const dnode = require('dnode');
const api = new storjshare.RPC();

dnode(api.methods).listen(45015, '127.0.0.1');

Configuring the Daemon

The Storj Share daemon loads configuration from anywhere the rc package can read it. The first time you run the daemon, it will create a directory in $HOME/.config/storjshare, so the simplest way to change the daemon's behavior is to create a file at $HOME/.config/storjshare/config containing the following:

{
  "daemonRpcPort": 45015,
  "daemonRpcAddress": "127.0.0.1",
  "daemonLogFilePath": "",
  "daemonLogVerbosity": 3
}

Modify these parameters to your liking, see example/daemon.config.json for detailed explanation of these properties.

Debugging the Daemon

The daemon logs activity to the configured log file, which by default is $HOME/.config/storjshare/logs/daemon.log. However if you find yourself needing to frequently restart the daemon and check the logs during development, you can run the daemon as a foreground process for a tighter feedback loop.

storjshare killall
storjshare daemon --foreground

Connecting to a remote Daemon

Note: Exposing your storjshare-daemon to the Internet is a bad idea as everybody could read your Private Key!

To connect to a remote running daemon instance you will first need to ensure this daemon is running on a different address than the default 127.0.0.1. This can be achieved by configuring the Daemon.

After your storjshare-daemon is reachable (eg. within your home network) you can use -r or --remote option (on supported commands) to use the specified IP/hostname and port to connect to, instead of 127.0.0.1.

Note that this option does not support to start the storjshare-daemon on a different system, only connect to an already running one!

Example to connect to remote daemon running on 192.168.0.10 on the default port (45015) and show the status:

storjshare status --remote 192.168.0.10

If the port is changed, just append it like so:

storjshare status --remote 192.168.0.10:51000

Migrating from storjshare-gui or storjshare-cli

storjshare-gui

If you are using the storjshare-gui package you can go on with the latest GUI release. You don't need to migrate but if you like you can do it. If you choose to migrate from the old storjshare-gui to the CLI version of storjshare-daemon, please follow the instructions below.

storjshare-cli

Storj Share provides a simple method for creating new shares, but if you were previously using the storjshare-cli package superceded by this one, you'll want to migrate your configuration to the new format. To do this, first you'll need to dump your private key before installing this package.

If you accidentally overwrote your old storjshare-cli installation with this package, don't worry - just reinstall the old package to dump the key, then reinstall this package.

Step 0: Dump Your Private Key

storjshare-gui

Open %AppData%\Storj Share\settings.json in any texteditor. For each GUI drive you will find the private key and the dataDir. Use these information and go on with Step 1 and 2.

{
  "tabs": [
    {
      "key": "4154e85e87b323611cba45ab1cd51203f2508b1da8455cdff8b641cce827f3d6",
      "address": "0xfB691...",
      "storage": {
        "dataDir": "D:\\Storj\\storjshare-5f4722"
      }
    },
    {
      "key": "0b0341a9913bb84b51485152a1b0a8a6ed68fa4f9a4fedb26c61ff778ce61ec8",
      "address": "0xfB691...",
      "storage": {
        "dataDir": "D:\\Storj\\storjshare-48a1c4"
      }
  ],
  "appSettings": {...}
}

storjshare-cli

You can print your cleartext private key from storjshare-cli, using the dump-key command:

storjshare dump-key
 [...]  > Unlock your private key to start storj  >  ********

 [info]   Cleartext Private Key:
 [info]   ======================
 [info]   4154e85e87b323611cba45ab1cd51203f2508b1da8455cdff8b641cce827f3d6
 [info]   
 [info]   (This key is suitable for importing into Storj Share GUI)

If you are using a custom data directory, be sure to add the --datadir <path> option to be sure you get the correct key. Also be sure to note your defined payout address and data directory.

Step 1: Install Storj Share and Create Config

Now that you have your private key, you can generate a new configuration file. To do this, first install the storjshare-daemon package globally and use the create command. You'll need to remove the storjshare-cli package first, so make sure you perform the previous step for all shared drives before proceeding forward.

npm remove -g storjshare-cli
npm install -g storjshare-daemon

Now that you have Storj Share installed, use the create command to generate your configuration.

storjshare create --key 4154e8... --storj 0xfB691... --storage <datadir> -o <writepath>

This will generate your configuration file given the parameters you passed in, write the file to the path following the -o option, and open it in your text editor. Here, you can make other changes to the configuration following the detailed comments in the generated file.

Step 2: Use The New Configuration

Now that you have successfully migrated your configuration file, you can use it to start the share.

storjshare start --config path/to/config.json

  * daemon is not running, starting...

  * starting share with config at path/to/config.json

Updating storjshare and restoring sessions

If you want to upgrade storjshare you can save your current session and reload it after updating

storjshare save
storjshare killall
npm install -g storjshare-daemon
storjshare daemon &
storjshare load

License

Storj Share - Daemon + CLI for farming data on the Storj network.
Copyright (C) 2017 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/.

More Repositories

1

storj

Ongoing Storj v3 development. Decentralized cloud object storage that is affordable, easy to use, private, and secure.
Go
2,926
star
2

drpc

drpc is a lightweight, drop-in replacement for gRPC
Go
1,480
star
3

storjshare-gui

Development on pause
JavaScript
465
star
4

core

Deprecated. Implementation of the Storj v2 protocol for Node.js.
JavaScript
398
star
5

awesome-storj

A curated list of projects, tools, and resources for Storj
227
star
6

libstorj

Deprecated. Asynchronous multi-platform C library and CLI for encrypted file transfer on the Storj network.
C
120
star
7

uplink

Storj network Go library
Go
107
star
8

bridge

Deprecated. Access the Storj network via simple REST API.
JavaScript
76
star
9

docs

Source for Storj docs
JavaScript
68
star
10

gateway-st

Single-tenant, S3-compatible server to interact with the Storj network
Go
64
star
11

kfs

Deprecated
JavaScript
61
star
12

storj.io

The Storj website.
HTML
40
star
13

edge

Storj edge services (including multi-tenant, S3-compatible server to interact with the Storj network)
Go
40
star
14

common

Storj common packages
Go
29
star
15

storj-mobile

Storj Mobile Apps
JavaScript
28
star
16

storj.js

Deprecated. Browser library for interacting with Storj.
JavaScript
27
star
17

node-libstorj

Deprecated. Node.js library for encrypted file transfer on the Storj network.
JavaScript
25
star
18

uplink-c

Uplink C library
C
25
star
19

whitepaper

The Storj Whitepaper
TeX
25
star
20

dbx

A neat codegen-based database wrapper written in Go
Go
24
star
21

up

Docker-compose files for running full Storj network locally
Go
23
star
22

storj-python-sdk

Deprecated. A Python SDK for the Storj API.
Python
23
star
23

uplink-android

Storj network Android library
Java
19
star
24

complex

Deprecated. Manage many renter nodes with the same identity with remote control capabilities
JavaScript
16
star
25

ipfs-go-ds-storj

Storj datastore for IPFS
Go
15
star
26

uplink-java

Storj network Java library
Java
15
star
27

archview

Create architectural diagrams from Go code.
Go
14
star
28

storj-node-heroku-example

Deprecated. Example Dyno for Heroku
JavaScript
14
star
29

sips

Storj Improvement Proposals.
14
star
30

tardigrade.io

The Tardigrade website.
13
star
31

bridge-gui

Deprecated
JavaScript
11
star
32

bridge-gui-vue

Deprecated. A web-based GUI for Storj Bridge
Vue
11
star
33

roadmap

Storj Public Roadmap
10
star
34

blog

Company blog, built with Hugo and hosted on Netlify
JavaScript
9
star
35

storjspace

Deprecated. Vue / Electron GUI app for uploading and downloading files to the Storj network.
JavaScript
9
star
36

private

Packages needed for different projects, however not intended for public use.
Go
8
star
37

billing

Deprecated. Billing service for the Storj V2 platform
JavaScript
8
star
38

java-libstorj

Deprecated. Java library for encrypted file transfer on the Storj network.
Java
8
star
39

linksharing

Link Sharing Service
Go
8
star
40

uuid-mailer

Deprecated. Forward mail from obfuscated email to user email.
JavaScript
6
star
41

picobuf

Small replacement for subset of protobuf.
Go
6
star
42

dev-meetings

Summary and logs of dev meetings at https://community.storj.io/channel/dev
6
star
43

ci

CI environment dependencies and tools for Jenkins
Go
6
star
44

uplink-chrome

This is an app that allows you to interact with the Storj network through the Chrome browser.
JavaScript
6
star
45

storagenode-deb

Debian Packaging for Storj Storage Node
Elixir
6
star
46

illustrated

Diagrams to understand Storj architecture and internals better.
6
star
47

drpc-cpp

DRPC for C++ (experimental)
C++
5
star
48

zipper

Go
5
star
49

pushy-cat

For automatically updating static websites from Github webhooks.
Python
5
star
50

service-storage-models

Deprecated. Common storage models for various Storj services
JavaScript
5
star
51

storjscan

Go
5
star
52

browser

A Vue component for managing files on Storj, via gateway-mt.
CSS
5
star
53

mongodb-adapter

Deprecated. A storj-lib compatible storage adapter for mongodb.
JavaScript
5
star
54

android-libstorj

Deprecated. Android library for encrypted file transfer on the Storj network.
C
5
star
55

integration

Deprecated. For development and integration testing of all of the distributed Storj network services.
Shell
4
star
56

stats

Storj DCS Public Network Statistics
4
star
57

benchmark

Storj Network benchmarking
Go
4
star
58

chef-storj

Deprecated. Chef cookbook for automating the creation of Storj applications and services
Ruby
4
star
59

crypto-batch-payment

A high volume ERC20 token payment application.
Go
4
star
60

terraform-provider-storj

A Terraform provider for the Storj ecosystem.
Go
4
star
61

heroku-addon

Deprecated. Service that manages different types of external service integrations with Storj.
JavaScript
4
star
62

storjshare-dns

Deprecated. DNS service for storjshare nodes
JavaScript
4
star
63

storjpics

Photo Gallery Generator for Storj DCS
SCSS
4
star
64

ditto

Mirroring service for Storj
Go
4
star
65

ipfs-demo

3
star
66

service-auditor

Deprecated. Send and retrieve queued Storj audit proofs
JavaScript
3
star
67

eventkit

a go library for reporting multidimensional events over UDP
Go
3
star
68

gospace

Go workspace tooling for linter + module incompatibilities
Go
3
star
69

storj-analytics

Deprecated. Analytics wrapper for Storj services.
JavaScript
3
star
70

autobin

Deprecated. Cross platform batch / shell scripts used to automatically build binaries.
Shell
3
star
71

heroku-email-service

Deprecated. Maps heroku accounts to real email addresses and forwards the email
JavaScript
3
star
72

huggingface-hub-storj-patch

Monkey patch for HuggingFace Hub to download Git-LFS blobs from Storj
Python
3
star
73

utp-go

A porting of Transmission's libutp to Golang
Go
3
star
74

ipfs-user-mapping-proxy

Go
2
star
75

apt-transport-storj

APT transport that fetches packages and package lists from the Storj network
Go
2
star
76

storj-crypto

Deprecated. Modularized crypto for Storj.
JavaScript
2
star
77

service-mailer

Deprecated. Email dispatcher and templates for Storj services.
HTML
2
star
78

service-error-types

Deprecated. Common error types for various Storj services.
JavaScript
2
star
79

secure-stable-diffusion

Docker image for secure AI model training and inference with Stable Diffusion and Storj.
Jupyter Notebook
2
star
80

service-middleware

Deprecated. Express middleware for authenticating with Storj services using ECDSA.
JavaScript
2
star
81

access-empty-passphrase-checker

A tool to allow a Storj DCS user to determine whether they have unencrypted files uploaded to a project.
Go
2
star
82

data-api

Deprecated. Storj internal data API for retrieving and delivering consistent data from multiple backend data sources.
JavaScript
2
star
83

research

Research and draft specifications for improvements to the Storj network
Go
2
star
84

monkit-jaeger

Jaeger plugin for Monkit
Go
2
star
85

storj-admin-cli

Deprecated. A command line program for administrative tasks at Storj Labs
JavaScript
1
star
86

ios-libstorj

iOS library for encrypted file transfer on the Storj network.
C
1
star
87

dotworld

Go
1
star
88

template

Template repository for projects using github.com/storj/ci
Go
1
star
89

docker-registry

Docker registry with Storj backend
Go
1
star
90

tardigrade.io-forked

Built with Hugo
HTML
1
star
91

storagenode-docker

Auto-updated Storagenode container for Storj network
Shell
1
star
92

storj-bounty-program

Deprecated. Information about the bounty program and descriptions of projects that have bounties
HTML
1
star
93

homebrew-tap

Homebrew formulae to uplink and other Storj binaries
Ruby
1
star
94

sandbox

GARBAGE repository to test gerrit<->storj integration.
Shell
1
star
95

gcfAccess

Google Cloud Function definitions for manipulating Access Grants
Go
1
star