Install & Run BTFS
BTFS daemon setup and walk-through guide
Install BTFS
Minimum Hardware Requirements
- CPU: 2+ Core
- RAM: 2+ GB
Supported Operating Systems and Architecture
OS | ARCH |
---|---|
darwin | amd64 |
darwin | 386 |
linux | amd64 |
linux | 386 |
linux | arm64 |
linux | arm |
windows | amd64 |
windows | 386 |
MacOS/Linux
In the terminal, run the following steps:
- Download the BTFS
install.sh
script.
wget https://raw.githubusercontent.com/TRON-US/btfs-binary-releases/master/install.sh
- Run the install script.
bash install.sh -o darwin -a amd64 # For macOS x86_64
bash install.sh -o darwin -a 386 # For macOS x86
bash install.sh -o linux -a amd64 # For Linux x86_64
bash install.sh -o linux -a 386 # For Linux x86
bash install.sh -o linux -a arm64 # For Linux ARM64
bash install.sh -o linux -a arm # For Linux ARM
// Output
...
Installation of BTFS succeeded!
- Add BTFS path to the environment.
export PATH=${PATH}:${HOME}/btfs/bin
- Initialize BTFS by running
btfs init
.
btfs init
// Output
Generating TRON key with BIP39 seed phrase...
Master public key: xpub661MyMwAqRbcGXasJpxrNnCbyd4kCfxUmrKaJXmuN5zkTU3woSeT3hnBwrPDYg6Q96MgQf43PtY7E9rHubyvcecc1NjcLKKpJAMZkM1H3Xv
initializing BTFS node at /Users/tron/.btfs
generating btfs node keypair with TRON key...done
peer identity: 16Uiu2HAkzrKxViobEK8EtQLUoxwAvBjfsV59kgqrRKuJ8VHzHcPS
to get started, enter:
btfs cat /btfs/QmZjrLVdUpqVU6Pnc8pBnyQxVdpn9J8tfcsycP84W6N93C/readme
- Start the BTFS daemon by running
btfs daemon
.
btfs daemon
// Output
Initializing daemon...
go-btfs version: 1.0.0-
Repo version: 7
System version: amd64/darwin
Golang version: go1.13.6
Swarm listening on /ip4/10.10.0.82/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/38.142.72.82/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
WebUI: http://127.0.0.1:5001/webui
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Remote API server listening on /ip4/127.0.0.1/tcp/5101
Daemon is ready
Hosts info will be synced at [SCORE] mode
BTFS is up-to-date.
- Once your BTFS daemon has started, open a second terminal window to run the BTFS commands.
Windows
- Download the Windows compressed file: amd64 386.
- Make sure you have permission to delete files in the btfs project directory.
- Initialize the BTFS path:
a. Create a newbtfs
folder under the D drive.
b. Go to thebtfs
folder.
c. Copy your computer version of the btfs binary and config file to thebtfs
folder.
d. Unzip the btfs binary and rename it tobtfs.exe
.
e. Rename the btfs config toconfig.yaml
.
f. Add the btfs folder to the environment variable. - Initialize BTFS
btfs.exe init
- Start the daemon
btfs.exe daemon
AutoUpdate
BTFS has a built-in AutoUpdate feature that will check for the latest BTFS version available and update as necessary.
Common Usage
Add a File
Add a file to your BTFS daemon by running btfs add <file name>
:
btfs add heart.png
// Output
added QmdA3o9nFLwfF21GizuMK4xZpvdrZmwdA8xR8Z78Hn7J1i heart.png
29.89 KiB / 29.89 KiB [==================================================================================] 100.00%
Get a File
Get a file by running btfs get <file hash value>
:
btfs get QmdA3o9nFLwfF21GizuMK4xZpvdrZmwdA8xR8Z78Hn7J1i
// Output
Saving file(s) to QmdA3o9nFLwfF21GizuMK4xZpvdrZmwdA8xR8Z78Hn7J1i
29.89 KiB / 29.89 KiB [===============================================================================] 100.00% 0s
Remove a File
Remove a file from your BTFS daemon by running btfs rm <file hash value>
:
btfs rm QmdA3o9nFLwfF21GizuMK4xZpvdrZmwdA8xR8Z78Hn7J1i
// Output
"Removed QmdA3o9nFLwfF21GizuMK4xZpvdrZmwdA8xR8Z78Hn7J1i"
WebUI
Explore the BTFS WebUI by pasting the URL http://127.0.0.1:5001/webui
in your browser:
Updated about 4 years ago