Install & Run BTFS2.0 Node

Install BTFS 2.0

System Requirements:
BTFS can run on most Linux, macOS, and Windows systems. We recommend running it on a machine with at least 2 GB of RAM (it’ll do fine with only one CPU core), but it should run fine with as little as 1 GB of RAM. On systems with less memory, it may not be completely stable. Only support compiling from source for mac and unix-based system.

Build from Source
Clone the go-btfs repository
$ git clone https://github.com/bittorrent/go-btfs

Navigate to the go-btfs directory and run make install.
$ cd go-btfs
$ make install
$ make build

Another,if you want to download the btfs-binary-releases, you can visit https://github.com/bittorrent/go-btfs/releases to get it.

Run BTFS

Initialize a BTFS Daemon
navigate to the btfs director cd cmd/btfs. You will start a mainnet miner by default, chain_id=199.
if you want to deploy testnet node, you can see it. https://docs.btfs.io/docs/for-test

$ ./btfs init
Generating TRON key with BIP39 seed phrase...
Master public key:  xpub661MyMwAqRbcGgHpeMqFkS5hnwoGeAcHG5KkDQwke7wFxtKqfsXTCTjWsoU2dYVXVGvV7EuGcviEzEJ143TezxxXvs2zZ9FYTtCei8iRQ66
initializing BTFS node at /home/ubuntu/.btfs
generating btfs node keypair with TRON key...done
peer identity: 16Uiu2HAmKFQPM72SssFRrqcH1qwUsPwcp7vXSg3SEzfdYua1J5qc
to get started, enter:

    btfs cat /btfs/QmZjrLVdUpqVU6Pnc8pBnyQxVdpn9J8tfcsycP84W6N93C/readme

Start the Daemon
Start the BTFS Daemon
$ ./btfs daemon

the chainid of the main network is 199, and the start command becomes: btfs daemon

$ ./btfs daemon
Initializing daemon...
go-btfs version: 2.0
Repo version: 10
System version: amd64/darwin
Golang version: go1.16.5
Repo location: /Users/btfs/.btfs
Peer identity: 16Uiu2HAmKFQPM72SssFRrqcH1qwUsPwcp7vXSg3SEzfdYua1J5qc
the address of Bttc format is:  0x7Cf4B71017F0312037D53fe966CE625BF98FFff6
the address of Tron format is:  TMMuwwxsuQGrDrN3aanc5y5r4FbibgLYDa
cannot continue until there is sufficient (100 Suggested) BTT (for Gas) available on 0x7cf4b71017f0312037d53fe966ce625bf98ffff6

Run the Daemon
When starting the BTFS daemon for the first time, the system will create a node account and at the same time print a string of messages: cannot continue until there is sufficient (100 Suggested) BTT (for Gas) available on. After seeing such a message, it is necessary to recharge the node account with BTT through an external account, and the system suggests a minimum of 100 BTT, which is used as gas to deploy a node vault contract by the node account. Please note that the BTT here is the BTT token on the BTTC chain.

BTT token application address: https://doc.bt.io/v1/doc/network.html#mainnet-chainid-0xc9-decimal-199

After the recharge, the BTFS node will create the vault contract

cannot continue until there is sufficient (100 Suggested) BTT (for Gas) available on 0x7cf4b71017f0312037d53fe966ce625bf98ffff6 
self vault: 0x1f8b3e7e691d733f5eb17e5570c49de3e5aecef9 
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.21.149/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
Swarm listening on /p2p-circuit
Swarm announcing /ip4/127.0.0.1/tcp/4001
Swarm announcing /ip4/192.168.21.149/tcp/4001
Swarm announcing /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Dashboard: http://127.0.0.1:5001/dashboard
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

At this point, the BTFS node is up and running

Note:

  1. the node address and private key need to be saved, and the private key needs to be kept private and secure.
  2. The vault address needs to be saved, look for the self vault field in the print message, the address after it is the vault address. And you can get it from this cmd.
$ ./btfs id
{
    "ID": "16Uiu2HAm8tjcJvxYYJL5LM5WSKnHC9REKVfArt8QJx1kZEXkw73E",
    "PublicKey": "CAISIQLIFrdEEl2TTQ9alLgK4ntBB/HL1qMxMsS+qgJnPZqueQ==",
    "Addresses": null,
    "AgentVersion": "go-btfs/2.1.0/",
    "ProtocolVersion": "btfs/0.1.0",
    "Protocols": null,
    "DaemonProcessID": -1,
    "TronAddress": "TJowu1DCPt24DYZBNL6HvVW9fPuoq6MQhx",
    "BttcAddress": "0x60F8c7a6ce00B94d80Aa51e315be1069940e6eFF",
    "VaultAddress": "0xFd3171a158D940955582339E7FF96B47F7592404"
}

Since v2.2.0,BTFS introduced online signature and Online Proof Contract; (Note: Nodes report heartbeats to Online Proof Contract every day, incurring a gas fee of 70 BTT(The gas fee is not fixed and will fluctuate up or down depending on the BTTC network status.), which will be deducted from the BTTC account. It is advised that you keep enough balance in your BTTC address to avoid failure to prove your uptime.