Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
token-bridge
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
movabridge
token-bridge
Commits
7006abff
Commit
7006abff
authored
Sep 18, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add chain sync interval
parent
6bb4f378
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
sync.go
chain/sync.go
+5
-0
config.go
config/config.go
+4
-0
No files found.
chain/sync.go
View file @
7006abff
...
@@ -143,6 +143,11 @@ func (s *ChainSync) loop() {
...
@@ -143,6 +143,11 @@ func (s *ChainSync) loop() {
})
.
Info
(
"validator block"
)
})
.
Info
(
"validator block"
)
beginHeight
=
endHeight
+
1
beginHeight
=
endHeight
+
1
if
s
.
syncmode
{
tm
.
Reset
(
time
.
Second
)
}
else
{
tm
.
Reset
(
time
.
Second
*
time
.
Duration
(
s
.
chain
.
Interval
))
}
}
}
}
}
}
}
...
...
config/config.go
View file @
7006abff
...
@@ -20,6 +20,7 @@ type ChainConfig struct {
...
@@ -20,6 +20,7 @@ type ChainConfig struct {
BatchBlock
int
`toml:"batch_block"`
BatchBlock
int
`toml:"batch_block"`
BehindBlock
int
`toml:"behind_block"`
BehindBlock
int
`toml:"behind_block"`
BridgeContract
string
`toml:"bridge_contract"`
BridgeContract
string
`toml:"bridge_contract"`
Interval
int
`toml:"interval"`
// in seconds
//ValidatorPrivateKey string `toml:"validator_private_key"`
//ValidatorPrivateKey string `toml:"validator_private_key"`
ChainId
int64
`toml:"chain_id"`
// Will be populated by code
ChainId
int64
`toml:"chain_id"`
// Will be populated by code
}
}
...
@@ -65,6 +66,9 @@ func New(confPath string) (*Config, error) {
...
@@ -65,6 +66,9 @@ func New(confPath string) (*Config, error) {
// Convert to map for easier access
// Convert to map for easier access
for
_
,
chain
:=
range
chainArray
{
for
_
,
chain
:=
range
chainArray
{
chainCopy
:=
chain
// Create a copy to avoid pointer issues
chainCopy
:=
chain
// Create a copy to avoid pointer issues
if
chainCopy
.
Interval
<=
0
{
chainCopy
.
Interval
=
2
}
cfg
.
Chains
[
chain
.
Name
]
=
&
chainCopy
cfg
.
Chains
[
chain
.
Name
]
=
&
chainCopy
}
}
...
...
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