skycoin / skywire

Skywire Node implementation
73 stars 45 forks source link

`setup-node` config gen #1783

Closed 0pcom closed 3 months ago

0pcom commented 3 months ago

Fixes # 1761

0pcom commented 3 months ago
$ go run cmd/skywire/skywire.go cli config gen --sn -n
{
    "dmsg": {
        "discovery": "http://dmsgd.skywire.skycoin.com",
        "servers": [],
        "sessions_count": 2
    },
    "log_level": "",
    "public_key": "030f21ddb74148af74b8444c3de53c6304bfcb2d4550336fd9196654c12ccf9349",
    "secret_key": "dc6e5b014369d74296ebc81457ee2d3b60f4705cce43bb4e8b063b530537f3be",
    "transport_discovery": "http://tpd.skywire.skycoin.com"
}

image

mrpalide commented 3 months ago

Is not better use standard struct for sn config instead jq and script to create it?

0pcom commented 3 months ago

Is not better use standard struct for sn config instead jq and script to create it?

I'm literally just filtering the output down. I think it would be better to not have the flag on config gen and to make the setup-node work with the visor config.

the fields are the same for setup-node as for the visor, but there are extra ones in the visor config.

The script library isn't using any external dependencies here. It uses go-jq which I quite like.

This was just supposed to be a simple and quick fix. It does work, but we can put more thought later into changing this to be different or making setup-node able to use the visor's config.