Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
11631c51
Unverified
Commit
11631c51
authored
Feb 03, 2021
by
Ralph Pichler
Committed by
GitHub
Feb 03, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wait for clef on startup (#1186)
parent
f3817f69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
start.go
cmd/bee/cmd/start.go
+17
-1
No files found.
cmd/bee/cmd/start.go
View file @
11631c51
...
...
@@ -243,6 +243,22 @@ type signerConfig struct {
pssPrivateKey
*
ecdsa
.
PrivateKey
}
func
waitForClef
(
logger
logging
.
Logger
,
maxRetries
uint64
,
endpoint
string
)
(
externalSigner
*
external
.
ExternalSigner
,
err
error
)
{
for
{
externalSigner
,
err
=
external
.
NewExternalSigner
(
endpoint
)
if
err
==
nil
{
return
externalSigner
,
nil
}
if
maxRetries
==
0
{
return
nil
,
err
}
maxRetries
--
logger
.
Errorf
(
"cannot connect to clef signer: %v"
,
err
)
time
.
Sleep
(
5
*
time
.
Second
)
}
}
func
(
c
*
command
)
configureSigner
(
cmd
*
cobra
.
Command
,
logger
logging
.
Logger
)
(
config
*
signerConfig
,
err
error
)
{
var
keystore
keystore
.
Service
if
c
.
config
.
GetString
(
optionNameDataDir
)
==
""
{
...
...
@@ -294,7 +310,7 @@ func (c *command) configureSigner(cmd *cobra.Command, logger logging.Logger) (co
}
}
externalSigner
,
err
:=
external
.
NewExternalSigner
(
endpoint
)
externalSigner
,
err
:=
waitForClef
(
logger
,
5
,
endpoint
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
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