massalabs / station

A gateway to the Massa blockchain
https://station.massa.net
27 stars 107 forks source link

improve node/network config #1317

Open Thykof opened 8 months ago

Thykof commented 8 months ago
          Can't we combine those structs ? 

They are the same except for the fields names, but we could move the yaml specs of NetworkConfig to NetworkInfos

Well, in NetworkConfig, we have URLs that is an array of strings, but it looks like we are always using the first url of the array. So I guess we can use a simple string. It is not modifiable by users, so there are no issue removing the possibility to have multiple URLs.

IMO, we shouldn't even name those things "Networks" but simply "Nodes". Because, ATM, users can't add custom nodes to the list (as we embed the list inside MS), but as a user, I'd like to be able to add my own node, maybe a local one, or one that is on a remote server, but it will still be connected to Mainnet (or buildnet or testnet....) So I can have 2 instances of "Mainnet", but one is my node, and one is a node from Massa. And so if for example, my node is down for a maintainance, but I need to connect to MS, I can use Massa's one.

Definetly not something to do in this PR, but maybe we should open an issue on the subject.

_Originally posted by @thomas-senechal in https://github.com/massalabs/station/pull/1312#discussion_r1444833854_

Thykof commented 8 months ago

related to #1320