This package exposes a module that provides all of the tools needed to integrate with the Storj network. Complete documentation can be found here.
- Node.js v4.x.x
- Git
- Python v2.x.x
Install Node.js and it's package manager NPM using Node Version Manager:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
Detailed NVM installation instructions can be found here.
After NVM is installed, source your ~/.bashrc
, ~/.profile
, or ~/.zshrc
depending on your shell of choice:
source ~/.zshrc
Now that you can call the nvm
program, install Node.js (which comes with NPM):
nvm install 4.4.4
You'll also need to make sure you have a C++ compiler installed before proceeding to the next step. Debian based distributions can install the
build-essential
package using APT and Mac OSX users can install withxcode-select --install
and follow the wizard.
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
Install the latest version of Python 2.7, launch the installer and follow the instructions. To use Python from the shell and add it to the system you have to add the path in "System Variables":
Navigate to:
Control Panel > System > Advanced System Settings > Environment Variables > System Variables > Path > Edit
Then add ;C:\Python27
or the installation path and test it in the command
prompt by running:
python -V
Next, install Git for your Windows
version. Then, install Visual Studio Community 2015
and during the setup choose Custom Installation > Programming Languages
and
select Visual C++ and Common Tools for Visual C++.
Finally, set the new environment variable in the Windows command prompt with:
setx GYP_MSVS_VERSION 2015
```
### Installing on Windows (Automated)
Install utilizing automated script
<a href="https://github.com/Storj/storj-automation/archive/master.zip">https://github.com/Storj/storj-automation/archive/master.zip</a>
Run the `install.bat` located in `/Windows/storj-automate`
Quick Start (Programmatic)
--------------------------
Install *locally* as user with NPM:
```
npm install storj --save
```
Import the `storj` module, generate a key pair, configure your persistence
layer, and join the network in just a few lines of code:
```
var storj = require('storj');
var network = storj.Network({
keypair: storj.KeyPair(/* existing_key */),
manager: storj.Manager(storj.LevelDBStorageAdapter('/path/to/datadir')),
address: 'ip.or.hostname',
port: 4000
});
network.join(/* callback */);
```
Quick Start (Command Line Interface)
------------------------------------
Install *globally* as user with NPM:
```
npm install storj --global
```
Use the linked command line interface:
```
storj --help
```
License
-------
Storj Core - Implementation of the Storj protocol for Node.js
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.
*Certain parts of this program are licensed under the GNU Lesser General
Public License as published by the Free Software Foundation. You can
redistribute it and/or modify it under the terms 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/](http://www.gnu.org/licenses/).