Closed mario4tier closed 1 year ago
Feature is work-in-progress, but already by default the Rust sui-base helper provides URL that are same as the default Mysten client.yaml.
There are two files. One is the user configuration (sui-base.yaml) and the other is .state/links which is controlled by sui-base (for now the scripts, later a background "link health monitoring" process).
links:
- alias: "sui.io"
rpc: "https://fullnode.testnet.sui.io:443"
ws: "wss://fullnode.testnet.sui.io:443"
- alias: "vincagame.com"
rpc: "https://fullnode.testnet.vincagame.com:443"
ws: "wss://fullnode.testnet.vincagame.com:443"
{
"selection": { "primary": 0, "secondary": 1, "n_links": 2 },
"links": [
{
"id": 0,
"alias": "sui.io",
"rpc": "https://fullnode.devnet.sui.io:443",
"ws": "wss://fullnode.devnet.sui.io:443"
},
{
"id": 1,
"alias": "vincagame.com",
"rpc": "https://fullnode.devnet.vincagame.com:443",
"ws": "wss://fullnode.devnet.vincagame.com:443"
}
]
}
RPC link information for every workdir will be provided by a .state/links JSON file.
The file provides:
Implementation details: The file can change at anytime (using a safe atomic filesystem mv, not a risky in-place file/inode modifications). From a helper perspective, you just open/read/close the file, use the primary and secondary recommendation. Re-open the file again for a new set of recommendation.