MCPcopy Create free account
hub / github.com/encodeous/nylon / NewNode

Method NewNode

integration/harness.go:125–150  ·  view source on GitHub ↗
(id state.NodeId, virtPrefix string)

Source from the content-addressed store, hash-verified

123}
124
125func (v *VirtualHarness) NewNode(id state.NodeId, virtPrefix string) {
126 privKey := state.GenerateKey()
127 locCfg := state.LocalCfg{
128 Key: privKey,
129 Id: id,
130 Port: 25565,
131 NoNetConfigure: true,
132 UseSystemRouting: !v.UntrackedRouting,
133 }
134 ncfg := state.RouterCfg{
135 NodeCfg: state.NodeCfg{
136 Id: id,
137 PubKey: privKey.Pubkey(),
138 Prefixes: []state.PrefixHealthWrapper{
139 {
140 &state.StaticPrefixHealth{
141 Prefix: netip.MustParsePrefix(virtPrefix),
142 Metric: 0,
143 },
144 },
145 },
146 },
147 }
148 v.Central.Routers = append(v.Central.Routers, ncfg)
149 v.Local = append(v.Local, locCfg)
150}
151
152func (v *VirtualHarness) AddLink(from, to string) *VirtualLink {
153 link := &VirtualLink{}

Callers 11

TestInProcessRoutingFunction · 0.95
TestTTLFunction · 0.95
setupTwoNodeHarnessFunction · 0.95
TestAckRetractSentOnWireFunction · 0.95
TestOptimalConvergenceFunction · 0.95
TestRapidToggleConfigFunction · 0.95
TestStartStopFunction · 0.95
TestSimplePingFunction · 0.95
TestSimpleRoutedPingFunction · 0.95

Calls 2

GenerateKeyFunction · 0.92
PubkeyMethod · 0.80

Tested by 11

TestInProcessRoutingFunction · 0.76
TestTTLFunction · 0.76
setupTwoNodeHarnessFunction · 0.76
TestAckRetractSentOnWireFunction · 0.76
TestOptimalConvergenceFunction · 0.76
TestRapidToggleConfigFunction · 0.76
TestStartStopFunction · 0.76
TestSimplePingFunction · 0.76
TestSimpleRoutedPingFunction · 0.76