Check-in [9d3190fba9]
Overview
Comment:Added node script
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9d3190fba97fcc40a5d907d210fd9b8cf833a11b4650b3f9d8574766f84986e1
User & Date: rkeene on 2018-12-08 02:33:18
Other Links: manifest | tags
Context
2018-12-08
03:06
Added more documentation check-in: a80c9e0cd7 user: rkeene tags: trunk
02:33
Added node script check-in: 9d3190fba9 user: rkeene tags: trunk
02:31
More work on lazy bootstrapping testbed check-in: 18d1a69d74 user: rkeene tags: trunk
Changes

Added node.tcl version [279a5d46ba].























































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
#! /usr/bin/env tclsh

package require nano

# Process command-line options
## Set defaults
set network main

## Process
if {[llength $argv] % 2 != 0} {
	lappend argv ""
}
foreach {opt optval} $argv {
	switch -- $opt {
		"--network" {
			set network $optval
		}
		"-h" - "--help" {
			puts "Usage: node \[--help\] \[--network {main|beta}\]"
			exit 0
		}
		default {
			puts stderr "Invalid option: $opt"
			exit 1
		}
	}
}

# Override logging, to file
proc ::nano::node::user_log {line} {
	if {![info exists ::logfd]} {
		set logfile [file join [file dirname [info script]] "node.log"]
		set ::logfd [open $logfile a+]
		fconfigure $::logfd -blocking false
	}

	puts $::logfd $line
	flush $::logfd
}

::nano::node::configure $network
::nano::node::start -bootstrap false -wait false
::nano::node::cli -interactive