Install BTFS Node
github address: https://github.com/bittorrent/go-btfs
Install BTFS 2.0
System Requirements:
BTFS can run on most Linux (recommend Ubuntu 18.04 or later), 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 directory 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.
To obtain a specific amount of BTT, you can refer to: How do I get BTT/WBTT on the BTTC Mainnet?
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:
- the node address and private key need to be saved, and the private key needs to be kept private and secure.
- 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"
}
Updated 8 months ago