Compare commits

..
192 Commits
Author SHA1 Message Date
dboreham 964edbec6f Merge pull request #182 from cerc-io/dboreham/check-for-js-builder
Check for builder container in npm build

Former-commit-id: 6c1bedc67e
2023-02-20 16:16:43 -07:00
dboreham 6f2a44ba2f Check for builder container in npm build
Former-commit-id: 156758bfa7
2023-02-20 16:16:15 -07:00
dboreham 9053d2d782 Merge pull request #180 from cerc-io/dboreham/npm-build-with-package-stack
npm build with package-registry stack

Former-commit-id: 9f07a0ed4b
2023-02-20 12:49:20 -07:00
dboreham 628fed4ef7 Working feature
Former-commit-id: f14a4a33d7
2023-02-20 12:46:56 -07:00
dboreham c737ec7ed6 Wire up to build-npms
Former-commit-id: 7e6268c39d
2023-02-20 06:43:06 -07:00
dboreham d927c92c0a Call from base stack class
Former-commit-id: f1cbce1d00
2023-02-20 06:23:21 -07:00
dboreham 142be179f4 Initial implementation
Former-commit-id: 68293cbaa3
2023-02-20 06:09:35 -07:00
dboreham 547ca561c0 Update python on whales
Former-commit-id: 7d51e4b9aa
2023-02-19 17:46:47 -07:00
dboreham 863e19211e Remove debug code
Former-commit-id: 5ceed34160
2023-02-17 15:38:24 -07:00
dboreham e20f9993d2 Merge pull request #178 from cerc-io/dboreham/package-registry-stack
Support for the package registry stack

