-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add HTTP
and WebSocket
handlers for JSON-RPC
server
#11
Merged
m-Peter
merged 30 commits into
onflow:main
from
m-Peter:add-http-and-web-socket-handlers
Jan 10, 2024
Merged
Changes from 15 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
a32d801
Add HTTP and WebSocket handlers for JSON-RPC server
m-Peter 57f4553
Fetch chainID from flow-go repository
m-Peter ab6e342
Add a basic indexing functionality
m-Peter 03c6a9a
Add description for commented-out code
m-Peter f291025
Use hexutil.Bytes as type for input on SendRawTransaction rpc method
m-Peter 0ddb302
Add tests for JSON-RPC HTTP handler & BlockChainAPI service
m-Peter 4251feb
Add a basic Makefile and CI workflow for GitHub
m-Peter 9f9375f
Run JSON-RPC HTTP handler on port 8545 which most clients default to …
m-Peter 00f6a43
Test more JSON-RPC methods and some mock data
m-Peter 78b1e39
Use empty value for sync.RWMutex when initializing the Store
m-Peter de90c62
Acquire read lock in LatestBlockHeight
m-Peter 4d47834
Add reconnect functionality in indexer
m-Peter 2b36693
Add a heartbeatInterval parameter to SubscribeEvents and check that a…
m-Peter 97553aa
Remove all redundant functionality from JSON-RPC HTTP & WebSocket han…
m-Peter b343e74
Run go mod tidy
m-Peter 42be5cd
Introduce a basic Config type for the BlockChainAPI
m-Peter 130b167
Add eth RPC methods for getting uncles
m-Peter 8545330
Base indexer functionality on flow-go-sdk's BaseClient
m-Peter 974e834
Add check-tidy and ci recipes in Makefile and use in CI workflow
m-Peter b8b8ac9
Add TODO for including more options in Config
m-Peter ed60231
Rename blockHeight to latestHeight and add a TODO for requiring it in…
m-Peter f55dc7b
Replace fmt.Println with a proper logger
m-Peter 24cab8e
Add a time.Sleep before reconnecting the indexer
m-Peter e893a6f
Create dedicated fixtures for eth JSON-RPC requests & responses
m-Peter eb14c1e
Remove workaround for chainhash ambiguous import
m-Peter df9553c
Add a panic in BlockNumber() when retrieval from storage fails
m-Peter 328de2f
Refactor the reconnect method to be able to re-use it
m-Peter fc18d38
Add disclaimer about the source of inspiration for the httpServer
m-Peter 6173b96
Add TODO for getting rid of mock data in favor of storage & indexer i…
m-Peter aaf3ba3
Run make test recipe with -cover flag
m-Peter 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
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,27 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
name: "Test" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20.x' | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run tests | ||
run: make test |
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,4 @@ | ||
.PHONY: test | ||
test: | ||
# test all packages | ||
go test -parallel 8 ./... |
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.
Ideally, in the future try to keep these kinds of changes in separate PRs so they are more focused.
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.
Makes sense 👍 Will do.