︙ | | | ︙ | |
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
namespace eval ::nano::node::cli {}
namespace eval ::nano::node::stats {}
namespace eval ::nano::network::client {}
namespace eval ::nano::network::server {}
namespace eval ::nano::protocol::create {}
namespace eval ::nano::protocol::parse {}
namespace eval ::nano::protocol::extensions {}
namespace eval ::nano::network::_dns {}
namespace eval ::nano::wallet {}
namespace eval ::nano::_cli {}
# Constants
set ::nano::block::genesis(main) {{
"type": "open",
"source": "E89208DD038FBB269987689621D52292AE9C35941A7484756ECCED92A65093BA",
|
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
namespace eval ::nano::node::cli {}
namespace eval ::nano::node::stats {}
namespace eval ::nano::network::client {}
namespace eval ::nano::network::server {}
namespace eval ::nano::protocol::create {}
namespace eval ::nano::protocol::parse {}
namespace eval ::nano::protocol::extensions {}
namespace eval ::nano::internal::dns {}
namespace eval ::nano::wallet {}
namespace eval ::nano::_cli {}
# Constants
set ::nano::block::genesis(main) {{
"type": "open",
"source": "E89208DD038FBB269987689621D52292AE9C35941A7484756ECCED92A65093BA",
|
︙ | | | ︙ | |
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
|
foreach proc $procs {
proc ::nano::node::ledger::$proc args [concat [list tailcall {*}$handle $proc] {{*}$args}]
}
}
proc ::nano::node::configure {network args} {
package require ip
package require dns
# Set default options
switch -- $network {
"main" {
set info(-configDirectory) [file normalize ~/RaiBlocks]
}
"beta" {
|
<
|
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
|
foreach proc $procs {
proc ::nano::node::ledger::$proc args [concat [list tailcall {*}$handle $proc] {{*}$args}]
}
}
proc ::nano::node::configure {network args} {
package require ip
# Set default options
switch -- $network {
"main" {
set info(-configDirectory) [file normalize ~/RaiBlocks]
}
"beta" {
|
︙ | | | ︙ | |
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
|
lappend ::nano::node::bootstrap::frontiers_to_pull [dict create account $account frontier $frontier]
}
}
return
}
proc ::nano::network::_dns::toIPList {name} {
if {[::ip::version $name] > 0} {
return [list $name]
}
set retval [list]
foreach addressType {A AAAA} {
set dnsQueryID [::dns::resolve $name -type $addressType]
for {set dnsCheck 0} {$dnsCheck < 100} {incr dnsCheck} {
switch -- [::dns::status $dnsQueryID] {
"ok" {
|
|
>
>
>
>
>
>
>
>
|
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
|
lappend ::nano::node::bootstrap::frontiers_to_pull [dict create account $account frontier $frontier]
}
}
return
}
proc ::nano::internal::dns::resolve {name} {
if {[::ip::version $name] > 0} {
return [list $name]
}
if {$::nano::internal::haveResolveName} {
set retval [::nano::internal::resolveName $name]
set retval [lsort -unique $retval]
return $retval
}
package require dns
set retval [list]
foreach addressType {A AAAA} {
set dnsQueryID [::dns::resolve $name -type $addressType]
for {set dnsCheck 0} {$dnsCheck < 100} {incr dnsCheck} {
switch -- [::dns::status $dnsQueryID] {
"ok" {
|
︙ | | | ︙ | |
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
|
}
set completePeers [list]
foreach peer $peers {
lassign [::nano::internal::parseAddress $peer $defaultPeerPort] peer peerPort
catch {
foreach peer [::nano::network::_dns::toIPList $peer] {
lappend completePeers [dict create address $peer port $peerPort]
}
}
}
set now [clock seconds]
# Cleanup nonces while we are here
|
|
|
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
|
}
set completePeers [list]
foreach peer $peers {
lassign [::nano::internal::parseAddress $peer $defaultPeerPort] peer peerPort
catch {
foreach peer [::nano::internal::dns::resolve $peer] {
lappend completePeers [dict create address $peer port $peerPort]
}
}
}
set now [clock seconds]
# Cleanup nonces while we are here
|
︙ | | | ︙ | |