Former-commit-id: e5197e4918
2023-02-17 15:36:28 -07:00
dboreham 9dab9b815c Add newline
Former-commit-id: 63c93acb83
2023-02-17 15:36:09 -07:00
dboreham 83115bcb9d Fix comment
Former-commit-id: 88d81f7df6
2023-02-17 15:35:31 -07:00
dboreham 46c22f4e4f Add pre/post script support
Former-commit-id: bb39d90522
2023-02-17 15:31:43 -07:00
dboreham 912483df58 Basic functionality
Former-commit-id: a1893aa153
2023-02-17 14:15:35 -07:00
dboreham ff69670db6 Initial commit
Former-commit-id: 60c1da725e
2023-02-17 13:34:51 -07:00
dboreham 871cd90456 Missed one update
Former-commit-id: 2bf50383dd
2023-02-17 11:53:58 -07:00
dboreham 639ab8cbc3 Update to use stack syntax
Former-commit-id: 6569a2a2b6
2023-02-17 11:53:05 -07:00
telackey bc5eff71b5 Use latest keycloak plugin. (#173)
Former-commit-id: 8645ab0619
2023-02-01 16:02:49 -06:00
dboreham 5ec774a300 Update version
Former-commit-id: b0520a042a
2023-01-30 22:29:38 +01:00
dboreham 9a750f0d9e Update version
Former-commit-id: 10f2fbaa37
2023-01-30 22:28:33 +01:00
dboreham 8a6ba6d01b Merge pull request #172 from cerc-io/dboreham/revert-foundry-image
Revert local foundry build

Former-commit-id: 3bd0c74e1f
2023-01-30 22:06:26 +01:00
dboreham b4ddef7ff0 Revert local foundry build
Former-commit-id: e850923e1a
2023-01-30 14:05:48 -07:00
dboreham a38ac5470d Merge pull request #171 from cerc-io/dboreham/fixturenet-loaded
Initial commit

Former-commit-id: 82c2bb78f2
2023-01-30 19:12:06 +01:00
dboreham 77380aec94 Initial commit
Former-commit-id: f01bc27660
2023-01-30 16:53:57 +01:00
dboreham ce7e5f2d82 Merge pull request #169 from cerc-io/dboreham/fix-gerbil-package-install
Install gerbil packages globally not locally in the project directory

Former-commit-id: db5775621d
2023-01-28 11:35:44 -07:00
dboreham 4dda8e2a87 Install gerbil packages globally not locally in the project directory
Former-commit-id: 5928e40721
2023-01-28 18:56:43 +01:00
dboreham 24ab259741 Merge pull request #167 from cerc-io/dboreham/release-doc
Add release process doc

Former-commit-id: 605a9aeda1
2023-01-27 22:25:53 -07:00
David Boreham 607575e4f4 Add release process doc
Former-commit-id: 1b3a14d86f
2023-01-27 21:22:43 -07:00
dboreham 86e245e272 Merge pull request #166 from cerc-io/dboreham/fix-fixturenet-status
Fix status script

Former-commit-id: fc31b44b5a
2023-01-27 08:10:32 -07:00
dboreham d677e5f369 Fix status script
Former-commit-id: 5a3bdd269d
2023-01-27 08:10:04 -07:00
dboreham 9991baa8d6 Update version
Former-commit-id: 04f61293b5
2023-01-27 07:30:14 -07:00
dboreham d033d4ff93 Merge pull request #164 from cerc-io/dboreham/fixturenet-eth-fixes
Fixes to fixturenet-eth

Former-commit-id: ecf943b593
2023-01-26 21:36:23 -07:00
dboreham f02bbee3bf Fixes to fixturenet-eth
Former-commit-id: e4229e4ceb
2023-01-26 16:47:06 -07:00
telackey bdde1b2c9e Include all eth API operation metrics. (#162)
Former-commit-id: ce0c7ee9ba
2023-01-26 13:53:02 -06:00
dboreham 96a83422e7 Merge pull request #161 from cerc-io/dboreham/run-command-in-container
Exec command inside container

Former-commit-id: 6770f7af6e
2023-01-25 23:22:57 -07:00
dboreham af03208da7 Exec command inside container
Former-commit-id: ade20fb2f5
2023-01-25 23:22:05 -07:00
dboreham 86e2407800 Update version
Former-commit-id: bf91048dbb
2023-01-25 22:47:08 -07:00
dboreham c01ff28b4f Add release description
Former-commit-id: a520cce17c
2023-01-25 22:46:37 -07:00
dboreham ec54258285 Merge pull request #159 from cerc-io/dboreham/enhanced-publish-script
Better publish scripts

Former-commit-id: e1421045eb
2023-01-25 22:40:24 -07:00
dboreham 1f2ee33b42 Update version
Former-commit-id: 0b08d7ba65
2023-01-25 22:38:25 -07:00
dboreham a2b700727c Better publish scripts
Former-commit-id: 7fdf9bc4db
2023-01-25 22:37:43 -07:00
dboreham fa8ba7f9ef Merge pull request #158 from cerc-io/dboreham/publish-package
Basic GitHub release publishing script

Former-commit-id: a144dde4c1
2023-01-25 14:34:19 -07:00
dboreham dd0b8ae81f Basic GitHub release publishing script
Former-commit-id: 465d16e50f
2023-01-25 14:28:41 -07:00
telackey b5c7ad114c Integrate grafana/prometheus with fixturenet-eth. (#156)
* Integrate grafana/prometheus with fixturenet-eth.

* Integrate grafana/prometheus with fixturenet-eth.

* Revert port change

* EOL

* EOL

* Simplify ipld-eth-server config.

Former-commit-id: c279bd49a4
2023-01-25 11:50:08 -06:00
dboreham d0d29717e1 Update version
Former-commit-id: 080451f3df
2023-01-24 08:27:12 -07:00
dboreham 368091e125 Merge pull request #155 from cerc-io/dboreham/stack-test
Add stack tests

Former-commit-id: 8b19e0f194
2023-01-24 08:19:51 -07:00
dboreham 27195fc977 Add stack tests
Former-commit-id: c80ed2b245
2023-01-24 08:19:24 -07:00
Zach 91ad0f39e6 Merge pull request #144 from cerc-io/docs-updates
Docs updates

Former-commit-id: 3cef5eb262
2023-01-24 09:14:45 -05:00
dboreham b47b2200ce Merge pull request #154 from cerc-io/dboreham/port-command
Implement deploy-system port command

Former-commit-id: 208df97c96
2023-01-23 22:12:14 -07:00
David Boreham 2e291b3e4c Add trailing newline
Former-commit-id: 5f22afc78b
2023-01-23 22:11:24 -07:00
David Boreham 629e484c30 Implement deploy-system port command
Former-commit-id: ea6f932e00
2023-01-23 22:09:56 -07:00
dboreham 3d7d23b68b Merge pull request #151 from cerc-io/dboreham/build-foundry-local
Build foundry container locally

Former-commit-id: 9464c47163
2023-01-23 17:09:11 -07:00
dboreham c6c9e229d2 Revert debugging code
Former-commit-id: 14e57abfbf
2023-01-23 17:07:23 -07:00
telackey c77cc4e111 Update keycloak to include X-User-Id header. (#147)
Former-commit-id: 65cdba7705
2023-01-23 10:39:15 -06:00
dboreham 26c654f3ef Merge pull request #153 from cerc-io/dboreham/add-guile-to-gerbil-builder
Add guile to gertbil builder container

Former-commit-id: 5b9b259494
2023-01-23 08:00:46 -07:00
dboreham b6a84db6a2 Add guile to gertbil builder container
Former-commit-id: c7970d09b3
2023-01-23 08:00:24 -07:00
dboreham e7d31e78ad Merge pull request #150 from cerc-io/dboreham/gerbil-builder
Add gerbil builder container

Former-commit-id: f982a7632e
2023-01-23 07:24:55 -07:00
dboreham 86b7e6957c Enhance readme
Former-commit-id: 4ab84eb7ca
2023-01-23 07:24:27 -07:00
dboreham 7812490434 Merge pull request #152 from cerc-io/dboreham/fix-fixturenet-eth-stack
Fix stack file

Former-commit-id: fb8eabb28e
2023-01-23 06:52:27 -07:00
dboreham 161cd37b9c Fix stack file
Former-commit-id: a12e06dcbb
2023-01-23 06:51:51 -07:00
David Boreham e183e2a880 Build foundry container locally
Former-commit-id: f3f4033937
2023-01-22 22:19:23 -07:00
dboreham 7bd8045d6e Fix bugs
Former-commit-id: 46bcc2f882
2023-01-22 22:12:05 -07:00
dboreham b2268a6518 Add gerbil builder container
Former-commit-id: 8843b894e2
2023-01-22 21:50:50 -07:00
zramsay dfef77f35f update CONTRIBUTING
Former-commit-id: d3f63b8975
2023-01-20 11:35:57 -05:00
zramsay 78cd4e2e3e fixup spec
Former-commit-id: 00c1515807
2023-01-20 11:21:14 -05:00
zramsay dca9a36633 stack diagram: fix diagram & compress img
Former-commit-id: 4c84896090
2023-01-20 11:04:24 -05:00
Zach e799c9eaef Merge pull request #138 from cerc-io/fix-pods
Fix pods (db -> ipld-eth-db)

Former-commit-id: 59a9714d19
2023-01-20 09:38:54 -05:00
zramsay 42dac0e712 db -> ipld-eth-db
Former-commit-id: e9c24a0b82
2023-01-20 08:03:54 -05:00
dboreham a44c063e5a Update version
Former-commit-id: c949fe091f
2023-01-19 14:21:33 -07:00
dboreham 6ad2684de3 Update version
Former-commit-id: 1cdf0f3015
2023-01-19 14:21:13 -07:00
dboreham 5e7b51ee6a Update version
Former-commit-id: 6ae86dbcec
2023-01-19 14:19:39 -07:00
dboreham 50103fcc9c Merge pull request #137 from cerc-io/dboreham/missing-stack-error
Error check stack config

Former-commit-id: edbf674df7
2023-01-19 14:14:34 -07:00
dboreham edb7346f31 Error check stack config
Former-commit-id: d454a4ffc1
2023-01-19 14:13:57 -07:00
dboreham 377d18d540 Merge pull request #136 from cerc-io/dboreham/small-fixes
Some small fixes

Former-commit-id: cefe10d124
2023-01-19 13:39:06 -07:00
dboreham 6ed90536cf Implement continue on error for npm builds
Former-commit-id: 34aa613d04
2023-01-19 13:38:04 -07:00
dboreham 7d00228ca2 Remove result code check
Former-commit-id: 6faa933d42
2023-01-19 13:30:01 -07:00
dboreham 8f9f23b1c4 Implement stop on error building containers
Former-commit-id: bbbb57ec06
2023-01-19 13:20:53 -07:00
dboreham 429e04f81d Catch docker run exceptions
Former-commit-id: 68c7f91052
2023-01-19 13:00:35 -07:00
dboreham 7a9926b695 Remove extraneous stderr output
Former-commit-id: 3b5efc8f0f
2023-01-19 13:00:06 -07:00
dboreham 0372504f44 Merge pull request #135 from cerc-io/dboreham/fix-npm-builds
Fix various npm build issues

Former-commit-id: d94ed55642
2023-01-19 11:34:19 -07:00
dboreham b29537ad7c Fix various npm build issues
Former-commit-id: 9fb96d8458
2023-01-19 11:33:34 -07:00
dboreham 1cf58c900e Update version
Former-commit-id: d05a47946a
2023-01-18 22:07:04 -07:00
dboreham c6df9ae0c1 Merge pull request #131 from cerc-io/dboreham/stack-for-npm-build
Stack for build-npms

Former-commit-id: 683341a66f
2023-01-18 22:02:49 -07:00
dboreham f1cd13d988 Stack for build-npms
Former-commit-id: 0b8b3123fe
2023-01-18 22:01:55 -07:00
dboreham edc24e4fc8 Merge pull request #130 from cerc-io/dboreham/stack-for-deploy-system
Implement stack for deploy-system

Former-commit-id: 7740dccf4c
2023-01-18 15:37:41 -07:00
dboreham 533ed4ee9b Implement stack for deploy-system
Former-commit-id: 6bf413e002
2023-01-18 15:37:12 -07:00
dboreham ba5eecaada Merge pull request #129 from cerc-io/dboreham/stack-for-build-containers
Implement stack for container build

Former-commit-id: d1f9c3d152
2023-01-18 15:28:53 -07:00
dboreham 5f73a93f5f Implement stack for container build
Former-commit-id: d5875954b8
2023-01-18 15:27:52 -07:00
dboreham 135295f0f9 Update version
Former-commit-id: 5e2df891cf
2023-01-17 22:43:07 -07:00
dboreham 5b4f935afd Merge pull request #128 from cerc-io/dboreham/stack-for-setup-repositories
Implement stack config file for setup-repositories

Former-commit-id: 4e1366df60
2023-01-17 22:40:12 -07:00
dboreham 5a4220ff41 Update version info
Former-commit-id: b0947081de
2023-01-17 22:38:30 -07:00
dboreham a60fb08c8a Make code compatible with Pyton 3.8
Former-commit-id: 04a3049162
2023-01-17 22:25:04 -07:00
dboreham 2b15eff104 Initial implementation of stack
Former-commit-id: 1d7128c6e1
2023-01-17 16:05:50 -07:00
dboreham fc3bcdef74 Merge pull request #127 from cerc-io/dboreham/update-version
Update version

Former-commit-id: 65f5382bfe
2023-01-17 13:52:33 -07:00
dboreham 500c481d6b Update version
Former-commit-id: cf3120d6c2
2023-01-17 13:52:00 -07:00
telackey 08d5c22f32 Enable metrics endpoint in fixturenet.
Former-commit-id: 0ea29bc480
2023-01-17 12:04:28 -06:00
Zach 8fb71711bc Merge pull request #122 from cerc-io/update-readme-67
Update readme

Former-commit-id: 5e7db36c75
2023-01-17 09:27:42 -05:00
dboreham 32b4c00261 Merge pull request #124 from cerc-io/dboreham/fix-fixturenet-geth-build
Fix fixturenet container builds in shiv mode
2023-01-16 21:58:03 -07:00
dboreham 71425b93f6 Package deep enough into the data tree to get all the files that are there 2023-01-16 21:56:07 -07:00
zramsay b90e4ad6cd update readme
Former-commit-id: 70723dd6d4
2023-01-16 07:27:52 -05:00
telackey b13300ca81 Add CERC_STATEDIFF_DB_LOG_STATEMENTS=true|false option. (#120) 2023-01-13 16:33:59 -06:00
telackey 6396de1ecf Improvements for building/deploying geth. (#119)
* Improvements for building/deploying geth.

* Improvements for building/deploying geth.
2023-01-12 11:37:23 -06:00
dboreham 18a7e59a8a Merge pull request #116 from cerc-io/dboreham/fix-imports
Fix imports
2023-01-11 21:57:26 -07:00
David Boreham 0a66b7e9d2 Fix odd import problem 2023-01-11 21:56:05 -07:00
David Boreham 7edfa1bb29 Add import-resources dependency 2023-01-11 21:01:48 -07:00
telackey 8e184f509d Add remote debugging support to fixturenet-geth. (#113)
* Add remote debugging support to fixturenet-geth.
2023-01-11 12:54:22 -06:00
dboreham 5697a39640 Merge pull request #112 from cerc-io/dboreham/version-command
Version command
2023-01-10 14:32:56 -07:00
dboreham df469786ca Add version to smoke test 2023-01-10 14:32:12 -07:00
dboreham d315941f21 Version command implemented 2023-01-10 14:23:59 -07:00
dboreham ae7a17cecd Make script file names consistent 2023-01-10 14:10:22 -07:00
dboreham 261b513d68 Initial implementation 2023-01-10 14:09:38 -07:00
dboreham 9278d09096 Merge pull request #111 from cerc-io/dboreham/simple-test
A simple test
2023-01-10 10:25:14 -07:00
dboreham b8b83768d8 Add trailing newline 2023-01-10 10:24:48 -07:00
dboreham ddd2ea2724 Add a simple smoke test and shiv build script 2023-01-10 10:24:04 -07:00
Zach 787a5228ea Merge pull request #107 from cerc-io/zramsay-patch-1
Update repository-list.txt (rebrand)
2023-01-10 10:18:31 -05:00
dboreham 2ea87a3a80 Merge pull request #108 from cerc-io/telackey/path
fix: import Path
2023-01-10 08:09:24 -07:00
telackey 8669a822df fix: import Path 2023-01-09 21:43:04 -06:00
Zach 738aa1907b Update repository-list.txt 2023-01-09 20:03:09 -05:00
Zach 4b1ca04620 Merge pull request #104 from cerc-io/zramsay-patch-2
Fix build; laconic-cns-cli -> laconic-registry-cli
2023-01-09 17:21:36 -05:00
zramsay 48dc431704 fix laconicd stack README 2023-01-09 15:39:23 -05:00
dboreham 2eee4d1fb2 Merge pull request #105 from cerc-io/dboreham/fix-env-var-error
Default the npm token env var
2023-01-09 13:37:48 -07:00
Zach 8e5d0d6c58 Update stack.yml 2023-01-09 15:35:03 -05:00
dboreham 9d9eb791d1 Default the npm token env var 2023-01-09 13:34:02 -07:00
dboreham 4494f2ca62 Merge pull request #99 from cerc-io/dboreham/fix-shiv
Refactor for shiv package
2023-01-08 20:12:33 -07:00
dboreham f04726f08d Fix remaining commands 2023-01-08 20:11:30 -07:00
dboreham b4b1ec3df8 Try another way to access packaged files 2023-01-08 20:08:35 -07:00
dboreham 0435a71b5e Refactor for shiv package 2023-01-07 21:02:14 -07:00
dboreham c99687cc80 Switch to Python3 importlib 2023-01-07 20:44:08 -07:00
dboreham cd2735fa24 Merge pull request #97 from cerc-io/dboreham/fix-db-pod-name
Rename compose file
2023-01-06 16:12:31 -07:00
dboreham 9b2a58e3bd Rename compose file 2023-01-06 16:11:20 -07:00
dboreham dcefebc721 Merge pull request #94 from cerc-io/dboreham/registry-cli-container
Build registry cli container
2023-01-06 15:59:02 -07:00
dboreham 82755a27f2 Build a CLI container 2023-01-06 15:57:14 -07:00
dboreham 318d70020e Add build environment 2023-01-06 13:54:03 -07:00
dboreham 6e67a59251 Initial implementation 2023-01-06 13:44:52 -07:00
dboreham 92743d7390 Rename directory 2023-01-06 13:13:56 -07:00
dboreham 731a9f2072 Merge pull request #92 from cerc-io/dboreham/check-npm-version-exists
Add test for package version already exists
2023-01-06 10:21:59 -07:00
dboreham d77a42b36f Add test for package version already exists 2023-01-06 10:20:18 -07:00
dboreham af1aee09ff Merge pull request #89 from cerc-io/dboreham/npm-build-command
npm build command
2023-01-06 09:33:51 -07:00
dboreham ff76cdad61 Back out debug code 2023-01-05 07:40:05 -07:00
dboreham 765db5937d Default to from-repo package version 2023-01-04 21:23:17 -07:00
dboreham 68c6eaf0b4 Use the right script 2023-01-04 20:50:23 -07:00
dboreham 073d94e288 Brand token env var 2023-01-04 20:43:13 -07:00
dboreham ee1ecbd217 Initial implementation of npm-build 2023-01-04 16:16:40 -07:00
dboreham 36f7d4ca26 Merge branch 'main' into dboreham/npm-build-command 2023-01-04 15:23:05 -07:00
dboreham fdb04d46b4 Merge pull request #88 from cerc-io/dboreham/fix-ps-command
Fix ps display for containers with no mapped ports
2023-01-04 10:39:49 -07:00
dboreham 778550754d Fix ps display for containers with no mapped ports 2023-01-04 10:39:16 -07:00
dboreham 2ba3ffac84 Add lirewine scope 2023-01-04 07:39:01 -07:00
dboreham db4899229d Merge pull request #86 from cerc-io/dboreham/build-laconic-cli
Allow building of npm packages using locally published dependencies
2023-01-03 22:40:26 -07:00
dboreham a5b1f6e107 Update readme 2023-01-03 22:38:51 -07:00
dboreham c059745af9 Working builds 2023-01-03 22:37:44 -07:00
dboreham 1b0407ae3c Add scripts to image 2023-01-03 21:39:06 -07:00
dboreham 47b7a47160 Add comments 2023-01-03 21:17:30 -07:00
dboreham 1b4b47e9a4 Add more output 2023-01-03 21:16:20 -07:00
dboreham b10b6c19f9 Use variable for local package scope 2023-01-03 21:14:35 -07:00
dboreham b6f1fd029d Add npm package build with local dependencies script 2023-01-03 21:10:53 -07:00
dboreham be889d893a Merge branch 'main' into dboreham/build-laconic-cli 2023-01-03 13:11:08 -07:00
dboreham 63378a5c7e Add redirect follow to curl command for github 2022-12-22 12:52:23 -07:00
prathamesh0 3b031329b4 Upgrade watcher-ts version in the mobymask stack (#83)
* Upgrade watcher-ts version in mobymask setup

* Change watcher db service name

* Add a clean-up step
2022-12-22 19:43:13 +05:30
prathamesh0 d51508b01d [WIP] Add a Uniswap v3 watcher-only stack (#82)
* Add a stack for uniswap watcher with info app

* Add deployment instructions

* Use docker interactive option while loading the db dumps
2022-12-22 19:30:56 +05:30
prathamesh0 27c3efabe2 Add a local stack for ERC721 watcher (#81)
* Add a stack for erc721 watcher

* Add a demo

* Avoid watcher db service and volume name conflicts across watchers

* Avoid host port conflicts across watchers

* Avoid watcher-db port conflicts
2022-12-22 13:13:59 +05:30
prathamesh0 a7221ddc24 Add a local stack for ERC20 watcher (#80)
* Add a healthcheck for ipld-eth-server

* Update ipld-eth-server ports in mobymask watcher config

* Update clique period to 5s in geth-foundry config

* Add a stack for erc20 watcher

* Add a demo for erc20 watcher

* Upgrade watcher-ts version

* Update instructions

* Pass option to pull while setting up repos
2022-12-22 11:33:39 +05:30
telackey e7296c2ce3 Add tx-spammer (#74)
* Add tx-spammer

* Update README
2022-12-21 09:59:40 -06:00
dboreham 2c2df6ebbd Remove extraneous repo
This repo was included erroneously in the original move from old-stack-orchestrator.
2022-12-20 20:37:33 -07:00
dboreham d138bb1a72 Add warning on user mode install 2022-12-20 19:15:36 -07:00
dboreham 543afe1808 Fix typo 2022-12-20 19:10:23 -07:00
telackey 8f63328d60 fixturenet-eth README (#73)
* fixturenet-eth README

* Fix bullets

* Minor edit

* Update README.md
2022-12-20 14:08:10 -06:00
telackey efbc86bdea Moved repos. (#72) 2022-12-20 14:06:48 -06:00
dboreham 23b12cc8f1 Fix typo 2022-12-19 09:44:51 -07:00
dboreham 717391d835 Add comments 2022-12-19 09:37:24 -07:00
dboreham b8c244bbdc Merge branch 'main' into dboreham/build-laconic-cli 2022-12-19 09:31:02 -07:00
telackey 8a9c1fb781 Use new repo (#68) 2022-12-16 15:57:26 -06:00
telackey 5d482658a7 Download pre-built keycloak api-key-module-0.1.jar rather than building it. (#66) 2022-12-16 14:15:56 -06:00
telackey df0bf549a2 Keycloak + nginx reverse proxy (#63)
* Example Keycloak config.

* Proxy for geth, ipld-eth-server, and lighthouse.

* Add metrics.
2022-12-14 12:59:40 -06:00
dboreham d96546a3c5 Put script into the container 2022-12-14 09:26:18 -07:00
dboreham 680f227967 Add yarn fixup script for local registry 2022-12-14 09:23:12 -07:00
dboreham c85b29c237 Update README.md 2022-12-12 14:44:43 -07:00
dboreham 8d2788d1c1 Merge pull request #62 from cerc-io/dboreham/build-ts-repos
Build js/ts projects
2022-12-12 14:42:14 -07:00
dboreham 46375082d6 Support building an npm package to gitea 2022-12-12 14:40:11 -07:00
dboreham faa6027772 Fix entrypoint 2022-12-12 12:42:07 -07:00
dboreham d6e90c2dbd Add generic entrypoint 2022-12-12 12:38:12 -07:00
dboreham c2f6544f51 Merge pull request #60 from cerc-io/dboreham/node-builder
Add js builder container
2022-12-07 11:59:47 -07:00
dboreham d0903a2780 Build js builder container 2022-12-07 11:38:32 -07:00
telackey 32edd7aea7 46: Make it possible to launch fixturenet with or without the statediff DB. (#59)
* 46: Make it possible to launch fixturenet with or without the statediff DB.

* Require the hostname as well.
2022-12-06 17:17:24 -06:00
telackey bd9aaebe3d eth-probe with fixturenet (#57)
* eth-probe with fixturenet

* Add ability to wait on geth to be up and minting blocks before launching the probe.
2022-12-06 11:10:38 -06:00
dboreham b538011a7b Merge pull request #55 from cerc-io/dboreham/display-mapped-ports
Display mapped ports, revert to ps command name
2022-11-29 21:15:10 -07:00
dboreham d87a2387e5 Display mapped ports, revert to ps command name 2022-11-29 21:14:40 -07:00
dboreham 3308328524 Fix copy/paste 2022-11-29 19:58:18 -07:00
dboreham c502aae162 Merge pull request #54 from cerc-io/dboreham/fix-verbose-output
Quiet verbose output
2022-11-29 19:56:26 -07:00
dboreham 43d59a9e28 Quiet verbose output 2022-11-29 19:54:08 -07:00
dboreham 28a3880fcf Add deploy command 2022-11-29 06:33:46 -07:00
dboreham acb06feac4 Fix typo 2022-11-29 06:29:18 -07:00
dboreham f7e9cf4ba4 Update README.md 2022-11-15 22:24:11 -07:00
174 changed files with 6774 additions and 469 deletions
+73 -182
View File
@@ -1,214 +1,105 @@
# Stack Orchestrator
Stack Orchestrator allows building and deployment of a Laconic stack on a single machine with minimial prerequisites.
Stack Orchestrator allows building and deployment of a Laconic Stack on a single machine with minimial prerequisites. It is a Python3 CLI tool that runs on any OS with Python3 and Docker. The following diagram summarizes the relevant repositories in the Laconic Stack - and the relationship to Stack Orchestrator.
## Setup
### User Mode
User mode runs the orchestrator from a "binary" single-file release and does not require special Python environment setup. Use this mode unless you plan to make changes to the orchestrator source code.
#### Prerequisites
Stack Orchestrator is a Python3 CLI tool that runs on any OS with Python3 and Docker. Tested on: Ubuntu 20/22.
![The Stack](/docs/images/laconic-stack.png)
## Install
Ensure that the following are already installed:
1. Python3 (the stock Python3 version available in Ubuntu 20 and 22 is suitable)
```
$ python3 --version
Python 3.8.10
```
2. Docker (Install a current version from dockerco, don't use the version from any Linux distro)
```
$ docker --version
Docker version 20.10.17, build 100c701
```
3. If installed from regular package repository (not Docker Desktop), BE AWARE that the compose plugin may need to be installed, as well.
```
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.11.2/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
# see https://docs.docker.com/compose/install/linux/#install-the-plugin-manually for further details
# or to install for all users.
```
#### Install
1. Download the latest release from [this page](https://github.com/cerc-io/stack-orchestrator/tags), into a suitable directory (e.g. `~/bin`):
```
$ cd ~/bin
$ curl https://github.com/cerc-io/stack-orchestrator/releases/download/v1.0.2-alpha/laconic-so
```
1. Ensure `laconic-so` is on the `PATH`
1. Verify operation:
```
$ ~/bin/laconic-so --help
Usage: python -m laconic-so [OPTIONS] COMMAND [ARGS]...
- [Python3](https://wiki.python.org/moin/BeginnersGuide/Download): `python3 --version` >= `3.10.8`
- [Docker](https://docs.docker.com/get-docker/): `docker --version` >= `20.10.21`
- [Docker Compose](https://docs.docker.com/compose/install/): `docker-compose --version` >= `2.13.0`
Laconic Stack Orchestrator
Note: if installing docker-compose via package manager (as opposed to Docker Desktop), you must [install the plugin](https://docs.docker.com/compose/install/linux/#install-the-plugin-manually), e.g., on Linux:
Options:
--quiet
--verbose
--dry-run
--local-stack
-h, --help Show this message and exit.
```bash
mkdir -p ~/.docker/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.11.2/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
```
Commands:
build-containers build the set of containers required for a complete...
deploy-system deploy a stack
setup-repositories git clone the set of repositories required to build...
```
### Developer mode
Suitable for developers either modifying or debugging the orchestrator Python code:
#### Prerequisites
In addition to the binary install prerequisites listed above, the following are required:
1. Python venv package
This may or may not be already installed depending on the host OS and version. Check by running:
```
$ python3 -m venv
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade] [--without-pip] [--prompt PROMPT] ENV_DIR [ENV_DIR ...]
venv: error: the following arguments are required: ENV_DIR
```
If the venv package is missing you should see a message indicating how to install it, for example with:
```
$ apt install python3.8-venv
```
#### Install
1. Clone this repository:
```
$ git clone (https://github.com/cerc-io/stack-orchestrator.git
```
4. Enter the project directory:
```
$ cd stack-orchestrator
```
5. Create and activate a venv:
```
$ python3 -m venv venv
$ source ./venv/bin/activate
(venv) $
```
6. Install the cli in edit mode:
```
$ pip install --editable .
```
7. Verify installation:
```
(venv) $ laconic-so
Usage: laconic-so [OPTIONS] COMMAND [ARGS]...
Next, download the latest release from [this page](https://github.com/cerc-io/stack-orchestrator/tags), into a suitable directory (e.g. `~/bin`):
Laconic Stack Orchestrator
```bash
curl -L -o ~/bin/laconic-so https://github.com/cerc-io/stack-orchestrator/releases/latest/download/laconic-so
```
Options:
--quiet
--verbose
--dry-run
-h, --help Show this message and exit.
Give it permissions:
```bash
chmod +x ~/bin/laconic-so
```
Commands:
build-containers build the set of containers required for a complete...
deploy-system deploy a stack
setup-repositories git clone the set of repositories required to build...
```
Ensure `laconic-so` is on the [`PATH`](https://unix.stackexchange.com/a/26059)
#### Build a zipapp (single file distributable script)
Use shiv to build a single file Python executable zip archive of laconic-so:
1. Install [shiv](https://github.com/linkedin/shiv):
```
$ (venv) pip install shiv
$ (venv) pip install wheel
```
1. Run shiv to create a zipapp file:
```
$ (venv) shiv -c laconic-so -o laconic-so .
```
This creates a file `./laconic-so` that is executable outside of any venv, and on other machines and OSes and architectures, and requiring only the system Python3:
1. Verify it works:
```
$ cp stack-orchetrator/laconic-so ~/bin
$ laconic-so
Usage: python -m laconic-so [OPTIONS] COMMAND [ARGS]...
Verify operation:
Laconic Stack Orchestrator
```
laconic-so --help
Usage: python -m laconic-so [OPTIONS] COMMAND [ARGS]...
Options:
--quiet
--verbose
--dry-run
-h, --help Show this message and exit.
Laconic Stack Orchestrator
Commands:
build-containers build the set of containers required for a complete...
deploy-system deploy a stack
setup-repositories git clone the set of repositories required to build...
```
### CI Mode
_write-me_
Options:
--quiet
--verbose
--dry-run
--local-stack
-h, --help Show this message and exit.
Commands:
build-containers build the set of containers required for a complete...
build-npms build the set of npm packages required for a...
deploy-system deploy a stack
setup-repositories git clone the set of repositories required to build...
```
## Usage
There are three sub-commands: `setup-repositories`, `build-containers` and `deploy-system` that are generally run in order:
Note: $ laconic-so will run the version installed to ~/bin, while ./laconic-so can be invoked to run locally built
version in a checkout
Three sub-commands: `setup-repositories`, `build-containers` and `deploy-system` are generally run in order. The following is a slim example for standing up the `erc20-watcher`. Go further with the [erc20 watcher demo](/app/data/stacks/erc20) and other pieces of the stack, within the [`stacks` directory](/app/data/stacks).
### Setup Repositories
Clones the set of git repositories necessary to build a system.
Note: the use of `ssh-agent` is recommended in order to avoid entering your ssh key passphrase for each repository.
```
$ laconic-so --verbose setup-repositories #this will default to ~/cerc or CERC_REPO_BASE_DIR from an env file
#$ ./laconic-so --verbose --local-stack setup-repositories #this will use cwd ../ as dev_root_path
Clone the set of git repositories necessary to build a system:
```bash
laconic-so --verbose setup-repositories --include cerc-io/go-ethereum,cerc-io/ipld-eth-db,cerc-io/ipld-eth-server,cerc-io/watcher-ts
```
This will default to `~/cerc` or - if set - the environment variable `CERC_REPO_BASE_DIR`
### Build Containers
Builds the set of docker container images required to run a system. It takes around 10 minutes to build all the containers from cold.
```
$ laconic-so --verbose build-containers #this will default to ~/cerc or CERC_REPO_BASE_DIR from an env file
#$ ./laconic-so --verbose --local-stack build-containers #this will use cwd ../ as dev_root_path
Build the set of docker container images required to run a system. It takes around 10 minutes to build all the containers from scratch.
```bash
laconic-so --verbose build-containers --include cerc/go-ethereum,cerc/go-ethereum-foundry,cerc/ipld-eth-db,cerc/ipld-eth-server,cerc/watcher-erc20
```
### Deploy System
Uses `docker compose` to deploy a system.
Use `---include <list of components>` to deploy a subset of all containers:
Uses `docker-compose` to deploy a system (with most recently built container images).
```bash
laconic-so --verbose deploy-system --include ipld-eth-db,go-ethereum-foundry,ipld-eth-server,watcher-erc20 up
```
$ laconic-so --verbose deploy-system --include db-sharding,contract,ipld-eth-server,go-ethereum-foundry up
Check out he GraphQL playground here: [http://localhost:3002/graphql](http://localhost:3002/graphql)
See the [erc20 watcher demo](/app/data/stacks/erc20) to continue further.
### Cleanup
```bash
laconic-so --verbose deploy-system --include ipld-eth-db,go-ethereum-foundry,ipld-eth-server,watcher-erc20 down
```
```
$ laconic-so --verbose deploy-system --include db-sharding,contract,ipld-eth-server,go-ethereum-foundry down
```
Note: deploy-system command interacts with most recently built container images.
## Contributing
See the [CONTRIBUTING.md](/docs/CONTRIBUTING.md) for developer mode install.
## Platform Support
Native aarm64 is _not_ currently supported. x64 emulation on ARM64 macos should work (not yet tested).
## Implementation
The orchestrator's operation is driven by files shown below. `repository-list.txt` container the list of git repositories; `container-image-list.txt` contains
the list of container image names, while `clister-list.txt` specifies the set of compose components (corresponding to individual docker-compose-xxx.yml files which may in turn specify more than one container).
Files required to build each container image are stored under `./container-build/<container-name>`
Files required at deploy-time are stored under `./config/<component-name>`
```
├── pod-list.txt
├── compose
│   ├── docker-compose-contract.yml
│   ├── docker-compose-db-sharding.yml
│   ├── docker-compose-db.yml
│   ├── docker-compose-eth-statediff-fill-service.yml
│   ├── docker-compose-go-ethereum-foundry.yml
│   ├── docker-compose-ipld-eth-beacon-db.yml
│   ├── docker-compose-ipld-eth-beacon-indexer.yml
│   ├── docker-compose-ipld-eth-server.yml
│   ├── docker-compose-lighthouse.yml
│   └── docker-compose-prometheus-grafana.yml
├── config
│   └── ipld-eth-server
├── container-build
│   ├── cerc-eth-statediff-fill-service
│   ├── cerc-go-ethereum
│   ├── cerc-go-ethereum-foundry
│   ├── cerc-ipld-eth-beacon-db
│   ├── cerc-ipld-eth-beacon-indexer
│   ├── cerc-ipld-eth-db
│   ├── cerc-ipld-eth-server
│   ├── cerc-lighthouse
│   └── cerc-test-contract
├── container-image-list.txt
├── repository-list.txt
```
_write-more-of-me_
Native aarm64 is _not_ currently supported. x64 emulation on ARM64 macos should work (not yet tested).
+77
View File
@@ -0,0 +1,77 @@
# Copyright © 2022, 2023 Cerc
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
import os
from abc import ABC, abstractmethod
from .deploy_system import get_stack_status
def get_stack(config, stack):
if stack == "package-registry":
return package_registry_stack(config, stack)
else:
return base_stack(config, stack)
class base_stack(ABC):
def __init__(self, config, stack):
self.config = config
self.stack = stack
@abstractmethod
def ensure_available(self):
pass
@abstractmethod
def get_url(self):
pass
class package_registry_stack(base_stack):
def ensure_available(self):
self.url = "<no registry url set>"
# Check if we were given an external registry URL
url_from_environment = os.environ.get("CERC_NPM_REGISTRY_URL")
if url_from_environment:
if self.config.verbose:
print(f"Using package registry url from CERC_NPM_REGISTRY_URL: {url_from_environment}")
self.url = url_from_environment
else:
# Otherwise we expect to use the local package-registry stack
# First check if the stack is up
registry_running = get_stack_status(self.config, "package-registry")
if registry_running:
# If it is available, get its mapped port and construct its URL
if self.config.debug:
print("Found local package registry stack is up")
# TODO: get url from deploy-stack
self.url = "http://gitea.local:3000/api/packages/cerc-io/npm/"
else:
# If not, print a message about how to start it and return fail to the caller
print("ERROR: The package-registry stack is not running, and no external registry specified with CERC_NPM_REGISTRY_URL")
print("ERROR: Start the local package registry with: laconic-so --stack package-registry deploy-system up")
return False
return True
def get_url(self):
return self.url
# Temporary helper functions while we figure out a good interface to the stack deploy code
def _get_stack_mapped_port(stack, service, exposed_port):
return 3000
+57 -16
View File
@@ -1,4 +1,4 @@
# Copyright © 2022 Cerc
# Copyright © 2022, 2023 Cerc
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -25,8 +25,9 @@ import sys
from decouple import config
import subprocess
import click
import pkg_resources
from .util import include_exclude_check
import importlib.resources
from pathlib import Path
from .util import include_exclude_check, get_parsed_stack_config
# TODO: find a place for this
# epilog="Config provided either in .env or settings.ini or env vars: CERC_REPO_BASE_DIR (defaults to ~/cerc)"
@@ -43,6 +44,11 @@ def command(ctx, include, exclude):
verbose = ctx.obj.verbose
dry_run = ctx.obj.dry_run
local_stack = ctx.obj.local_stack
stack = ctx.obj.stack
continue_on_error = ctx.obj.continue_on_error
# See: https://stackoverflow.com/questions/25389095/python-get-path-of-root-project-structure
container_build_dir = Path(__file__).absolute().parent.joinpath("data", "container-build")
if local_stack:
dev_root_path = os.getcwd()[0:os.getcwd().rindex("stack-orchestrator")]
@@ -56,30 +62,65 @@ def command(ctx, include, exclude):
if not os.path.isdir(dev_root_path):
print('Dev root directory doesn\'t exist, creating')
with pkg_resources.resource_stream(__name__, "data/container-image-list.txt") as container_list_file:
containers = container_list_file.read().decode().splitlines()
# See: https://stackoverflow.com/a/20885799/1701505
from . import data
with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file:
all_containers = container_list_file.read().splitlines()
containers_in_scope = []
if stack:
stack_config = get_parsed_stack_config(stack)
containers_in_scope = stack_config['containers']
else:
containers_in_scope = all_containers
if verbose:
print(f'Containers: {containers}')
print(f'Containers: {containers_in_scope}')
if stack:
print(f"Stack: {stack}")
# TODO: make this configurable
container_build_env = {
"CERC_NPM_URL": "http://gitea.local:3000/api/packages/cerc-io/npm/",
"CERC_NPM_AUTH_TOKEN": config("CERC_NPM_AUTH_TOKEN", default="<token-not-supplied>"),
"CERC_REPO_BASE_DIR": dev_root_path
}
def process_container(container):
if not quiet:
print(f"Building: {container}")
build_script_filename = os.path.join("container-build", container.replace("/", "-"), "build.sh")
build_dir = os.path.join(container_build_dir, container.replace("/", "-"))
build_script_filename = os.path.join(build_dir, "build.sh")
if verbose:
print(f"Script: {build_script_filename}")
if not os.path.exists(build_script_filename):
print(f"Error, script: {build_script_filename} doesn't exist")
sys.exit(1)
print(f"Build script filename: {build_script_filename}")
if os.path.exists(build_script_filename):
build_command = build_script_filename
else:
if verbose:
print(f"No script file found: {build_script_filename}, using default build script")
repo_dir = container.split('/')[1]
# TODO: make this less of a hack -- should be specified in some metadata somewhere
# Check if we have a repo for this container. If not, set the context dir to the container-build subdir
repo_full_path = os.path.join(dev_root_path, repo_dir)
repo_dir_or_build_dir = repo_dir if os.path.exists(repo_full_path) else build_dir
build_command = os.path.join(container_build_dir, "default-build.sh") + f" {container}:local {repo_dir_or_build_dir}"
if not dry_run:
# We need to export CERC_REPO_BASE_DIR
build_result = subprocess.run(build_script_filename, shell=True, env={'CERC_REPO_BASE_DIR': dev_root_path})
# TODO: check result in build_result.returncode
print(f"Result is: {build_result}")
if verbose:
print(f"Executing: {build_command}")
build_result = subprocess.run(build_command, shell=True, env=container_build_env)
if verbose:
print(f"Return code is: {build_result.returncode}")
if build_result.returncode != 0:
print(f"Error running build for {container}")
if not continue_on_error:
print("FATAL Error: container build failed and --continue-on-error not set, exiting")
sys.exit(1)
else:
print("****** Container Build Error, continuing because --continue-on-error is set")
else:
print("Skipped")
for container in containers:
for container in containers_in_scope:
if include_exclude_check(container, include, exclude):
process_container(container)
else:
+142
View File
@@ -0,0 +1,142 @@
# Copyright © 2022, 2023 Cerc
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
# Builds or pulls containers for the system components
# env vars:
# CERC_REPO_BASE_DIR defaults to ~/cerc
import os
import sys
from decouple import config
import click
import importlib.resources
from python_on_whales import docker, DockerException
from .base import get_stack
from .util import include_exclude_check, get_parsed_stack_config
builder_js_image_name = "cerc/builder-js:local"
@click.command()
@click.option('--include', help="only build these packages")
@click.option('--exclude', help="don\'t build these packages")
@click.pass_context
def command(ctx, include, exclude):
'''build the set of npm packages required for a complete stack'''
quiet = ctx.obj.quiet
verbose = ctx.obj.verbose
dry_run = ctx.obj.dry_run
local_stack = ctx.obj.local_stack
debug = ctx.obj.debug
stack = ctx.obj.stack
continue_on_error = ctx.obj.continue_on_error
_ensure_prerequisites()
# build-npms depends on having access to a writable package registry
# so we check here that it is available
package_registry_stack = get_stack(ctx.obj, "package-registry")
registry_available = package_registry_stack.ensure_available()
if not registry_available:
print("FATAL: no npm registry available for build-npms command")
sys.exit(1)
npm_registry_url = package_registry_stack.get_url()
npm_registry_url_token = config("CERC_NPM_AUTH_TOKEN", default=None)
if not npm_registry_url_token:
print("FATAL: CERC_NPM_AUTH_TOKEN is not defined")
sys.exit(1)
if local_stack:
dev_root_path = os.getcwd()[0:os.getcwd().rindex("stack-orchestrator")]
print(f'Local stack dev_root_path (CERC_REPO_BASE_DIR) overridden to: {dev_root_path}')
else:
dev_root_path = os.path.expanduser(config("CERC_REPO_BASE_DIR", default="~/cerc"))
if not quiet:
print(f'Dev Root is: {dev_root_path}')
if not os.path.isdir(dev_root_path):
print('Dev root directory doesn\'t exist, creating')
# See: https://stackoverflow.com/a/20885799/1701505
from . import data
with importlib.resources.open_text(data, "npm-package-list.txt") as package_list_file:
all_packages = package_list_file.read().splitlines()
packages_in_scope = []
if stack:
stack_config = get_parsed_stack_config(stack)
# TODO: syntax check the input here
packages_in_scope = stack_config['npms']
else:
packages_in_scope = all_packages
if verbose:
print(f'Packages: {packages_in_scope}')
def build_package(package):
if not quiet:
print(f"Building npm package: {package}")
repo_dir = package
repo_full_path = os.path.join(dev_root_path, repo_dir)
# TODO: make the npm registry url configurable.
build_command = ["sh", "-c", f"cd /workspace && build-npm-package-local-dependencies.sh {npm_registry_url}"]
if not dry_run:
if verbose:
print(f"Executing: {build_command}")
envs = {"CERC_NPM_AUTH_TOKEN": npm_registry_url_token} | ({"CERC_SCRIPT_DEBUG": "true"} if debug else {})
try:
docker.run(builder_js_image_name,
remove=True,
interactive=True,
tty=True,
user=f"{os.getuid()}:{os.getgid()}",
envs=envs,
# TODO: detect this host name in npm_registry_url rather than hard-wiring it
add_hosts=[("gitea.local", "host-gateway")],
volumes=[(repo_full_path, "/workspace")],
command=build_command
)
# Note that although the docs say that build_result should contain
# the command output as a string, in reality it is always the empty string.
# Since we detect errors via catching exceptions below, we can safely ignore it here.
except DockerException as e:
print(f"Error executing build for {package} in container:\n {e}")
if not continue_on_error:
print("FATAL Error: build failed and --continue-on-error not set, exiting")
sys.exit(1)
else:
print("****** Build Error, continuing because --continue-on-error is set")
else:
print("Skipped")
for package in packages_in_scope:
if include_exclude_check(package, include, exclude):
build_package(package)
else:
if verbose:
print(f"Excluding: {package}")
def _ensure_prerequisites():
# Check that the builder-js container is available and
# Tell the user how to build it if not
images = docker.image.list(builder_js_image_name)
if len(images) == 0:
print(f"FATAL: builder image: {builder_js_image_name} is required but was not found")
print("Please run this command to create it: laconic-so --stack build-support build-containers")
sys.exit(1)
View File
@@ -0,0 +1,59 @@
version: '3.2'
services:
eth-probe-db:
restart: always
image: timescale/timescaledb:latest-pg14
environment:
POSTGRES_USER: "probe"
POSTGRES_DB: "probe"
POSTGRES_PASSWORD: "probe"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 20s
timeout: 5s
retries: 15
start_period: 10s
volumes:
- ../../eth-probe/db/schema.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- 5432
eth-probe-mq:
restart: always
image: cerc/eth-probe:local
environment:
MODE: "mq"
PROBE_DEV: "false"
PGPORT: 5432
PGPASSWORD: "probe"
DB_USER: "probe"
PROBE_DB_NAME: "probe"
PROBE_DB_LOCATION: "eth-probe-db"
MQ_HOST: "0.0.0.0"
MQ_PORT: 33333
DEBUG: "vulcanize:*,cerc:*"
healthcheck:
test: [ "CMD", "nc", "-v", "localhost", "33333" ]
interval: 20s
timeout: 5s
retries: 15
start_period: 10s
depends_on:
eth-probe-db:
condition: service_healthy
eth-probe-probe:
restart: always
image: cerc/eth-probe:local
environment:
MODE: "probe"
PROBE_DEV: "false"
MQ_HOST: "eth-probe-mq"
MQ_PORT: 33333
PROBE_ID: 0
GETH_HOST: "fixturenet-eth-geth-1"
GETH_MIN_BLOCK: 5
GETHJSON_URL: "http://fixturenet-eth-geth-1:9898/geth.json"
DEBUG: "vulcanize:*,cerc:*,-vulcanize:sniffer:dpt:error"
depends_on:
eth-probe-mq:
condition: service_healthy
@@ -0,0 +1,23 @@
version: "3.2"
services:
prometheus:
restart: always
image: prom/prometheus
depends_on:
fixturenet-eth-geth-1:
condition: service_healthy
volumes:
- ../config/fixturenet-eth-metrics/prometheus/etc:/etc/prometheus
ports:
- "9090"
grafana:
restart: always
image: grafana/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=changeme6325
volumes:
- ../config/fixturenet-eth-metrics/grafana/etc/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ../config/fixturenet-eth-metrics/grafana/etc/provisioning/datasources:/etc/grafana/provisioning/datasources
- ../config/fixturenet-eth-metrics/grafana/etc/dashboards:/etc/grafana/dashboards
ports:
- "3000"
@@ -8,9 +8,19 @@ services:
environment:
RUN_BOOTNODE: "true"
image: cerc/fixturenet-eth-geth:local
ports:
- "9898"
- "30303"
fixturenet-eth-geth-1:
hostname: fixturenet-eth-geth-1
cap_add:
- SYS_PTRACE
environment:
CERC_REMOTE_DEBUG: "true"
CERC_RUN_STATEDIFF: "detect"
CERC_STATEDIFF_DB_NODE_ID: 1
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
env_file:
- ../config/fixturenet-eth/fixturenet-eth.env
image: cerc/fixturenet-eth-geth:local
@@ -24,12 +34,11 @@ services:
- fixturenet-eth-bootnode-geth
ports:
- "8545"
- "40000"
- "6060"
fixturenet-eth-geth-2:
hostname: fixturenet-eth-geth-2
environment:
CERC_RUN_STATEDIFF: "true"
CERC_STATEDIFF_DB_NODE_ID: 2
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "8545"]
interval: 30s
@@ -40,7 +49,6 @@ services:
- ../config/fixturenet-eth/fixturenet-eth.env
image: cerc/fixturenet-eth-geth:local
depends_on:
- migrations
- fixturenet-eth-bootnode-geth
fixturenet-eth-bootnode-lighthouse:
@@ -20,14 +20,27 @@ services:
DATABASE_USER: "vdbm"
DATABASE_PASSWORD: "password"
ETH_CHAIN_ID: 99
ETH_FORWARD_ETH_CALLS: $eth_forward_eth_calls
ETH_PROXY_ON_ERROR: $eth_proxy_on_error
ETH_HTTP_PATH: $eth_http_path
ETH_FORWARD_ETH_CALLS: "false"
ETH_FORWARD_GET_STORAGE_AT: "false"
ETH_PROXY_ON_ERROR: "false"
METRICS: "true"
PROM_HTTP: "true"
PROM_HTTP_ADDR: "0.0.0.0"
PROM_HTTP_PORT: "8090"
LOGRUS_LEVEL: "debug"
CERC_REMOTE_DEBUG: "true"
volumes:
- type: bind
source: ../config/ipld-eth-server/chain.json
target: /tmp/chain.json
ports:
- "127.0.0.1:8081:8081"
- "127.0.0.1:8082:8082"
- "8081"
- "8082"
- "8090"
- "40000"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "8081"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
@@ -0,0 +1,45 @@
version: '3.8'
services:
keycloak-db:
image: postgres:14-alpine
env_file:
- ../config/keycloak/keycloak.env
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 30s
timeout: 10s
retries: 10
start_period: 3s
ports:
- 5432
keycloak:
image: cerc/keycloak:local
env_file:
- ../config/keycloak/keycloak.env
environment:
JAVA_OPTS_APPEND: "-Dkeycloak.migration.action=import -Dkeycloak.migration.provider=dir -Dkeycloak.migration.dir=/import -Dkeycloak.migration.strategy=IGNORE_EXISTING"
volumes:
- ../config/keycloak/import:/import
ports:
- 8080
command: ["start"]
depends_on:
keycloak-db:
condition: service_healthy
keycloak-nginx:
image: nginx:1.23-alpine
restart: always
volumes:
- ../config/keycloak/nginx:/etc/nginx/conf.d
ports:
- 80
depends_on:
- keycloak
keycloak-nginx-prometheus-exporter:
image: nginx/nginx-prometheus-exporter
restart: always
environment:
- SCRAPE_URI=http://keycloak-nginx:80/stub_status
depends_on:
- keycloak-nginx
@@ -3,3 +3,5 @@ services:
test:
image: cerc/test-container:local
restart: always
ports:
- "80"
@@ -0,0 +1,18 @@
version: '3.2'
services:
tx-spammer:
restart: always
image: cerc/tx-spammer:local
env_file:
- ../config/tx-spammer/tx-spammer.env
environment:
ACCOUNTS_CSV_URL: http://fixturenet-eth-bootnode-geth:9898/accounts.csv
ETH_HTTP_PATH: http://fixturenet-eth-geth-1:8545
LOG_LEVEL: debug
SPAMMER_COMMAND: autoSend
depends_on:
fixturenet-eth-bootnode-geth:
condition: service_started
fixturenet-eth-geth-1:
condition: service_healthy
@@ -0,0 +1,49 @@
version: '3.2'
services:
erc20-watcher-db:
restart: unless-stopped
image: postgres:14-alpine
environment:
- POSTGRES_USER=vdbm
- POSTGRES_MULTIPLE_DATABASES=erc20-watcher,erc20-watcher-job-queue
- POSTGRES_EXTENSION=erc20-watcher-job-queue:pgcrypto
- POSTGRES_PASSWORD=password
volumes:
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
- erc20_watcher_db_data:/var/lib/postgresql/data
ports:
- "0.0.0.0:15433:5432"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 20s
timeout: 5s
retries: 15
start_period: 10s
erc20-watcher:
restart: unless-stopped
depends_on:
ipld-eth-server:
condition: service_healthy
erc20-watcher-db:
condition: service_healthy
image: cerc/watcher-erc20:local
environment:
- ETH_RPC_URL=http://go-ethereum:8545
command: ["sh", "-c", "yarn server"]
volumes:
- ../config/watcher-erc20/erc20-watcher.toml:/app/packages/erc20-watcher/environments/local.toml
ports:
- "0.0.0.0:3002:3001"
- "0.0.0.0:9002:9001"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "3002"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
volumes:
erc20_watcher_db_data:
@@ -0,0 +1,49 @@
version: '3.2'
services:
erc721-watcher-db:
restart: unless-stopped
image: postgres:14-alpine
environment:
- POSTGRES_USER=vdbm
- POSTGRES_MULTIPLE_DATABASES=erc721-watcher,erc721-watcher-job-queue
- POSTGRES_EXTENSION=erc721-watcher-job-queue:pgcrypto
- POSTGRES_PASSWORD=password
volumes:
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
- erc721_watcher_db_data:/var/lib/postgresql/data
ports:
- "0.0.0.0:15434:5432"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 20s
timeout: 5s
retries: 15
start_period: 10s
erc721-watcher:
restart: unless-stopped
depends_on:
ipld-eth-server:
condition: service_healthy
erc721-watcher-db:
condition: service_healthy
image: cerc/watcher-erc721:local
environment:
- ETH_RPC_URL=http://go-ethereum:8545
command: ["sh", "-c", "yarn server"]
volumes:
- ../config/watcher-erc721/erc721-watcher.toml:/app/packages/erc721-watcher/environments/local.toml
ports:
- "0.0.0.0:3009:3009"
- "0.0.0.0:9003:9001"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "3009"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
volumes:
erc721_watcher_db_data:
@@ -4,7 +4,7 @@ version: '3.2'
services:
watcher-db:
mobymask-watcher-db:
restart: unless-stopped
image: postgres:14-alpine
environment:
@@ -14,7 +14,7 @@ services:
- POSTGRES_PASSWORD=password
volumes:
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
- watcher_db_data:/var/lib/postgresql/data
- mobymask_watcher_db_data:/var/lib/postgresql/data
ports:
- "0.0.0.0:15432:5432"
healthcheck:
@@ -27,12 +27,12 @@ services:
mobymask-watcher-server:
restart: unless-stopped
depends_on:
watcher-db:
mobymask-watcher-db:
condition: service_healthy
image: cerc/watcher-mobymask:local
command: ["sh", "-c", "yarn server"]
volumes:
- ../config/watcher-mobymask/mobymask-watcher.toml:/app/watcher-ts/packages/mobymask-watcher/environments/local.toml
- ../config/watcher-mobymask/mobymask-watcher.toml:/app/packages/mobymask-watcher/environments/local.toml
ports:
- "0.0.0.0:3001:3001"
- "0.0.0.0:9001:9001"
@@ -50,18 +50,16 @@ services:
depends_on:
mobymask-watcher-server:
condition: service_healthy
watcher-db:
mobymask-watcher-db:
condition: service_healthy
image: cerc/watcher-mobymask:local
command: ["sh", "-c", "yarn job-runner"]
volumes:
- ../config/watcher-mobymask/mobymask-watcher.toml:/app/watcher-ts/packages/mobymask-watcher/environments/local.toml
- ../config/watcher-mobymask/mobymask-watcher.toml:/app/packages/mobymask-watcher/environments/local.toml
ports:
- "0.0.0.0:9000:9000"
extra_hosts:
- "ipld-eth-server:host-gateway"
volumes:
indexer_db_data:
watcher_db_data:
mobymask_watcher_db_data:
@@ -0,0 +1,170 @@
version: '3.2'
services:
uniswap-watcher-db:
restart: unless-stopped
image: postgres:14-alpine
environment:
- POSTGRES_USER=vdbm
- POSTGRES_MULTIPLE_DATABASES=erc20-watcher,uni-watcher,uni-info-watcher,erc20-watcher-job-queue,uni-watcher-job-queue,uni-info-watcher-job-queue
- POSTGRES_EXTENSION=erc20-watcher-job-queue:pgcrypto,uni-watcher-job-queue:pgcrypto,uni-info-watcher-job-queue:pgcrypto
- POSTGRES_PASSWORD=password
command: ["postgres", "-c", "shared_preload_libraries=pg_stat_statements", "-c", "pg_stat_statements.track=all", "-c", "work_mem=2GB"]
volumes:
- ../config/postgresql/multiple-postgressql-databases.sh:/docker-entrypoint-initdb.d/multiple-postgressql-databases.sh
- ../config/postgresql/create-pg-stat-statements.sql:/docker-entrypoint-initdb.d/create-pg-stat-statements.sql
- uniswap_watcher_db_data:/var/lib/postgresql/data
ports:
- "0.0.0.0:15435:5432"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "5432"]
interval: 20s
timeout: 5s
retries: 15
start_period: 10s
shm_size: '8GB'
erc20-watcher-server:
restart: unless-stopped
depends_on:
uniswap-watcher-db:
condition: service_healthy
image: cerc/watcher-uniswap-v3:local
working_dir: /app/packages/erc20-watcher
environment:
- DEBUG=vulcanize:*
command: ["node", "--enable-source-maps", "dist/server.js"]
volumes:
- ../config/watcher-uniswap-v3/erc20-watcher.toml:/app/packages/erc20-watcher/environments/local.toml
ports:
- "0.0.0.0:3005:3001"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "3001"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
extra_hosts:
- "host.docker.internal:host-gateway"
uni-watcher-job-runner:
restart: unless-stopped
depends_on:
uniswap-watcher-db:
condition: service_healthy
image: cerc/watcher-uniswap-v3:local
working_dir: /app/packages/uni-watcher
environment:
- DEBUG=vulcanize:*
command: ["sh", "-c", "./watch-contract.sh && node --enable-source-maps dist/job-runner.js"]
volumes:
- ../config/watcher-uniswap-v3/uni-watcher.toml:/app/packages/uni-watcher/environments/local.toml
- ../config/watcher-uniswap-v3/watch-contract.sh:/app/packages/uni-watcher/watch-contract.sh
ports:
- "0.0.0.0:9004:9000"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "9000"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
extra_hosts:
- "host.docker.internal:host-gateway"
uni-watcher-server:
restart: unless-stopped
depends_on:
uniswap-watcher-db:
condition: service_healthy
uni-watcher-job-runner:
condition: service_healthy
image: cerc/watcher-uniswap-v3:local
environment:
- UNISWAP_START_BLOCK=12369621
- DEBUG=vulcanize:*
working_dir: /app/packages/uni-watcher
command: ["./run.sh"]
volumes:
- ../config/watcher-uniswap-v3/uni-watcher.toml:/app/packages/uni-watcher/environments/local.toml
- ../config/watcher-uniswap-v3/run.sh:/app/packages/uni-watcher/run.sh
ports:
- "0.0.0.0:3003:3003"
- "0.0.0.0:9005:9001"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "3003"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
extra_hosts:
- "host.docker.internal:host-gateway"
uni-info-watcher-job-runner:
restart: unless-stopped
depends_on:
uniswap-watcher-db:
condition: service_healthy
erc20-watcher-server:
condition: service_healthy
uni-watcher-server:
condition: service_healthy
image: cerc/watcher-uniswap-v3:local
working_dir: /app/packages/uni-info-watcher
environment:
- DEBUG=vulcanize:*
command: ["node", "--enable-source-maps", "dist/job-runner.js"]
volumes:
- ../config/watcher-uniswap-v3/uni-info-watcher.toml:/app/packages/uni-info-watcher/environments/local.toml
ports:
- "0.0.0.0:9006:9002"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "9002"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
extra_hosts:
- "host.docker.internal:host-gateway"
uni-info-watcher-server:
restart: unless-stopped
depends_on:
uniswap-watcher-db:
condition: service_healthy
erc20-watcher-server:
condition: service_healthy
uni-watcher-server:
condition: service_healthy
uni-info-watcher-job-runner:
condition: service_healthy
image: cerc/watcher-uniswap-v3:local
environment:
- UNISWAP_START_BLOCK=12369621
working_dir: /app/packages/uni-info-watcher
command: ["./run.sh"]
volumes:
- ../config/watcher-uniswap-v3/uni-info-watcher.toml:/app/packages/uni-info-watcher/environments/local.toml
- ../config/watcher-uniswap-v3/run.sh:/app/packages/uni-info-watcher/run.sh
ports:
- "0.0.0.0:3004:3004"
- "0.0.0.0:9007:9003"
healthcheck:
test: ["CMD", "nc", "-v", "localhost", "3004"]
interval: 20s
timeout: 5s
retries: 15
start_period: 5s
extra_hosts:
- "host.docker.internal:host-gateway"
uniswap-v3-info:
depends_on:
uni-info-watcher-server:
condition: service_healthy
image: cerc/uniswap-v3-info:local
ports:
- "0.0.0.0:3006:3000"
volumes:
uniswap_watcher_db_data:
@@ -0,0 +1,9 @@
apiVersion: 1
providers:
- name: dashboards
type: file
updateIntervalSeconds: 10
options:
path: /etc/grafana/dashboards
foldersFromFilesStructure: true
@@ -0,0 +1,19 @@
apiVersion: 1
datasources:
- id: 1
uid: jZUuGao4k
orgId: 1
name: Prometheus
type: prometheus
typeName: Prometheus
typeLogoUrl: public/app/plugins/datasource/prometheus/img/prometheus_logo.svg
access: proxy
url: http://prometheus:9090
user: ""
database: ""
basicAuth: false
isDefault: true
jsonData:
httpMethod: POST
readOnly: false
@@ -0,0 +1,34 @@
global:
scrape_interval: 5s
evaluation_interval: 15s
scrape_configs:
# ipld-eth-server
- job_name: 'ipld-eth-server'
metrics_path: /metrics
scrape_interval: 5s
static_configs:
- targets: ['ipld-eth-server:8090']
# geth
- job_name: 'geth'
metrics_path: /debug/metrics/prometheus
scheme: http
static_configs:
- targets: ['fixturenet-eth-geth-1:6060']
# nginx
- job_name: 'nginx'
scrape_interval: 5s
metrics_path: /metrics
scheme: http
static_configs:
- targets: ['keycloak-nginx-prometheus-exporter:9113']
# keycloak
- job_name: 'keycloak'
scrape_interval: 5s
metrics_path: /auth/realms/cerc/metrics
scheme: http
static_configs:
- targets: ['keycloak:8080']
@@ -2,6 +2,7 @@
ACCOUNT_PASSWORD=secret1212
# ENODE of the geth bootnode.
BOOTNODE_KEY="b0ac22adcad37213c7c565810a50f1772291e7b0ce53fb73e7ec2a3c75bc13b5"
ENODE="enode://af22c29c316ad069cf48a09a4ad5cf04a251b411e45098888d114c6dd7f489a13786620d5953738762afa13711d4ffb3b19aa5de772d8af72f851f7e9c5b164a@fixturenet-eth-bootnode-geth:30303"
# JWT shared by geth and lighthouse for authentication.
@@ -16,3 +17,7 @@ CERC_STATEDIFF_DB_PORT=5432
CERC_STATEDIFF_DB_NAME="cerc_testing"
CERC_STATEDIFF_DB_USER="vdbm"
CERC_STATEDIFF_DB_PASSWORD="password"
CERC_STATEDIFF_DB_GOOSE_MIN_VER=23
CERC_STATEDIFF_DB_LOG_STATEMENTS="false"
CERC_GETH_VMODULE="statediff/*=5,rpc/*=5"
File diff suppressed because it is too large Load Diff
+17
View File
@@ -0,0 +1,17 @@
POSTGRES_DB=keycloak
POSTGRES_USER=keycloak
POSTGRES_PASSWORD=keycloak
KC_DB=postgres
KC_DB_URL_HOST=keycloak-db
KC_DB_URL_DATABASE=${POSTGRES_DB}
KC_DB_USERNAME=${POSTGRES_USER}
KC_DB_PASSWORD=${POSTGRES_PASSWORD}
KC_DB_SCHEMA=public
KC_HOSTNAME=localhost
KC_HTTP_ENABLED="true"
KC_HTTP_RELATIVE_PATH="/auth"
KC_HOSTNAME_STRICT_HTTPS="false"
KEYCLOAK_ADMIN=admin
KEYCLOAK_ADMIN_PASSWORD=admin
X_API_CHECK_REALM=cerc
X_API_CHECK_CLIENT_ID="%api_key%"
@@ -0,0 +1,72 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
### geth
location ~ ^/eth/?([^/]*)$ {
set $apiKey $1;
if ($apiKey = '') {
set $apiKey $http_X_API_KEY;
}
auth_request /auth;
proxy_buffering off;
rewrite /.*$ / break;
proxy_pass http://fixturenet-eth-geth-1:8545;
}
## ipld-eth-server
# location ~ ^/ipld/eth/([^/]*)$ {
# set $apiKey $1;
# if ($apiKey = '') {
# set $apiKey $http_X_API_KEY;
# }
# auth_request /auth;
# auth_request_set $user_id $sent_http_x_user_id;
# proxy_buffering off;
# rewrite /.*$ / break;
# proxy_pass http://ipld-eth-server:8081;
# proxy_set_header X-Original-Remote-Addr $remote_addr;
# proxy_set_header X-User-Id $user_id;
# }
#
# location ~ ^/ipld/gql/([^/]*)$ {
# set $apiKey $1;
# if ($apiKey = '') {
# set $apiKey $http_X_API_KEY;
# }
# auth_request /auth;
# proxy_buffering off;
# rewrite /.*$ / break;
# proxy_pass http://ipld-eth-server:8082;
# }
## lighthouse
location /beacon/ {
set $apiKey $http_X_API_KEY;
auth_request /auth;
proxy_buffering off;
proxy_pass http://fixturenet-eth-lighthouse-1:8001/;
}
location = /auth {
internal;
proxy_buffering off;
resolver 127.0.0.11 ipv6=off;
proxy_pass http://keycloak:8080/auth/realms/cerc/check?apiKey=$apiKey;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
proxy_set_header X-Original-Remote-Addr $remote_addr;
proxy_set_header X-Original-Host $host;
}
location = /stub_status {
stub_status;
}
}
@@ -0,0 +1 @@
CREATE EXTENSION pg_stat_statements;
@@ -0,0 +1,2 @@
ETH_CALL_FREQ=1000
ETH_SEND_FREQ=1000
@@ -0,0 +1,41 @@
[server]
host = "0.0.0.0"
port = 3001
mode = "storage"
kind = "lazy"
[metrics]
host = "127.0.0.1"
port = 9000
[metrics.gql]
port = 9001
[database]
type = "postgres"
host = "erc20-watcher-db"
port = 5432
database = "erc20-watcher"
username = "vdbm"
password = "password"
synchronize = true
logging = false
maxQueryExecutionTime = 100
[upstream]
[upstream.ethServer]
gqlApiEndpoint = "http://ipld-eth-server:8082/graphql"
rpcProviderEndpoint = "http://ipld-eth-server:8081"
[upstream.cache]
name = "requests"
enabled = false
deleteOnStart = false
[jobQueue]
dbConnectionString = "postgres://vdbm:password@erc20-watcher-db:5432/erc20-watcher-job-queue"
maxCompletionLagInSecs = 300
jobDelayInMilliSecs = 100
eventsInBatch = 50
blockDelayInMilliSecs = 2000
prefetchBlocksInMem = true
prefetchBlockCount = 10
@@ -0,0 +1,56 @@
[server]
host = "0.0.0.0"
port = 3009
kind = "lazy"
# Checkpointing state.
checkpointing = true
# Checkpoint interval in number of blocks.
checkpointInterval = 2000
# Enable state creation
enableState = true
# Boolean to filter logs by contract.
filterLogs = false
# Max block range for which to return events in eventsInRange GQL query.
# Use -1 for skipping check on block range.
maxEventsBlockRange = 1000
[metrics]
host = "127.0.0.1"
port = 9000
[metrics.gql]
port = 9001
[database]
type = "postgres"
host = "erc721-watcher-db"
port = 5432
database = "erc721-watcher"
username = "vdbm"
password = "password"
synchronize = true
logging = false
maxQueryExecutionTime = 100
[upstream]
[upstream.ethServer]
gqlApiEndpoint = "http://ipld-eth-server:8082/graphql"
rpcProviderEndpoint = "http://ipld-eth-server:8081"
[upstream.cache]
name = "requests"
enabled = false
deleteOnStart = false
[jobQueue]
dbConnectionString = "postgres://vdbm:password@erc721-watcher-db:5432/erc721-watcher-job-queue"
maxCompletionLagInSecs = 300
jobDelayInMilliSecs = 100
eventsInBatch = 50
blockDelayInMilliSecs = 2000
prefetchBlocksInMem = true
prefetchBlockCount = 10
@@ -27,7 +27,7 @@
[database]
type = "postgres"
host = "watcher-db"
host = "mobymask-watcher-db"
port = 5432
database = "mobymask-watcher"
username = "vdbm"
@@ -47,7 +47,7 @@
deleteOnStart = false
[jobQueue]
dbConnectionString = "postgres://vdbm:password@watcher-db/mobymask-watcher-job-queue"
dbConnectionString = "postgres://vdbm:password@mobymask-watcher-db/mobymask-watcher-job-queue"
maxCompletionLagInSecs = 300
jobDelayInMilliSecs = 100
eventsInBatch = 50
@@ -0,0 +1,39 @@
[server]
host = "0.0.0.0"
port = 3001
mode = "eth_call"
kind = "lazy"
[metrics]
host = "127.0.0.1"
port = 9000
[metrics.gql]
port = 9001
[database]
type = "postgres"
host = "uniswap-watcher-db"
port = 5432
database = "erc20-watcher"
username = "vdbm"
password = "password"
synchronize = true
logging = false
maxQueryExecutionTime = 100
[upstream]
[upstream.ethServer]
gqlApiEndpoint = "http://ipld-eth-server.example.com:8083/graphql"
rpcProviderEndpoint = "http://ipld-eth-server.example.com:8082"
[upstream.cache]
name = "requests"
enabled = false
deleteOnStart = false
[jobQueue]
dbConnectionString = "postgres://vdbm:password@uniswap-watcher-db:5432/erc20-watcher-job-queue"
maxCompletionLagInSecs = 300
jobDelayInMilliSecs = 100
eventsInBatch = 50
blockDelayInMilliSecs = 2000
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
set -e
set -u
echo "Initializing watcher..."
yarn fill --start-block $UNISWAP_START_BLOCK --end-block $((UNISWAP_START_BLOCK + 1))
echo "Running active server"
DEBUG=vulcanize:* exec node --enable-source-maps dist/server.js
@@ -0,0 +1,90 @@
[server]
host = "0.0.0.0"
port = 3004
mode = "prod"
kind = "active"
# Checkpointing state.
checkpointing = true
# Checkpoint interval in number of blocks.
checkpointInterval = 50000
# Enable state creation
enableState = false
# Max block range for which to return events in eventsInRange GQL query.
# Use -1 for skipping check on block range.
maxEventsBlockRange = 1000
# Interval in number of blocks at which to clear entities cache.
clearEntitiesCacheInterval = 1000
# Boolean to skip updating entity fields required in state creation and not required in the frontend.
skipStateFieldsUpdate = false
# Boolean to load GQL query nested entity relations sequentially.
loadRelationsSequential = false
# Max GQL API requests to process simultaneously (defaults to 1).
maxSimultaneousRequests = 1
# GQL cache settings
[server.gqlCache]
enabled = true
# Max in-memory cache size (in bytes) (default 8 MB)
# maxCacheSize
# GQL cache-control max-age settings (in seconds)
maxAge = 15
timeTravelMaxAge = 86400 # 1 day
[metrics]
host = "0.0.0.0"
port = 9002
[metrics.gql]
port = 9003
[database]
type = "postgres"
host = "uniswap-watcher-db"
port = 5432
database = "uni-info-watcher"
username = "vdbm"
password = "password"
synchronize = true
logging = false
maxQueryExecutionTime = 100
[database.extra]
# maximum number of clients the pool should contain
max = 20
[upstream]
[upstream.ethServer]
gqlApiEndpoint = "http://ipld-eth-server.example.com:8083/graphql"
rpcProviderEndpoint = "http://ipld-eth-server.example.com:8082"
[upstream.cache]
name = "requests"
enabled = false
deleteOnStart = false
[upstream.uniWatcher]
gqlEndpoint = "http://uni-watcher-server:3003/graphql"
gqlSubscriptionEndpoint = "ws://uni-watcher-server:3003/graphql"
[upstream.tokenWatcher]
gqlEndpoint = "http://erc20-watcher-server:3001/graphql"
gqlSubscriptionEndpoint = "ws://erc20-watcher-server:3001/graphql"
[jobQueue]
dbConnectionString = "postgres://vdbm:password@uniswap-watcher-db:5432/uni-info-watcher-job-queue"
maxCompletionLagInSecs = 300
jobDelayInMilliSecs = 1000
eventsInBatch = 50
subgraphEventsOrder = true
blockDelayInMilliSecs = 2000
prefetchBlocksInMem = true
prefetchBlockCount = 10
@@ -0,0 +1,41 @@
[server]
host = "0.0.0.0"
port = 3003
kind = "active"
[metrics]
host = "0.0.0.0"
port = 9000
[metrics.gql]
port = 9001
[database]
type = "postgres"
host = "uniswap-watcher-db"
port = 5432
database = "uni-watcher"
username = "vdbm"
password = "password"
synchronize = true
logging = false
maxQueryExecutionTime = 100
[upstream]
[upstream.ethServer]
gqlApiEndpoint = "http://ipld-eth-server.example.com:8083/graphql"
rpcProviderEndpoint = "http://ipld-eth-server.example.com:8082"
[upstream.cache]
name = "requests"
enabled = false
deleteOnStart = false
[jobQueue]
dbConnectionString = "postgres://vdbm:password@uniswap-watcher-db:5432/uni-watcher-job-queue"
maxCompletionLagInSecs = 300
jobDelayInMilliSecs = 0
eventsInBatch = 50
lazyUpdateBlockProgress = true
blockDelayInMilliSecs = 2000
prefetchBlocksInMem = true
prefetchBlockCount = 10
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
set -e
set -u
echo "Watching factory contract 0x1F98431c8aD98523631AE4a59f267346ea31F984"
yarn watch:contract --address 0x1F98431c8aD98523631AE4a59f267346ea31F984 --kind factory --startingBlock 12369621 --checkpoint
echo "Watching nfpm contract 0xC36442b4a4522E871399CD717aBDD847Ab11FE88"
yarn watch:contract --address 0xC36442b4a4522E871399CD717aBDD847Ab11FE88 --kind nfpm --startingBlock 12369651 --checkpoint
@@ -0,0 +1,31 @@
# From: https://github.com/vyzo/gerbil/blob/master/docker/Dockerfile
FROM gerbil/ubuntu
# Install the Solidity compiler (latest stable version)
# and guile
# and libsecp256k1-dev
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && export DEBCONF_NOWARNINGS="yes" && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:ethereum/ethereum && \
apt-get update && \
apt-get install -y solc && \
apt-get install -y guile-3.0 && \
apt-get install -y libsecp256k1-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN mkdir /scripts
COPY install-dependencies.sh /scripts
# Override the definition of GERBIL_PATH in the base image, but
# is safe because (at present) no gerbil packages are installed in the base image
# We do this in order to allow a set of pre-installed packages from the container
# to be used with an arbitrary, potentially different set of projects bind mounted
# at /src
ENV GERBIL_PATH=/.gerbil
RUN bash /scripts/install-dependencies.sh
# Needed to prevent git from raging about /src
RUN git config --global --add safe.directory /src
COPY entrypoint.sh /scripts
ENTRYPOINT ["/scripts/entrypoint.sh"]
@@ -0,0 +1,21 @@
## Gerbil Scheme Builder
This container is designed to be used as a simple "build runner" environment for building and running Scheme projects using Gerbil and gerbil-ethereum. Its primary purpose is to allow build/test/run of gerbil code without the need to install and configure all the necessary prerequisites and dependencies on the host system.
### Usage
First build the container with:
```
$ laconic-so build-containers --include cerc/builder-gerbil
```
Now, assuming a gerbil project located at `~/projects/my-project`, run bash in the container mounting the project with:
```
$ docker run -it -v $HOME/projects/my-project:/src cerc/builder-gerbil:latest bash
root@7c4124bb09e3:/src#
```
Now gerbil commands can be run.
@@ -0,0 +1,2 @@
#!/bin/sh
exec "$@"
@@ -0,0 +1,16 @@
DEPS=(github.com/fare/gerbil-utils
github.com/fare/gerbil-poo
github.com/fare/gerbil-crypto
github.com/fare/gerbil-persist
github.com/fare/gerbil-ethereum
github.com/drewc/gerbil-swank
github.com/drewc/drewc-r7rs-swank
github.com/drewc/smug-gerbil
github.com/drewc/ftw
github.com/vyzo/gerbil-libp2p
) ;
for i in ${DEPS[@]} ; do
echo "Installing gerbil package: $i"
gxpkg install $i &&
gxpkg build $i
done
@@ -0,0 +1,48 @@
# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=16-bullseye
FROM node:${VARIANT}
ARG USERNAME=node
ARG NPM_GLOBAL=/usr/local/share/npm-global
# Add NPM global to PATH.
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
RUN \
# Configure global npm install location, use group to adapt to UID/GID changes
if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
&& usermod -a -G npm ${USERNAME} \
&& umask 0002 \
&& mkdir -p ${NPM_GLOBAL} \
&& touch /usr/local/etc/npmrc \
&& chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
&& chmod g+s ${NPM_GLOBAL} \
&& npm config -g set prefix ${NPM_GLOBAL} \
&& su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \
# Install eslint
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
&& npm cache clean --force > /dev/null 2>&1
# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends jq
# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>"
RUN mkdir /scripts
COPY build-npm-package.sh /scripts
COPY yarn-local-registry-fixup.sh /scripts
COPY build-npm-package-local-dependencies.sh /scripts
ENV PATH="${PATH}:/scripts"
COPY entrypoint.sh .
ENTRYPOINT ["./entrypoint.sh"]
# Placeholder CMD : generally this will be overridden at run time like :
# docker run -it -v /home/builder/cerc/laconic-sdk:/workspace cerc/builder-js sh -c 'cd /workspace && yarn && yarn build'
CMD node --version
@@ -0,0 +1,17 @@
## JS/TS Package Builder
This container is designed to be used as a simple "build runner" environment for building and publishing JS/TS projects
using `yarn`.
### Running a build
As a temporary measure while the necessary functionality is being added to Stack Orchestrator,
it is possible to build packages manually by invoking `docker run` , for example as follows:
```
$ docker run --rm -it --add-host gitea.local:host-gateway \
-v ${HOME}/cerc/laconic-registry-cli:/workspace cerc/builder-js \
sh -c 'cd /workspace && CERC_NPM_AUTH_TOKEN=6613572a28ebebaee20ccd90064251fa8c2b94f6 \
build-npm-package-local-dependencies.sh http://gitea.local:3000/api/packages/cerc-io/npm/ 0.1.8'
```
@@ -0,0 +1,34 @@
#!/bin/bash
# Usage: build-npm-package-local-dependencies.sh <registry-url> <publish-with-this-version>
# Runs build-npm-package.sh after first fixing up yarn.lock to use a local
# npm registry for all packages in a spcific scope (currently @cerc-io)
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
if ! [[ $# -eq 1 || $# -eq 2 ]]; then
echo "Illegal number of parameters" >&2
exit 1
fi
if [[ -z "${CERC_NPM_AUTH_TOKEN}" ]]; then
echo "CERC_NPM_AUTH_TOKEN is not set" >&2
exit 1
fi
# Exit on error
set -e
local_npm_registry_url=$1
package_publish_version=$2
# TODO: make this a paramater and allow a list of scopes
npm_scope_for_local="@cerc-io"
# We need to configure the local registry
npm config set ${npm_scope_for_local}:registry ${local_npm_registry_url}
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
# Find the set of dependencies from the specified scope
mapfile -t dependencies_from_scope < <(cat package.json | jq -r '.dependencies | with_entries(if (.key|test("^'${npm_scope_for_local}'/.*$")) then ( {key: .key, value: .value } ) else empty end ) | keys[]')
echo "Fixing up dependencies"
for package in "${dependencies_from_scope[@]}"
do
echo "Fixing up package ${package}"
yarn-local-registry-fixup.sh $package ${local_npm_registry_url}
done
echo "Running build"
build-npm-package.sh ${local_npm_registry_url} ${package_publish_version}
@@ -0,0 +1,37 @@
#!/bin/bash
# Usage: build-npm-package.sh <registry-url> <publish-with-this-version>
# Note: supply the registry auth token in CERC_NPM_AUTH_TOKEN
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
set -x
fi
if ! [[ $# -eq 1 || $# -eq 2 ]]; then
echo "Illegal number of parameters" >&2
exit 1
fi
if [[ -z "${CERC_NPM_AUTH_TOKEN}" ]]; then
echo "CERC_NPM_AUTH_TOKEN is not set" >&2
exit 1
fi
if [[ $# -eq 2 ]]; then
package_publish_version=$2
else
package_publish_version=$( cat package.json | jq -r .version )
fi
# Exit on error
set -e
# Get the name of this package from package.json since we weren't passed that
package_name=$( cat package.json | jq -r .name )
local_npm_registry_url=$1
npm config set @lirewine:registry ${local_npm_registry_url}
npm config set @cerc-io:registry ${local_npm_registry_url}
npm config set -- ${local_npm_registry_url}:_authToken ${CERC_NPM_AUTH_TOKEN}
# First check if the version of this package we're trying to build already exists in the registry
package_exists=$( yarn info --json ${package_name}@${package_publish_version} 2>/dev/null | jq -r .data.dist.tarball )
if [[ ! -z "$package_exists" && "$package_exists" != "null" ]]; then
echo "${package_publish_version} of ${package_name} already exists in the registry, skipping build"
exit 0
fi
echo "Build and publish ${package_name} version ${package_publish_version}"
yarn install
yarn build
yarn publish --non-interactive --new-version ${package_publish_version} --no-git-tag-version
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
exec "$@"
@@ -0,0 +1,57 @@
#!/bin/bash
# Usage: yarn-local-registry-fixup.sh <package-to-fix> <registry-url>
# Assumes package.json and yarn.lock are in the cwd
# The purpose of this script is to take a project cloned from git
# and "fixup" its yarn.lock file such that specified dependency
# will be fetched from a registry other than the one used when
# yarn.lock was generated. It updates all checksums using data
# from the "new" registry (because due to embedded timestamps etc
# the same source code re-built later will not have the same checksum).
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
if [[ $# -ne 2 ]]; then
echo "Illegal number of parameters" >&2
exit 1
fi
# Exit on error
set -e
target_package=$1
local_npm_registry_url=$2
# TODO: use jq rather than sed here:
versioned_target_package=$(grep ${target_package} package.json | sed -e 's#[[:space:]]\{1,\}\"\('${target_package}'\)\":[[:space:]]\{1,\}\"\(.*\)\",#\1@\2#' )
# Use yarn info to get URL checksums etc from the new registry
yarn_info_output=$(yarn info --json $versioned_target_package 2>/dev/null)
# First check if the target version actually exists.
# If it doesn't exist there will be no .data.dist.tarball element,
# and jq will output the string "null"
package_tarball=$(echo $yarn_info_output | jq -r .data.dist.tarball)
if [[ $package_tarball == "null" ]]; then
echo "FATAL: Target package version ($versioned_target_package) not found" >&2
exit 1
fi
# Code below parses out the values we need
# When running inside a container, the registry can return a URL with the wrong host name due to proxying
# so we need to check if that has happened and fix the URL if so.
if ! [[ "${package_tarball}" =~ ^${local_npm_registry_url}.* ]]; then
# HACK: I've hard-wired the host names below. Replace with proper implementation
# TODO: remove the hack when proven no longer necessary
package_tarball=$( echo ${package_tarball} | sed -e 's/localhost/gitea.local/g' )
fi
package_integrity=$(echo $yarn_info_output | jq -r .data.dist.integrity)
package_shasum=$(echo $yarn_info_output | jq -r .data.dist.shasum)
package_resolved=${package_tarball}#${package_shasum}
# Some strings need to be escaped so they work when passed to sed later
escaped_package_integrity=$(printf '%s\n' "$package_integrity" | sed -e 's/[\/&]/\\&/g')
escaped_package_resolved=$(printf '%s\n' "$package_resolved" | sed -e 's/[\/&]/\\&/g')
escaped_target_package=$(printf '%s\n' "$target_package" | sed -e 's/[\/&]/\\&/g')
if [ -n "$CERC_SCRIPT_VERBOSE" ]; then
echo "Tarball: ${package_tarball}"
echo "Integrity: ${package_integrity}"
echo "Shasum: ${package_shasum}"
echo "Resolved: ${package_resolved}"
fi
# Use magic sed regex to replace the values in yarn.lock
# Note: yarn.lock is not json so we can not use jq for this
sed -i -e '/^\"'${escaped_target_package}'.*\":$/ , /^\".*$/ s/^\([[:space:]]\{1,\}resolved \).*$/\1'\"${escaped_package_resolved}\"'/' yarn.lock
sed -i -e '/^\"'${escaped_target_package}'.*\":$/ , /^\".*$/ s/^\([[:space:]]\{1,\}integrity \).*$/\1'${escaped_package_integrity}'/' yarn.lock
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# Build cerc/eth-probe
docker build -t cerc/eth-probe:local ${CERC_REPO_BASE_DIR}/eth-probe
@@ -1,10 +1,17 @@
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
FROM cerc/go-ethereum:local
RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash
# Using the same golang image as used to build geth: https://github.com/cerc-io/go-ethereum/blob/HEAD/Dockerfile
FROM golang:1.18-alpine as delve
RUN go install github.com/go-delve/delve/cmd/dlv@latest
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools
FROM cerc/go-ethereum:local as geth
FROM alpine:latest
RUN apk add --no-cache python3 python3-dev py3-pip curl wget jq build-base gettext libintl openssl bash bind-tools postgresql-client
COPY --from=delve /go/bin/dlv /usr/local/bin/
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/
COPY --from=ethgen /apps /apps
RUN cd /apps/el-gen && pip3 install -r requirements.txt
@@ -14,6 +21,7 @@ COPY run-el.sh /opt/testnet/run.sh
RUN cd /opt/testnet && make genesis-el
COPY --from=geth /usr/local/bin/geth /usr/local/bin/
RUN geth init /opt/testnet/build/el/geth.json && rm -f ~/.ethereum/geth/nodekey
ENTRYPOINT ["/opt/testnet/run.sh"]
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -e
# See: https://github.com/skylenet/ethereum-genesis-generator/blob/master/entrypoint.sh
rm -rf ../build/el
mkdir -p ../build/el
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX)
envsubst < el-config.yaml > $tmp_dir/genesis-config.yaml
ttd=`cat $tmp_dir/genesis-config.yaml | grep terminal_total_difficulty | awk '{ print $2 }'`
homestead_block=`cat $tmp_dir/genesis-config.yaml | grep homestead_block | awk '{ print $2 }'`
eip150_block=`cat $tmp_dir/genesis-config.yaml | grep eip150_block | awk '{ print $2 }'`
eip155_block=`cat $tmp_dir/genesis-config.yaml | grep eip155_block | awk '{ print $2 }'`
eip158_block=`cat $tmp_dir/genesis-config.yaml | grep eip158_block | awk '{ print $2 }'`
byzantium_block=`cat $tmp_dir/genesis-config.yaml | grep byzantium_block | awk '{ print $2 }'`
constantinople_block=`cat $tmp_dir/genesis-config.yaml | grep constantinople_block | awk '{ print $2 }'`
petersburg_block=`cat $tmp_dir/genesis-config.yaml | grep petersburg_block | awk '{ print $2 }'`
istanbul_block=`cat $tmp_dir/genesis-config.yaml | grep istanbul_block | awk '{ print $2 }'`
berlin_block=`cat $tmp_dir/genesis-config.yaml | grep berlin_block | awk '{ print $2 }'`
london_block=`cat $tmp_dir/genesis-config.yaml | grep london_block | awk '{ print $2 }'`
merge_fork_block=`cat $tmp_dir/genesis-config.yaml | grep merge_fork_block | awk '{ print $2 }'`
python3 /apps/el-gen/genesis_geth.py $tmp_dir/genesis-config.yaml | \
jq ".config.terminalTotalDifficulty=$ttd" | \
jq ".config.homesteadBlock=$homestead_block" | \
jq ".config.eip150Block=$eip150_block" | \
jq ".config.eip155Block=$eip155_block" | \
jq ".config.eip158Block=$eip158_block" | \
jq ".config.byzantiumBlock=$byzantium_block" | \
jq ".config.constantinopleBlock=$constantinople_block" | \
jq ".config.petersburgBlock=$petersburg_block" | \
jq ".config.istanbulBlock=$istanbul_block" | \
jq ".config.berlinBlock=$berlin_block" | \
jq ".config.londonBlock=$london_block" | \
jq ".config.mergeForkBlock=$merge_fork_block" > ../build/el/geth.json
python3 ../accounts/mnemonic_to_csv.py $tmp_dir/genesis-config.yaml > ../build/el/accounts.csv
@@ -11,6 +11,17 @@ chain_id: 1212
deposit_contract_address: "0x1212121212121212121212121212121212121212"
genesis_timestamp: 0
terminal_total_difficulty: 1000
homestead_block: 1
eip150_block: 1
eip155_block: 1
eip158_block: 1
byzantium_block: 1
constantinople_block: 1
petersburg_block: 1
istanbul_block: 1
berlin_block: 1
london_block: 1
merge_fork_block: 1
clique:
enabled: false
@@ -0,0 +1,99 @@
#!/bin/bash
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
ETHERBASE=`cat /opt/testnet/build/el/accounts.csv | head -1 | cut -d',' -f2`
NETWORK_ID=`cat /opt/testnet/el/el-config.yaml | grep 'chain_id' | awk '{ print $2 }'`
NETRESTRICT=`ip addr | grep inet | grep -v '127.0' | awk '{print $2}'`
HOME_DIR=`pwd`
cd /opt/testnet/build/el
python3 -m http.server 9898 &
cd $HOME_DIR
START_CMD="geth"
if [ "true" == "$CERC_REMOTE_DEBUG" ] && [ -x "/usr/local/bin/dlv" ]; then
START_CMD="/usr/local/bin/dlv --listen=:40000 --headless=true --api-version=2 --accept-multiclient exec /usr/local/bin/geth --continue --"
fi
if [ "true" == "$RUN_BOOTNODE" ]; then
$START_CMD \
--nodekeyhex="${BOOTNODE_KEY}" \
--nodiscover \
--ipcdisable \
--networkid=${NETWORK_ID} \
--netrestrict="${NETRESTRICT}"
else
cd /opt/testnet/accounts
./import_keys.sh
echo -n "$JWT" > /opt/testnet/build/el/jwtsecret
if [ "$CERC_RUN_STATEDIFF" == "detect" ] && [ -n "$CERC_STATEDIFF_DB_HOST" ]; then
dig_result=$(dig $CERC_STATEDIFF_DB_HOST +short)
dig_status_code=$?
if [[ $dig_status_code = 0 && -n $dig_result ]]; then
echo "Statediff DB at $CERC_STATEDIFF_DB_HOST"
CERC_RUN_STATEDIFF="true"
else
echo "No statediff DB available."
CERC_RUN_STATEDIFF="false"
fi
fi
STATEDIFF_OPTS=""
if [ "$CERC_RUN_STATEDIFF" == "true" ]; then
ready=0
while [ $ready -eq 0 ]; do
echo "Waiting for statediff DB..."
sleep 1
export PGPASSWORD="$CERC_STATEDIFF_DB_PASSWORD"
result=$(psql -h "$CERC_STATEDIFF_DB_HOST" \
-p "$CERC_STATEDIFF_DB_PORT" \
-U "$CERC_STATEDIFF_DB_USER" \
-d "$CERC_STATEDIFF_DB_NAME" \
-t -c 'select max(version_id) from goose_db_version;' 2>/dev/null | awk '{ print $1 }')
if [ -n "$result" ] && [ $result -ge $CERC_STATEDIFF_DB_GOOSE_MIN_VER ]; then
echo "DB ready..."
ready=1
fi
done
STATEDIFF_OPTS="--statediff=true \
--statediff.db.host=$CERC_STATEDIFF_DB_HOST \
--statediff.db.name=$CERC_STATEDIFF_DB_NAME \
--statediff.db.nodeid=$CERC_STATEDIFF_DB_NODE_ID \
--statediff.db.password=$CERC_STATEDIFF_DB_PASSWORD \
--statediff.db.port=$CERC_STATEDIFF_DB_PORT \
--statediff.db.user=$CERC_STATEDIFF_DB_USER \
--statediff.db.logstatements=${CERC_STATEDIFF_DB_LOG_STATEMENTS:-false} \
--statediff.waitforsync=true \
--statediff.writing=true"
fi
$START_CMD \
--bootnodes="${ENODE}" \
--allow-insecure-unlock \
--http \
--http.addr="0.0.0.0" \
--http.vhosts="*" \
--http.api="eth,web3,net,admin,personal,debug,statediff" \
--http.corsdomain="*" \
--authrpc.addr="0.0.0.0" \
--authrpc.vhosts="*" \
--authrpc.jwtsecret="/opt/testnet/build/el/jwtsecret" \
--networkid="${NETWORK_ID}" \
--netrestrict="${NETRESTRICT}" \
--gcmode archive \
--txlookuplimit=0 \
--cache.preimages \
--syncmode=full \
--mine \
--miner.threads=1 \
--metrics \
--metrics.addr="0.0.0.0" \
--verbosity=${CERC_GETH_VERBOSITY:-3} \
--vmodule="${CERC_GETH_VMODULE:-statediff/*=5}" \
--miner.etherbase="${ETHERBASE}" ${STATEDIFF_OPTS}
fi
@@ -27,4 +27,8 @@ RUN cd /opt/testnet && make genesis-cl
# Work around some bugs in lcli where the default path is always used.
RUN mkdir -p /root/.lighthouse && cd /root/.lighthouse && ln -s /opt/testnet/build/cl/testnet
RUN mkdir -p /scripts
COPY scripts/status-internal.sh /scripts
COPY scripts/status.sh /scripts
ENTRYPOINT ["/opt/testnet/run.sh"]
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Wrapper to facilitate using status.sh inside the container
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
export LIGHTHOUSE_BASE_URL="http://fixturenet-eth-lighthouse-1:8001"
export GETH_BASE_URL="http://fixturenet-eth-geth-1:8545"
# See: https://stackoverflow.com/a/246128/1701505
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
$SCRIPT_DIR/status.sh
@@ -1,5 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
STATUSES=("geth to generate DAG" "beacon phase0" "beacon altair" "beacon bellatrix pre-merge" "beacon bellatrix merge")
STATUS=0
@@ -7,13 +9,17 @@ STATUS=0
LIGHTHOUSE_BASE_URL=${LIGHTHOUSE_BASE_URL}
GETH_BASE_URL=${GETH_BASE_URL}
# TODO: Docker commands below should be replaced by some interface into stack orchestrator
# or some execution environment-neutral mechanism.
if [ -z "$LIGHTHOUSE_BASE_URL" ]; then
LIGHTHOUSE_PORT=`docker ps -f "name=fixturenet-eth-lighthouse-1-1" --format "{{.Ports}}" | head -1 | cut -d':' -f2 | cut -d'-' -f1`
LIGHTHOUSE_CONTAINER=`docker ps -q -f "name=fixturenet-eth-lighthouse-1-1"`
LIGHTHOUSE_PORT=`docker port $LIGHTHOUSE_CONTAINER 8001 | cut -d':' -f2`
LIGHTHOUSE_BASE_URL="http://localhost:${LIGHTHOUSE_PORT}"
fi
if [ -z "$GETH_BASE_URL" ]; then
GETH_PORT=`docker ps -f "name=fixturenet-eth-geth-1-1" --format "{{.Ports}}" | head -1 | cut -d':' -f2 | cut -d'-' -f1`
GETH_CONTAINER=`docker ps -q -f "name=fixturenet-eth-geth-1-1"`
GETH_PORT=`docker port $GETH_CONTAINER 8545 | cut -d':' -f2`
GETH_BASE_URL="http://localhost:${GETH_PORT}"
fi
@@ -10,7 +10,7 @@
"petersburgBlock": 0,
"istanbulBlock": 0,
"clique": {
"period": 2,
"period": 5,
"epoch": 3000
}
},

Some files were not shown because too many files have changed in this diff Show More