ipld-eth-beacon-indexer/entrypoint.sh

40 lines
960 B
Bash
Raw Normal View History

Testing, CI/CD and DB connections (#10) * Update cobra to require `head` or `historic` when using `capture`. * A very generic package for implementing PGX driver I copied most of the code from the `statediff` service from within geth. The idea is that I can create formal DB packages, that can be utilized in other projects down the road. * Put PGX and other future Postgres Drivers behind SQL package This PR makes allows users to provide a config, along with a driver string. It will then provide the respective driver. * Add DB Connection and Logging * Utilize LogRus * Create a DB connection using PGX. * Create an internal boot package for starting the application. * Code clean up + Beacon Chain Connection This concludes all the code needed to connect to the DB and beacon node. We will no longer reference the lighthouse client because this application should work interchangeably with any beacon node. I have also standardized logging. * Last second clean ups * Utilize Ginkgo toreplace `testing` library, and add CI/CD. (#9) * Utilize Ginkgo and replace `testing` library. * Add TOC to docs * Add Docker specific files * Remove -e * Update on-pr-manual.yml * Add depth * Add repositories * Remove $ from path * Update path for make * Setup Go and Ginkgo * Use go mod download * Use go install * Update on-pr-manual.yml * Use latest * Remove install of GINKGO * Add explicit gopath * Explicitly specify the gopath * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Use which ginkgo * Try with make now * Final working Make
2022-04-22 12:31:57 +00:00
#!/bin/bash
sleep 10
Testing, CI/CD and DB connections (#10) * Update cobra to require `head` or `historic` when using `capture`. * A very generic package for implementing PGX driver I copied most of the code from the `statediff` service from within geth. The idea is that I can create formal DB packages, that can be utilized in other projects down the road. * Put PGX and other future Postgres Drivers behind SQL package This PR makes allows users to provide a config, along with a driver string. It will then provide the respective driver. * Add DB Connection and Logging * Utilize LogRus * Create a DB connection using PGX. * Create an internal boot package for starting the application. * Code clean up + Beacon Chain Connection This concludes all the code needed to connect to the DB and beacon node. We will no longer reference the lighthouse client because this application should work interchangeably with any beacon node. I have also standardized logging. * Last second clean ups * Utilize Ginkgo toreplace `testing` library, and add CI/CD. (#9) * Utilize Ginkgo and replace `testing` library. * Add TOC to docs * Add Docker specific files * Remove -e * Update on-pr-manual.yml * Add depth * Add repositories * Remove $ from path * Update path for make * Setup Go and Ginkgo * Use go mod download * Use go install * Update on-pr-manual.yml * Use latest * Remove install of GINKGO * Add explicit gopath * Explicitly specify the gopath * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Use which ginkgo * Try with make now * Final working Make
2022-04-22 12:31:57 +00:00
echo "Starting ipld-ethcl-indexer"
echo /root/ipld-ethcl-indexer capture ${CAPTURE_MODE} --db.address $DB_ADDRESS \
Testing, CI/CD and DB connections (#10) * Update cobra to require `head` or `historic` when using `capture`. * A very generic package for implementing PGX driver I copied most of the code from the `statediff` service from within geth. The idea is that I can create formal DB packages, that can be utilized in other projects down the road. * Put PGX and other future Postgres Drivers behind SQL package This PR makes allows users to provide a config, along with a driver string. It will then provide the respective driver. * Add DB Connection and Logging * Utilize LogRus * Create a DB connection using PGX. * Create an internal boot package for starting the application. * Code clean up + Beacon Chain Connection This concludes all the code needed to connect to the DB and beacon node. We will no longer reference the lighthouse client because this application should work interchangeably with any beacon node. I have also standardized logging. * Last second clean ups * Utilize Ginkgo toreplace `testing` library, and add CI/CD. (#9) * Utilize Ginkgo and replace `testing` library. * Add TOC to docs * Add Docker specific files * Remove -e * Update on-pr-manual.yml * Add depth * Add repositories * Remove $ from path * Update path for make * Setup Go and Ginkgo * Use go mod download * Use go install * Update on-pr-manual.yml * Use latest * Remove install of GINKGO * Add explicit gopath * Explicitly specify the gopath * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Use which ginkgo * Try with make now * Final working Make
2022-04-22 12:31:57 +00:00
--db.password $DB_PASSWORD \
--db.port $DB_PORT \
--db.username $DB_USER \
--db.name $DB_NAME \
--db.driver $DB_DRIVER \
--bc.address $BC_ADDRESS \
--bc.port $BC_PORT \
--log.level $LOG_LEVEL\
multihash key gen func (#36) * multihash key gen func * go mod updates * Added test to ensure the application shuts down gracefully or within a timeframe. * Disregard race condition since its with the test not the application itself * Capture the head block in the DB entirely. (#27) * -- Intermediary Commit -- Just want to commit my code over the weekend, in case I spill coffee on my workstation. * Create DB models ready for write. * Handle SSE events * Update ref for stack-orchestrator * Use env in one place only. * Boot Application on PR * Update syntax * Update syntax * Correct command * Use bash instead of sh * Use until instead of while * Make linter happy and check sse subscription err * Handle Reorgs - Untested * Feature/22 test handling incoming events - Intermediary Commit (#28) * Checkpoint before the weekend * Update location for SetupPostgresDB * Feature/22 test handling incoming events (#30) * Checkpoint before the weekend * Update location for SetupPostgresDB * Include first functioning tests for processing head * Fix gitignore * Test CaptureHead | Add Metrics | Handle Test Race Conditions This Commit allows us to: * Test the `CaptureHead` function. * Test parsing a single Head message. * Test a Reorg condition. * Add Metrics. This is primarily used for testing but can have future use cases. * Rearrange the test due to race conditions introduced by reusing a variable. `BeforeEach` can't be used to update `BC`. * Update and finalize testing at this stage * Update code and CI/CD * Fix lint errors * Update CICD and fail when file not found. * Update test to have failed as expected. * Remove Test file * Add KnownGaps Errors (#33) * Handle Skipped Slots (#34) * Ensure that the node is synced at boot time * Update test + add logic for checking skipped slots * Update boot check * Add skip_sync to config. * Update a test so it fails * go mod updates * Integrate MHKey into existing code base. * Update go.mod and go.sum * Utilize the MHkey * Stop tests from running forever on failure. * Use sszRoot instead of sszObj for MhKey * Update entrypoint script * Update config parameter Co-authored-by: Abdul Rabbani <abdulrabbani00@gmail.com> Co-authored-by: Abdul Rabbani <58230246+abdulrabbani00@users.noreply.github.com>
2022-05-13 14:46:13 +00:00
--t.skipSync=$SKIP_SYNC \
--kg.increment $KNOWN_GAP_INCREMENT
Testing, CI/CD and DB connections (#10) * Update cobra to require `head` or `historic` when using `capture`. * A very generic package for implementing PGX driver I copied most of the code from the `statediff` service from within geth. The idea is that I can create formal DB packages, that can be utilized in other projects down the road. * Put PGX and other future Postgres Drivers behind SQL package This PR makes allows users to provide a config, along with a driver string. It will then provide the respective driver. * Add DB Connection and Logging * Utilize LogRus * Create a DB connection using PGX. * Create an internal boot package for starting the application. * Code clean up + Beacon Chain Connection This concludes all the code needed to connect to the DB and beacon node. We will no longer reference the lighthouse client because this application should work interchangeably with any beacon node. I have also standardized logging. * Last second clean ups * Utilize Ginkgo toreplace `testing` library, and add CI/CD. (#9) * Utilize Ginkgo and replace `testing` library. * Add TOC to docs * Add Docker specific files * Remove -e * Update on-pr-manual.yml * Add depth * Add repositories * Remove $ from path * Update path for make * Setup Go and Ginkgo * Use go mod download * Use go install * Update on-pr-manual.yml * Use latest * Remove install of GINKGO * Add explicit gopath * Explicitly specify the gopath * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Use which ginkgo * Try with make now * Final working Make
2022-04-22 12:31:57 +00:00
/root/ipld-ethcl-indexer capture ${CAPTURE_MODE} --db.address $DB_ADDRESS \
Testing, CI/CD and DB connections (#10) * Update cobra to require `head` or `historic` when using `capture`. * A very generic package for implementing PGX driver I copied most of the code from the `statediff` service from within geth. The idea is that I can create formal DB packages, that can be utilized in other projects down the road. * Put PGX and other future Postgres Drivers behind SQL package This PR makes allows users to provide a config, along with a driver string. It will then provide the respective driver. * Add DB Connection and Logging * Utilize LogRus * Create a DB connection using PGX. * Create an internal boot package for starting the application. * Code clean up + Beacon Chain Connection This concludes all the code needed to connect to the DB and beacon node. We will no longer reference the lighthouse client because this application should work interchangeably with any beacon node. I have also standardized logging. * Last second clean ups * Utilize Ginkgo toreplace `testing` library, and add CI/CD. (#9) * Utilize Ginkgo and replace `testing` library. * Add TOC to docs * Add Docker specific files * Remove -e * Update on-pr-manual.yml * Add depth * Add repositories * Remove $ from path * Update path for make * Setup Go and Ginkgo * Use go mod download * Use go install * Update on-pr-manual.yml * Use latest * Remove install of GINKGO * Add explicit gopath * Explicitly specify the gopath * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Use which ginkgo * Try with make now * Final working Make
2022-04-22 12:31:57 +00:00
--db.password $DB_PASSWORD \
--db.port $DB_PORT \
--db.username $DB_USER \
--db.name $DB_NAME \
--db.driver $DB_DRIVER \
--bc.address $BC_ADDRESS \
--bc.port $BC_PORT \
--log.level $LOG_LEVEL \
multihash key gen func (#36) * multihash key gen func * go mod updates * Added test to ensure the application shuts down gracefully or within a timeframe. * Disregard race condition since its with the test not the application itself * Capture the head block in the DB entirely. (#27) * -- Intermediary Commit -- Just want to commit my code over the weekend, in case I spill coffee on my workstation. * Create DB models ready for write. * Handle SSE events * Update ref for stack-orchestrator * Use env in one place only. * Boot Application on PR * Update syntax * Update syntax * Correct command * Use bash instead of sh * Use until instead of while * Make linter happy and check sse subscription err * Handle Reorgs - Untested * Feature/22 test handling incoming events - Intermediary Commit (#28) * Checkpoint before the weekend * Update location for SetupPostgresDB * Feature/22 test handling incoming events (#30) * Checkpoint before the weekend * Update location for SetupPostgresDB * Include first functioning tests for processing head * Fix gitignore * Test CaptureHead | Add Metrics | Handle Test Race Conditions This Commit allows us to: * Test the `CaptureHead` function. * Test parsing a single Head message. * Test a Reorg condition. * Add Metrics. This is primarily used for testing but can have future use cases. * Rearrange the test due to race conditions introduced by reusing a variable. `BeforeEach` can't be used to update `BC`. * Update and finalize testing at this stage * Update code and CI/CD * Fix lint errors * Update CICD and fail when file not found. * Update test to have failed as expected. * Remove Test file * Add KnownGaps Errors (#33) * Handle Skipped Slots (#34) * Ensure that the node is synced at boot time * Update test + add logic for checking skipped slots * Update boot check * Add skip_sync to config. * Update a test so it fails * go mod updates * Integrate MHKey into existing code base. * Update go.mod and go.sum * Utilize the MHkey * Stop tests from running forever on failure. * Use sszRoot instead of sszObj for MhKey * Update entrypoint script * Update config parameter Co-authored-by: Abdul Rabbani <abdulrabbani00@gmail.com> Co-authored-by: Abdul Rabbani <58230246+abdulrabbani00@users.noreply.github.com>
2022-05-13 14:46:13 +00:00
--t.skipSync=$SKIP_SYNC \
--kg.increment $KNOWN_GAP_INCREMENT
Testing, CI/CD and DB connections (#10) * Update cobra to require `head` or `historic` when using `capture`. * A very generic package for implementing PGX driver I copied most of the code from the `statediff` service from within geth. The idea is that I can create formal DB packages, that can be utilized in other projects down the road. * Put PGX and other future Postgres Drivers behind SQL package This PR makes allows users to provide a config, along with a driver string. It will then provide the respective driver. * Add DB Connection and Logging * Utilize LogRus * Create a DB connection using PGX. * Create an internal boot package for starting the application. * Code clean up + Beacon Chain Connection This concludes all the code needed to connect to the DB and beacon node. We will no longer reference the lighthouse client because this application should work interchangeably with any beacon node. I have also standardized logging. * Last second clean ups * Utilize Ginkgo toreplace `testing` library, and add CI/CD. (#9) * Utilize Ginkgo and replace `testing` library. * Add TOC to docs * Add Docker specific files * Remove -e * Update on-pr-manual.yml * Add depth * Add repositories * Remove $ from path * Update path for make * Setup Go and Ginkgo * Use go mod download * Use go install * Update on-pr-manual.yml * Use latest * Remove install of GINKGO * Add explicit gopath * Explicitly specify the gopath * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Use which ginkgo * Try with make now * Final working Make
2022-04-22 12:31:57 +00:00
rv=$?
if [ $rv != 0 ]; then
echo "ipld-ethcl-indexer startup failed"
echo 1 > /root/HEALTH
else
echo "ipld-ethcl-indexer startup succeeded"
echo 0 > /root/HEALTH
Testing, CI/CD and DB connections (#10) * Update cobra to require `head` or `historic` when using `capture`. * A very generic package for implementing PGX driver I copied most of the code from the `statediff` service from within geth. The idea is that I can create formal DB packages, that can be utilized in other projects down the road. * Put PGX and other future Postgres Drivers behind SQL package This PR makes allows users to provide a config, along with a driver string. It will then provide the respective driver. * Add DB Connection and Logging * Utilize LogRus * Create a DB connection using PGX. * Create an internal boot package for starting the application. * Code clean up + Beacon Chain Connection This concludes all the code needed to connect to the DB and beacon node. We will no longer reference the lighthouse client because this application should work interchangeably with any beacon node. I have also standardized logging. * Last second clean ups * Utilize Ginkgo toreplace `testing` library, and add CI/CD. (#9) * Utilize Ginkgo and replace `testing` library. * Add TOC to docs * Add Docker specific files * Remove -e * Update on-pr-manual.yml * Add depth * Add repositories * Remove $ from path * Update path for make * Setup Go and Ginkgo * Use go mod download * Use go install * Update on-pr-manual.yml * Use latest * Remove install of GINKGO * Add explicit gopath * Explicitly specify the gopath * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Update on-pr-manual.yml * Use which ginkgo * Try with make now * Final working Make
2022-04-22 12:31:57 +00:00
fi
tail -f /dev/null