Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
3c9b64ae
Commit
3c9b64ae
authored
Sep 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6f1023e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
14 deletions
+26
-14
go/neo/neotools/master.go
go/neo/neotools/master.go
+1
-4
go/neo/neotools/storage.go
go/neo/neotools/storage.go
+9
-10
go/neo/t/t.sh
go/neo/t/t.sh
+16
-0
No files found.
go/neo/neotools/master.go
View file @
3c9b64ae
...
@@ -35,15 +35,13 @@ import (
...
@@ -35,15 +35,13 @@ import (
const
masterSummary
=
"run master node"
const
masterSummary
=
"run master node"
// TODO options:
// TODO options:
//
cluster,
masterv ...
// masterv ...
func
masterUsage
(
w
io
.
Writer
)
{
func
masterUsage
(
w
io
.
Writer
)
{
fmt
.
Fprintf
(
w
,
fmt
.
Fprintf
(
w
,
`Usage: neo master [options]
`Usage: neo master [options]
Run NEO master node.
Run NEO master node.
`
)
`
)
// FIXME use w (see flags.SetOutput)
}
}
func
masterMain
(
argv
[]
string
)
{
func
masterMain
(
argv
[]
string
)
{
...
@@ -55,7 +53,6 @@ func masterMain(argv []string) {
...
@@ -55,7 +53,6 @@ func masterMain(argv []string) {
flags
.
Parse
(
argv
[
1
:
])
flags
.
Parse
(
argv
[
1
:
])
if
*
cluster
==
""
{
if
*
cluster
==
""
{
// XXX vvv -> die or log.Fatalf ?
zt
.
Fatal
(
"cluster name must be provided"
)
zt
.
Fatal
(
"cluster name must be provided"
)
}
}
...
...
go/neo/neotools/storage.go
View file @
3c9b64ae
...
@@ -38,11 +38,13 @@ const storageSummary = "run storage node"
...
@@ -38,11 +38,13 @@ const storageSummary = "run storage node"
func
storageUsage
(
w
io
.
Writer
)
{
func
storageUsage
(
w
io
.
Writer
)
{
fmt
.
Fprintf
(
w
,
fmt
.
Fprintf
(
w
,
`Usage: neo storage [options]
zstor XXX
`Usage: neo storage [options]
<data.fs>
Run NEO storage node.
Run NEO storage node.
`
)
// FIXME use w (see flags.SetOutput)
<data.fs> is a path to FileStorage v1 file.
XXX currently storage is read-only.
`
)
}
}
// TODO set GOMAXPROCS *= N (a lot of file IO) + link
// TODO set GOMAXPROCS *= N (a lot of file IO) + link
...
@@ -58,18 +60,15 @@ func storageMain(argv []string) {
...
@@ -58,18 +60,15 @@ func storageMain(argv []string) {
flags
.
Parse
(
argv
[
1
:
])
flags
.
Parse
(
argv
[
1
:
])
if
*
cluster
==
""
{
if
*
cluster
==
""
{
// XXX vvv -> die or Fatalf ?
zt
.
Fatal
(
"cluster name must be provided"
)
zt
.
Fatal
(
os
.
Stderr
,
"cluster name must be provided"
)
}
}
masterv
:=
strings
.
Split
(
*
masters
,
","
)
masterv
:=
strings
.
Split
(
*
masters
,
","
)
if
len
(
masterv
)
==
0
{
if
len
(
masterv
)
==
0
{
fmt
.
Fprintf
(
os
.
Stderr
,
"master list must be provided"
)
zt
.
Fatal
(
"master list must be provided"
)
zt
.
Exit
(
2
)
}
}
if
len
(
masterv
)
>
1
{
if
len
(
masterv
)
>
1
{
fmt
.
Fprintf
(
os
.
Stderr
,
"BUG neo/go POC currently supports only 1 master"
)
zt
.
Fatal
(
"BUG neo/go POC currently supports only 1 master"
)
zt
.
Exit
(
2
)
}
}
master
:=
masterv
[
0
]
master
:=
masterv
[
0
]
...
@@ -81,7 +80,7 @@ func storageMain(argv []string) {
...
@@ -81,7 +80,7 @@ func storageMain(argv []string) {
}
}
// XXX hack to use existing zodb storage for data
// XXX hack to use existing zodb storage for data
zstor
,
err
:=
fs1
.
Open
(
context
.
Background
(),
argv
[
0
])
// XXX context.Background -> ?
zstor
,
err
:=
fs1
.
Open
(
context
.
Background
(),
argv
[
0
])
if
err
!=
nil
{
if
err
!=
nil
{
zt
.
Fatal
(
err
)
zt
.
Fatal
(
err
)
}
}
...
...
go/neo/t/t.sh
0 → 100644
View file @
3c9b64ae
#!/bin/bash -e
# run 1 mixed py/go NEO cluster
# Mpy <cluster> <bind>
# spawn py master
Mpy
()
{
# XXX --masters=?
neomaster
--cluster
=
$1
--bind
=
$2
-r
1
-p
1
--autostart
=
1
--logfile
=
`
pwd
`
/master.log
}
# Sgo <cluster> <bind> <masters> <data>
# spwan go storage
Sgo
()
{
neo storage
-cluster
=
$1
-bind
=
$2
-masters
=
$3
-logdir
=
`
pwd
`
$4
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment