Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
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
exchain
nebula
Commits
406c2ca9
Commit
406c2ca9
authored
Dec 04, 2023
by
pcw109550
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-chain-ops: Delta checker script
parent
179aea69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
check-delta.sh
op-chain-ops/cmd/check-delta/check-delta.sh
+38
-0
No files found.
op-chain-ops/cmd/check-delta/check-delta.sh
0 → 100755
View file @
406c2ca9
#!/bin/bash
# Check if a directory path is provided
# Directory must contain the output of batch_decoder's reassemble command
if
[
-z
"
$1
"
]
;
then
echo
"Usage:
$0
/path/to/directory"
exit
1
fi
directory_path
=
$1
valid_count
=
0
invalid_count
=
0
invalid_channels
=()
# Loop over every .json file in the specified directory
for
file
in
"
$directory_path
"
/
*
.json
;
do
# If channel is ready, all batches must valid.
# If delta is activated, all batch types must be span batch.
result
=
$(
jq
'if .is_ready then (.invalid_batches == false and all(.batch_types[]; . == 1)) else empty end'
"
$file
"
)
if
[[
$result
==
"true"
]]
;
then
((
valid_count++
))
elif
[[
$result
==
"false"
]]
;
then
((
invalid_count++
))
invalid_channels+
=(
"
$file
"
)
fi
done
# Display the counts
echo
"Valid count:
$valid_count
"
echo
"Invalid count:
$invalid_count
"
# Display the files that returned invalid results
if
[
${#
invalid_channels
[@]
}
-gt
0
]
;
then
echo
"Channels with invalid results:"
printf
'[*] %s\n'
"
${
invalid_channels
[@]
}
"
else
echo
"All processed channels are valid and contains successfully derived span batches."
fi
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