GithubHelp home page GithubHelp logo

Comments (6)

Sophia-yu-kk avatar Sophia-yu-kk commented on August 20, 2024

Please provide us with your node id, we will check it for you.

from go-btfs.

pkyriacou avatar pkyriacou commented on August 20, 2024

16Uiu2HAm5iaFq2Cei1NDrCAuAdaABJH1aM5mua1K2o7VtzZtTzwc

It's currently showing as v2.0.2 in mainnet while also showing testnet node's details. I'm running both mainnet and tesnet nodes at this time. Since the mainnet BTFS scan is showing the testnet node's details, is the mainnet node considered as "offline"?

from go-btfs.

pkyriacou avatar pkyriacou commented on August 20, 2024

Kindly note that since 09/03 I have turned off the aforementioned testnet node. Mainnet node is still operational. The issue still existed at the time I turned off the testnet node.

Please let me know if I can be of any assistance.

from go-btfs.

Robin-Luooo avatar Robin-Luooo commented on August 20, 2024

Hi, I'm sad this confused you. I know that you want to share the private key both in testnet and maintest, this is a common case. And I want to know whether you started your testnet node and mainnet node with different $BTFS_PATH env?

The node stores its data and configs in the $BTFS_PATH with a default value ~/.btfs. It seems that you started two nodes with the same $BTFS_PATH, so that their data conflicts with each other. You can find the $BTFS_PATH with echo command, e.g. echo $BTFS_PATH.

You can solve the problem as following.

  1. Download the latest go-btfs version 2.1.1, which supports importing private key in init command.
  2. Set a proper $BTFS_PATH in order to separate the data between testnet and mainnet nodes. Then start your testnet node and get its private key.
# set a different BTFS_PATH for testnet is recommend, ~/.btfs.testnet for example
$ export BTFS_PATH=~/.btfs.testnet

# start your testnet node using init and daemon command

# find the private key you want to share with mainnet node
$ cat ~/.btfs.testnet/config | grep HexPrivKey
# $ cat ~/.btfs/config | grep HexPrivKey   # when your BTFS_PATH is ~/.btfs
"HexPrivKey": "<your_private_key>"
  1. Using the private key to start the mainnet node. You may encounter a port conflict problem if you run testnet and mainnet nodes at the same time without modify their listening port in the config file under $BTFS_PATH. You can modify the listening ports in config file's Addresses part.
# set a different BTFS_PATH for mainnet, or using the default value ~/.btfs will be ok
export BTFS_PATH=~/.btfs.mainnet

# init the node with the private key
btfs init -i <your_private_key>

# change the listening ports in the config file.
# A better way is to modify the testnet's config, and let the mainnet's config not changed.
# e.g.
# "Addresses": {
#     "API":"/ip4/127.0.0.1/tcp/5002",
#     "Announce":[],
#     "Gateway":"/ip4/127.0.0.1/tcp/8082",
#     "NoAnnounce":[],
#     "RemoteAPI":"/ip4/127.0.0.1/tcp/5102",
#     "Swarm":[
#         "/ip4/0.0.0.0/tcp/4002",
#         "/ip6/::/tcp/4002",
#         "/ip4/0.0.0.0/udp/4002/quic",
#         "/ip6/::/udp/4002/quic"
#     ]
# }

# start the mainnet node
btfs daemon --chain-id=199

from go-btfs.

pkyriacou avatar pkyriacou commented on August 20, 2024

@Robin-Luooo Thank you for the input.

Please note that I was running the 2 nodes on separate machines, the mainnet one on Windows 10 and the testnet one on Windows 11. I am using the ".btfs.properties" file to "define" the $BTFS_PATH, and this value differs for the two nodes. For reference:

  1. Mainnet: D:\btt\
  2. Testnet: D:.btfs-testnet\

Unsure if this is related, but today my mainnet node 16Uiu2HAm5iaFq2Cei1NDrCAuAdaABJH1aM5mua1K2o7VtzZtTzwc has lost 1 point on its score for "Host Age". This node has been running non-stop since around October 2021. The testnet node has been stopped since 2021-03-09.

from go-btfs.

Robin-Luooo avatar Robin-Luooo commented on August 20, 2024

Hi @pkyriacou, thanks for your feedback, I have noticed that your mainnet host is upgrade to v2.1.1 and works well now.

As for your original problem, I guess the main reason is that you have tried to start the testnet host using the mainnet host's config without adapting. As a consequence the testnet host affected the mainnet host's data display at the scan.btfs.io.

Just as I aforementioned, using the -i argument to reuse the private key will be more convenient and less likely to go wrong. And although we can run two hosts in mainnet and testnet using the same private key, but it's better not to start multiple hosts in mainnet using the same private key.

And as for your host's score dropped from 10 to 9, is caused by another little problem, which is in the process of optimization. And will be released latter.

from go-btfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.