-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offline RPC #3866
Merged
Merged
Offline RPC #3866
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
892e9a5
Impl node less rpc
sudo-shashank a257bef
fix
sudo-shashank 8b745c9
Set SyncStage to idle and Cleanup
sudo-shashank 8e1beaa
fmt
sudo-shashank 447303d
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank ed75192
fix and add new methods
sudo-shashank 731e154
add new rpc
sudo-shashank 03de8c8
lint-fix
sudo-shashank 200c84d
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank 60256eb
add ci test
sudo-shashank f49c717
fix check rpc script
sudo-shashank 8764c90
updated changelog
sudo-shashank a47ec6f
lint fix
sudo-shashank fd47b3b
fix
sudo-shashank d0c68fa
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank fcb1ad3
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank 8de82d7
refactored api serve subcommand
sudo-shashank 4d8b7f4
use logger
sudo-shashank 2a6adb0
fix logger
sudo-shashank 6e0e8a0
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank dda6e33
remove use of tmp dir
sudo-shashank 9d17dfd
Updated offline rpc test script
sudo-shashank a88cb56
lint fix
sudo-shashank 0540c17
fix
sudo-shashank 854325e
fix typo
sudo-shashank 2cad4ba
limit tipset in compare
sudo-shashank 2e4c090
cleanup
sudo-shashank 99627e0
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank 366eff8
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank 0b05045
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank 0f82ed6
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank 0ea032e
treat timeout as success
sudo-shashank 4595a4e
fix changelog
sudo-shashank 59a55d2
fmt
sudo-shashank 7f21806
fmt
sudo-shashank 0bf99d0
add auto snapshot download option
sudo-shashank 1b4e0c8
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank 79002c4
fix peek method call
sudo-shashank 2e03771
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank e16498e
Merge branch 'main' into shashank/node-less-rpc
sudo-shashank File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
# This script is used to test the offline RPC API server against itself. | ||
# It's run in CI, and uses forest-tool api compare subcommand to test RPC endpoints. | ||
|
||
set -euxo pipefail | ||
|
||
FOREST_TOOL_PATH="forest-tool" | ||
PORTS=(8080 8081) | ||
|
||
# Function to stop services on specified ports | ||
stop_services() { | ||
for port in "${PORTS[@]}"; do | ||
fuser -k "$port/tcp" || true | ||
done | ||
} | ||
|
||
# Fetch latest calibnet snapshot | ||
snapshot="$("$FOREST_TOOL_PATH" snapshot fetch --chain calibnet)" | ||
|
||
# Start Offline RPC servers on ports | ||
for i in "${!PORTS[@]}"; do | ||
port=${PORTS[$i]} | ||
data_dir="offline-rpc-db-$((i + 1))" | ||
"$FOREST_TOOL_PATH" api serve "$snapshot" --chain calibnet --port "$port" --data-dir "$data_dir" & | ||
done | ||
|
||
# Check if services on ports have started | ||
for port in "${PORTS[@]}"; do | ||
until nc -z localhost "$port"; do | ||
sleep 30 | ||
done | ||
done | ||
|
||
# Compare | ||
$FOREST_TOOL_PATH api compare "$snapshot" --forest /ip4/127.0.0.1/tcp/8080/http --lotus /ip4/127.0.0.1/tcp/8081/http --n-tipsets 5 | ||
exit_code=$? | ||
|
||
# Check the result | ||
if [ $exit_code -ne 0 ]; then | ||
stop_services | ||
exit 1 | ||
fi | ||
|
||
# Stop services on ports | ||
stop_services |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it