MCPcopy Create free account
hub / github.com/DEROFDN/Engram / setNetwork

Function setNetwork

functions.go:487–508  ·  view source on GitHub ↗

Set Network setting to the local Graviton tree (Ex: Mainnet, Testnet, Simulator)

(network string)

Source from the content-addressed store, hash-verified

485
486// Set Network setting to the local Graviton tree (Ex: Mainnet, Testnet, Simulator)
487func setNetwork(network string) (err error) {
488 s := ""
489 if network == NETWORK_MAINNET {
490 s = network
491 globals.Arguments["--testnet"] = false
492 globals.Arguments["--simulator"] = false
493 } else if network == NETWORK_SIMULATOR {
494 s = network
495 globals.Arguments["--testnet"] = true
496 globals.Arguments["--simulator"] = true
497 } else {
498 s = NETWORK_TESTNET
499 globals.Arguments["--testnet"] = true
500 globals.Arguments["--simulator"] = false
501 }
502
503 session.Network = s
504
505 StoreValue("settings", []byte("network"), []byte(s))
506
507 return
508}
509
510// Get daemon endpoint setting from the local Graviton tree
511func getDaemon() (r string) {

Callers 2

getNetworkFunction · 0.85
layoutSettingsFunction · 0.85

Calls 1

StoreValueFunction · 0.85

Tested by

no test coverage detected