FileTribe

module
v0.0.0-...-52bbd4c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2019 License: GPL-3.0

README

WARNING: FileTribe is still in pre-alpha state. Do NOT use it for storing or sharing sensitive data. All branches are highly unstable.


Build Status

FileTribe

FileTribe is a blockchain-based decentralized file-sharing and editing system built on Ethereum and IPFS.

Contract address of the development version on Ropsten: 0xa53336064E1c14a6a9c0a612Fe445d201a1982DE

Dependency

In order to use FileTribe, you will need a running IPFS daemon. To install IPFS, download it and then run

$ tar xvfz go-ipfs.tar.gz
$ cd go-ipfs
$ ./install.sh

For more information see here. You also need go-ethereum's abigen, which is bundled into the basic ethereum package.

$ apt-get install ethereum 

Alternately you can build it as well. For more information on that see here.

Building the sources

To successfully build the FileTribe client application, you need Go (v1.10 <=) and Truffle. To install Truffle, run $ npm install -g truffle. For more information on installing Truffle, see here. If both dependencies are installed, run

$ make all

This will download the Go dependencies, compile the solidity sources and create Go bindings to them. Note that you may have to use make in sudo mode since go-ethereum's abigen might fail when trying to resolve the dependencies of the generated Go files.

Getting started

An unsafe developer version of FileTribe is deployed on the Ropsten test network. The default config.json contains the necessary information to reach that application.

  1. To use FileTribe you need to edit $HOME/.filetribe/config.json to include your mnemonic that generates your ethereum account. If you do not have any, you can generate one using an online mnemonic generator or by using MetaMask.

    "EthAccountMnemonic": "your own long nice menmonic...",
    
  2. To perform contract method calls you will need some ether. Use a faucet, like the one hosted by MetaMask to acquire ether.

    1. Navigate to MetaMask's Test Ether Faucet.

    2. Connect to the Ropsten Test Network using MetaMask.

    3. The faucet will link to your first account. Click "Request 1 Ether From Faucet" to submit your request.

    4. Within a short period of time, your account will be populated with the requested ether.

Note, that FileTribe client uses Infura to use the blockchain application by default. If you want it to use your own specific Ethereum node or you deployed your own version of FileTribe and you want to use that contract, you can set these in the config.json file.

Start IPFS daemon

FileTribe uses IPFS as its data storage layer so the client needs an IPFS daemon which it can talk to. The clients communicate with each other through the IPFS daemon's built in libp2p service which has to be enabled explicitly.

$ ipfs init
$ ipfs daemon --enable-pubsub-experiment </dev/null &>/dev/null &
$ ipfs config --json Experimental.Libp2pStreamMounting true
Start the client application

You can configure the FileTribe daemon with $HOME/.filetribe/config.json. If you have a running Ethereum network, on which the FileTribe contracts were deployed and an IPFS daemon you can start the client:

$ filetribe daemon

Now that you have a running filetribe daemon you can start interacting with it. Since most of the operations you perform will result in a contract method call on the blockchain, these operations will not come into force in an instant.

You can check your pending transactions by executing filetribe ls -tx and lookup the results on Etherscan's Ropsten part.

  1. Sign up

    Execute

    $filetribe signup <username>
    

    to sign up and wait for the blockchain transaction to complete. After successfully signe up, a filetribe/<usnername> directory should appear in your $HOME directory.

  2. Create a group

    Execute

    $filetribe group create <groupname>
    

    to create a group. As usually, wait for the transaction to complete. After it is done, the directory $HOME/filetribe/<username>/<groupname> should appear. This will be the group's repository. You can share your files with your group by copying them into this folder.

  3. Invite others

    You can invite other users by executing

    $ filetribe group invite <groupaddress> <other user's filetribe account address>
    
  4. Commit changes

    Do not forget to commit your changes, as your file shares/modifications will be visible to your group mates only if you have committed them. Execute

    $ filetribe group repo commit <groupaddress>
    
Usage
$ filetribe --help
FileTribe

USAGE:
  filetribe <command> ...

COMMANDS: 
  BASIC COMMANDS:
    signup <username>                           Sign up to FileTribe    
    ls {-g|-i|-tx}                              List groups, pending invitations or pending Ethereum transactions
    daemon                                      Start a running client daemon process (configured from $HOME/.filetribe/config.json)                                                
    group                                       Interact with groups

  GROUP COMMANDS:
    create <groupname>                          Create a group
    invite <group address> <invitee address>    Invite a new member to the given group
    leave  <group address>                      Leave the given group
    ls <group address>                          List group members
    repo ...                                    Interact with the group repository

  REPO COMMANDS:
    ls <group address>                          List files
    commit <group address>                      Commit the pending changes in the repository
    grant <group address> <file> <member>       Grant write access for the given file to the given user
    revoke <group address> <file> <member>      Revoke write access for the given file to the given user

  CONFIG.JSON OPTIONS:
    APIAddress                                  Address on which the daemon will be listening    
    IpfsAPIAddress                              http address of a running IPFS daemon's API
    EthFullNodeAddress                          websocket address of an Ethereum full node
    EthAccountMnemonic                          Mnemonic that generates your Ethereum account
    EthAccountPasswordFilePath                  Path to the password file of the corresponding Ethereum account
    FileTribeDAppAddress                        Address of the FileTribeDApp contract
    LogLevel {INFO|WARNING|ERROR}               Level of logs that will be printed to stdout                                   

OPTIONS:
  -h --help                                     Show this screen

License

FileTribe is licensed under the GNU General Public License v3.0, also found in the COPYING file in the root of the repository.

Used libraries
Library Author(s) License
collections 2012 Caleb Doxsey MIT License
go-diff 2012-2016 The go-diff Authors MIT License
errors 2015, Dave Cheney dave@cheney.net BSD-2-Clause
glog Google Apache License 2.0
tar-utils 2016 Jeromy Johnson MIT License
go-ethereum 2014 The go-ethereum Authors GNU General Public License v3.0 and GNU Lesser General Public License v3.0
mux 2012-2018 The Gorilla Authors BSD 3-Clause "New" or "Revised" License
go-ipfs-api 2016 Jeromy Johnson MIT License
go/codec 2012-2015 Ugorji Nwoke MIT License
go-ethereum-hdwallet 2015 Miguel Mota MIT License

The licenses of all the above mentioned libraries are included in the COPYING.3RD-PARTY in the root of the repository.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL