Introduction & Setup
Introduction
The BTFS TestNet allows developers to access the full functionality of BTFS in a controlled test environment. The following guide will guide the user through connecting to the test net, storing files, and retrieving files. For each new BTFS node, follow the process below to use the TestNet. Start up in the same manner as inside the Install&Run BTFS2.0 Node, including topping up BTT to BTTC ADDRESS,and topping up WBTT to VAULT ADDRESS ; the current top-ups are run in the TestNet environment.
Install BTFS2.0
Install BTFS by following the Install & Run BTFS2.0 Node . Once BTFS is installed, initialize the daemon
// Initialize BTFS
$ btfs init
initializing BTFS node at /Users/user/.btfs
generating 2048-bit Secp256k1 keypair...done
peer identity: 16Uiu2HAmGj8NxjMqTYPYGYdAXy1bZv7o1Nr8cKnXSaA1AP5v987g
to get started, enter:
btfs cat /btfs/QmZjrLVdUpqVU6Pnc8pBnyQxVdpn9J8tfcsycP84W6N93C/readme
Testnet Configuration
Apply the testnet configuration profile.
// Renter Testnet Configuration Setup:
$ btfs config profile apply storage-client-testnet
// The services URLs should be staging in your configuration file:
$ btfs config show
...
"Services": {
"EscrowDomain": "https://escrow-staging.btfs.io",
"EscrowPubKeys": [
"CAISIQJOcRK0q4TOwpswAkvMMq33ksQfhplEyhHcZnEUFbthQg=="
],
"GuardDomain": "https://guard-staging.btfs.io",
"GuardPubKeys": [
"CAISIQJhPBQWKPPjYcuPWR9sl+QlN0wJSRbQs3yUKmggvubXwg=="
],
"HubDomain": "https://hub-staging.btfs.io",
"StatusServerDomain": "https://status-staging.btfs.io"
},
...
// Host Testnet Configuration Setup:
$ btfs config profile apply storage-host-testnet
Start the daemon
// Start the 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/yangsai/.btfs
Peer identity: 16Uiu2HAmKFQPM72SssFRrqcH1qwUsPwcp7vXSg3SEzfdYua1J5qc
the private key of wallet import format is: 396128d47810c5b60f448043c686112981a63d893176fbb0b4fb85069bfc77b8
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
At this point, it is necessary to charge the BTTC ADDRESS 0x7Cf4B71017F0312037D53fe966CE625BF98FFff6, and it is recommended that 1000 BTT to complete the node contract deployment; then it will run to completion.
VAULT ADDRESS Recharge
Although it runs successfully, you need to recharge the VAULT ADDRESS to upload the file.
In the node startup log, the VAULT ADDRESS is found as follows.
self vault: 0x47813456f0951493347010a4f27aafbdcca61025
You can top up to the VAULT ADDRESS through your own wallet before you can upload the file.
File Upload
Store a file to the BTFS network.
Warning
Files uploaded to the testnet will be purged periodically. Do not use the testnet for persistent storage.
// Add a file to your local node
$ btfs add <file>
added QmSRyqAayqX3Vy4sA8bEuEbNgQhYEyoHXTmg1fH6AViwQR file
2.37 KiB / 2.37 KiB [===================================================================================================] 100.00%
// Store the file to the BTFS network
$ btfs storage upload QmSRyqAayqX3Vy4sA8bEuEbNgQhYEyoHXTmg1fH6AViwQR
{"ID":"dcf019a9-842d-49cb-9690-2dd4c8829ca2"}
Query the storage process by running btfs storage upload <ID> status | jq
. Storage upload process is complete once all shards show complete and the file level storage shows complete.
$ btfs storage upload dcf019a9-842d-49cb-9690-2dd4c8829ca2 status | jq
File Retrieval
Retrieve the file from the BTFS network by first removing the file from your local node, and then running btfs get
.
// First remove the file from your local node:
$ btfs rm QmSRyqAayqX3Vy4sA8bEuEbNgQhYEyoHXTmg1fH6AViwQR
Removed QmVY9J7uq3UF5QWJAX7xTMLPGpR4FUsn3dDnA3LvgqST4v
Removed QmXfwWvQ7E96nVi7tt2Sn4f5R8rPxsGUtz7xHtHpkNAHF9
Removed QmRXFEkL33Qx38cQ6FJC3jf8MjRbnPZSRt1ctoC2o7jcHh
Removed Qme56DjNfkrHfYKZ4oaYFoitJ34gEWxXzQa4PKwTkoNt4v
Removed QmXFsKMpRrQRVY7Z7fghLJfHGxooEwtzE1gVKM7JS8phpz
Removed QmQ47XiSnZAYd9d3z4jfBrdwpYpsv5kyt2pcsPyVety87r
Removed QmevpWogVAgE5czMj5nNSfkvF7yUR3UXK9xyYFRXRZe9iL
Removed QmUuwBFMfUjpWa6pcsJAanuuNKndL7DqrGd8KY5zzs5oGY
Removed QmQfuDyf7NQVQBYsQZGarPBTz3e9R8DH8hjCV5R3UJPxjr
Removed QmcEisTJAdcJMPtg1tMit6t6Go1BqujxiiLiYqmEeGeoBp
Removed QmSTxDHU1AsP5oypyuy6QNR7RTGcQxRPZxvHbeh5Cmy4y9
Removed QmX5n3umQigc5uuWmwapBspjQYD12XNkjYBWLK1Vsdd87g
Removed QmNqpi65L6UNzfUn4by9WxWk6oJKiqikrbZVjQsKkhBkqy
Removed QmYEXeE24veVuRU91KJyTVKc2KgTcmmh5bzBvmU61mGjFg
Removed QmXyN1p5yDjCBZq1jSr2dYnJGfi7FUsSRHAC4jm11zKdkD
Removed QmagvAfRiQVc5NRBoPHMhn2iCLu2Wh6jM13g46ruPNviqE
Removed QmbbkJpWT2wYEUayy6tQ2FMyf5k6MdkvA8ex2R5PCBYkXf
Removed QmWjeG1d1zAs3Ld7wXXvpdyQUQnUtjX96rBzv5pLAyLHYt
Removed QmVDkrKSf2wwuwegcaEqRTYQ6593Y2itJFMbcZY2Tq6doT
Removed QmRxmLvzQVGGCKYig6qX1AY2kuNrEnx8DvEW9kEqHxjW4d
Removed QmPLVcTEwLWYCyNDJznECtBHF4C5XHEuVt89jkdNXX1dkf
Removed QmcBxff4CpD1yKNYb9FdLwSsuCxMELtb8uMHU3kNuJ9eF7
Removed QmNoNkSLpEhtL9KdY2VnQpMqumWkmqQrdmfgTNMAjXFnfZ
Removed QmSCfvqnQYzHkat12qo35EtFdsmnhTHHiPr4SdnJz2pKZQ
Removed QmfYdcV2uTvxvC2Msdmaouu66sek4W1oXBeyFmdpuopXSV
Removed QmVQadM6YzZfV8Lqm2mR3gBrMtmAeA8g1XQysibX6u6ZvT
Removed QmX3ixMPRxmGGPvppsu6o9RZBtJWGgPTwbV6PwUcsa6zoQ
Removed QmfLVJF5ZXgqbUPWNLL7eWywHETaSFooUPo3jvMKmm6FgB
Removed QmQpsXMwzxb7xrmtX2xnmEd3CVHP1UoGb8xaQY2aVP5ikk
Removed QmT85Lf3QL46pwLhErMvV6ks6iDk2bj5hdWxDuexC5uiYM
Removed QmNw8rcKaQtCfHnuZgmrTWaFEQ7Cbakac99eY9Ty1uDsCA
Removed QmVDwuuxsqK4G5wB5PELVCeoW3PMmJwcZkqHLQKnN3YVrE
Removed QmSRyqAayqX3Vy4sA8bEuEbNgQhYEyoHXTmg1fH6AViwQR
// Then retrieve the file from the storage hosts:
$ btfs get QmSRyqAayqX3Vy4sA8bEuEbNgQhYEyoHXTmg1fH6AViwQR
Saving file(s) to QmSRyqAayqX3Vy4sA8bEuEbNgQhYEyoHXTmg1fH6AViwQR
2.37 KiB / 2.37 KiB [================================================================================================] 100.00% 0s
Replenish Testnet BTT
If you ever run out of testnet BTT balance, in order to replenish, you will need to generate a new BTFS key-pair. This can be achieved by shutting down BTFS, removing the ~/.btfs
directory, re-initializing BTFS, applying the storage-client-testnet profile, and finally re-starting the daemon.
Warning
Removing the .btfs directory results in:
- Removal of your existing BTFS node ID.
- Removal of files uploaded to your local go-btfs node only.
Therefore, make sure you back up the .btfs directory and the necessary copies of the files you need, elsewhere.
// Shut down daemon
$ btfs shutdown
// Remove the existing config file
$ rm -r ~/.btfs
override r--r--r-- user/staff for ~/.btfs/blocks/_README? yes
// Initalize BTFS
$ btfs init
...
// Apply the Testnet Config
$ btfs config profile apply storage-client-testnet
// Start the daemon
$ btfs daemon
Updated about 3 years ago