-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathskywire.go
More file actions
64 lines (54 loc) · 2.62 KB
/
Copy pathskywire.go
File metadata and controls
64 lines (54 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// Package main skywire.go
/*
skywire + skycoin
*/
package main
import (
skycoinweb "github.com/skycoin/skycoin/cmd/skycoin-web/commands"
skycoin "github.com/skycoin/skywire/cmd/skycoin/commands"
"github.com/skycoin/skywire/cmd/skywire/commands"
"github.com/skycoin/skywire/pkg/flags"
)
// skywireSkycoinWebHelp is appended to the vendored `skycoin web` command's
// Long description when it is imported into skywire. It documents the
// skywire-specific way to reach fibercoin nodes over the mesh: point the
// thin client at a node's dmsg address and let the visor's embedded
// resolving SOCKS5 proxy resolve it (remote DNS), instead of a clearnet URL.
const skywireSkycoinWebHelp = `
Reaching nodes over the skywire mesh
------------------------------------
Enable the visor's embedded resolving proxy (config-gen --dmsgweb, listens on
127.0.0.1:4445; --skynetweb adds .skynet on :4446 and auto-chains) and point
the wallet at it, then use a mesh node URL instead of a clearnet one:
HTTP_PROXY=socks5://127.0.0.1:4445 HTTPS_PROXY=socks5://127.0.0.1:4445 \
skywire skycoin web --node-url http://sky.theskywirenetwork.net.<visor-pk>.dmsg
or equivalently pass --socks5-proxy socks5://127.0.0.1:4445. The proxy resolves
.dmsg / .skynet hostnames remotely, so no clearnet DNS or exit is used.
Nodes advertised over the mesh are discoverable as type=coin services in the
service discovery; the wasm-visor wallet auto-addresses them as <pk>:<port>.
Public thin-client nodes:
sky.theskywirenetwork.net.<visor-pk>.dmsg skycoin (over the mesh)
https://sky.theskywirenetwork.net skycoin (clearnet mirror)
https://node.skycoin.com skycoin (upstream clearnet)
Node URLs are also runtime-reconfigurable from the wallet UI (Settings -> Nodes).
config-gen sets the default node list via SKYCOINWEBNODES.`
func init() {
flags.InitFlags(commands.RootCmd, true)
// Use/Short/Version and the subcommand tree are set by the package itself
// (cmd/skycoin/commands), which assembles skycoin's commands on skywire's
// side rather than importing skycoin's own assembly.
commands.RootCmd.AddCommand(
skycoin.RootCmd,
)
// Augment the imported `skycoin web` help with skywire-mesh usage
// (resolving proxy via ENV + dmsg/skynet node URLs). Done here,
// after the fact of importing skycoin-web, so the vendored command
// stays transport-agnostic upstream.
skycoinweb.RootCmd.Long += skywireSkycoinWebHelp
// Help presentation (the code-rain help screen and the --tui console) is
// wired in commands.Execute, so this stays a thin wrapper matching
// cmd/skycoin-skywire/skywire.go.
}
func main() {
commands.Execute()
}