Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MainNet commitments
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
archives
MainNet commitments
Commits
31b1bb76
Commit
31b1bb76
authored
3 years ago
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Logging fixes, check path param before trying to load
parent
e400fb7b
No related branches found
No related tags found
1 merge request
!10
Draft: November commitments
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
client/client_test.go
+1
-1
1 addition, 1 deletion
client/client_test.go
cmd/server.go
+3
-0
3 additions, 0 deletions
cmd/server.go
server/serverImpl.go
+16
-12
16 additions, 12 deletions
server/serverImpl.go
with
20 additions
and
13 deletions
client/client_test.go
+
1
−
1
View file @
31b1bb76
...
...
@@ -93,7 +93,7 @@ func TestSignAndTransmit(t *testing.T) {
Port
:
"11420"
,
},
mapImpl
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to start dummy server
"
)
t
.
Errorf
(
"Failed to start dummy server
: %+v"
,
err
)
errChan
<-
err
}
else
{
doneChan
<-
true
...
...
This diff is collapsed.
Click to expand it.
cmd/server.go
+
3
−
0
View file @
31b1bb76
...
...
@@ -90,6 +90,9 @@ var serverCmd = &cobra.Command{
}
err
=
server
.
StartServer
(
params
,
s
)
if
err
!=
nil
{
jww
.
FATAL
.
Fatalf
(
"Failed to start server: %+v"
,
err
)
}
var
stopCh
=
make
(
chan
bool
)
select
{
case
<-
stopCh
:
...
...
This diff is collapsed.
Click to expand it.
server/serverImpl.go
+
16
−
12
View file @
31b1bb76
...
...
@@ -52,6 +52,7 @@ func StartServer(params Params, s *storage.Storage) error {
}
// Attempt to load in list of node IDs exempt from duplicate wallet checking
if
params
.
IDListPath
!=
""
{
if
p
,
err
:=
pathutils
.
ExpandPath
(
params
.
IDListPath
);
err
==
nil
{
idList
,
err
:=
pathutils
.
ReadFile
(
p
)
if
err
!=
nil
{
...
...
@@ -66,6 +67,7 @@ func StartServer(params Params, s *storage.Storage) error {
}
else
{
return
errors
.
WithMessage
(
err
,
"Failed to expand ID list path"
)
}
}
// Build gin server, link to verify code
r
:=
gin
.
Default
()
...
...
@@ -97,7 +99,9 @@ func StartServer(params Params, s *storage.Storage) error {
c
.
JSON
(
http
.
StatusAccepted
,
newCommitment
)
})
impl
.
comms
=
r
// Run with TLS
jww
.
INFO
.
Print
(
"Starting commitments server..."
)
if
params
.
KeyPath
==
""
&&
params
.
CertPath
==
""
{
jww
.
WARN
.
Println
(
"NO TLS CONFIGURED"
)
return
r
.
Run
(
fmt
.
Sprintf
(
"0.0.0.0:%s"
,
params
.
Port
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment