├── .github ├── settings.yml └── workflows │ └── helm.yml ├── .gitignore ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── LICENSE ├── MAINTAINERS.md ├── Makefile ├── README.md ├── SECURITY.md ├── charts ├── firefly-evmconnect │ ├── .helmignore │ ├── Chart.yaml │ ├── ci │ │ ├── gasless-sidechain-values.yaml │ │ └── goerli-values.yaml │ ├── templates │ │ ├── _helpers.tpl │ │ ├── secret.yaml │ │ ├── service.yaml │ │ └── statefulset.yaml │ └── values.yaml ├── firefly-signer │ ├── Chart.yaml │ ├── templates │ │ ├── _helpers.tpl │ │ ├── ethsigner.yaml │ │ ├── keystore.yaml │ │ ├── service.yaml │ │ └── statefulset.yaml │ └── values.yaml ├── firefly │ ├── .helmignore │ ├── Chart.lock │ ├── Chart.yaml │ ├── README.md │ ├── ci │ │ ├── database-override-values.yaml │ │ ├── eth-values.yaml │ │ ├── fab-values.yaml │ │ └── mtls-values.yaml │ ├── contracts │ │ ├── erc1155.json │ │ └── firefly.json │ ├── local-kind-values.yaml │ ├── scripts │ │ ├── ff-db-migrations.sh │ │ ├── ff-deploy-erc20-erc721-contracts │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── ff-register-contracts.sh │ │ └── ff-registration.sh │ ├── templates │ │ ├── NOTES.txt │ │ ├── _helpers.tpl │ │ ├── core │ │ │ ├── ingress.yaml │ │ │ ├── job-migrations.yaml │ │ │ ├── job-registration.yaml │ │ │ ├── secret.yaml │ │ │ ├── service.yaml │ │ │ ├── servicemonitor.yaml │ │ │ └── statefulset.yaml │ │ ├── dataexchange │ │ │ ├── certificate.yaml │ │ │ ├── ingress.yaml │ │ │ ├── secret.yaml │ │ │ ├── service.yaml │ │ │ └── statefulset.yaml │ │ ├── erc1155 │ │ │ ├── deployment.yaml │ │ │ └── service.yaml │ │ ├── erc20erc721 │ │ │ ├── configmap-deploy-scripts.yaml │ │ │ ├── deployment.yaml │ │ │ ├── job-deploy-contracts.yaml │ │ │ └── service.yaml │ │ ├── ethconnect │ │ │ ├── configmap-contracts.yaml │ │ │ ├── ingress.yaml │ │ │ ├── job-register-contracts.yaml │ │ │ ├── secret.yaml │ │ │ ├── service.yaml │ │ │ └── statefulset.yaml │ │ └── sandbox │ │ │ ├── deployment.yaml │ │ │ ├── ingress.yaml │ │ │ └── service.yaml │ └── values.yaml ├── ipfs │ ├── Chart.yaml │ ├── templates │ │ ├── _helpers.tpl │ │ ├── deployment.yaml │ │ └── service.yaml │ └── values.yaml ├── license.tpl └── lintconf.yaml ├── hack ├── Firefly.json ├── enforce-chart-conventions.sh ├── multiparty-values.yaml └── multiparty.sh ├── img └── helm_chart_deployment_architecture.jpg ├── kind-config.yml ├── manifests ├── mtls-cert.yaml └── tls-issuers.yaml └── values ├── genesis-besu.yml ├── monitoring.yml ├── monitoring ├── alerting-besu-nodes.yml └── grafana-besu-dashboard.yml └── validator.yml /.github/settings.yml: -------------------------------------------------------------------------------- 1 | # 2 | # SPDX-License-Identifier: Apache-2.0 3 | # 4 | 5 | repository: 6 | name: firefly-helm-charts 7 | description: Firefly Helm Charts 8 | homepage: https://github.com/hyperledger/firefly-helm-charts 9 | default_branch: main 10 | has_downloads: true 11 | has_issues: true 12 | has_projects: true 13 | has_wiki: true 14 | archived: false 15 | private: false 16 | allow_squash_merge: true 17 | allow_merge_commit: true 18 | allow_rebase_merge: true 19 | -------------------------------------------------------------------------------- /.github/workflows/helm.yml: -------------------------------------------------------------------------------- 1 | name: Helm Charts CI 2 | 3 | on: 4 | release: 5 | types: [ released, prereleased ] 6 | push: 7 | branches: 8 | - main 9 | paths: 10 | - "charts/**/*" 11 | - ".github/workflows/helm.yml" 12 | - "Makefile" 13 | pull_request: 14 | branches: 15 | - main 16 | paths: 17 | - "charts/**/*" 18 | - ".github/workflows/helm.yml" 19 | - "Makefile" 20 | jobs: 21 | test: 22 | runs-on: ubuntu-latest 23 | steps: 24 | - uses: actions/checkout@v2 25 | with: 26 | fetch-depth: 0 27 | 28 | - name: setup helm 29 | uses: azure/setup-helm@v1 30 | with: 31 | version: 3.7.2 32 | 33 | - name: setup chart-testing tool 34 | uses: helm/chart-testing-action@v2.2.0 35 | 36 | - name: lint charts 37 | run: make lint 38 | 39 | - name: setup kind 40 | uses: engineerd/setup-kind@v0.5.0 41 | with: 42 | version: v0.20.0 43 | 44 | - name: install k8s deps 45 | run: make deps 46 | 47 | # - name: run chart integration test 48 | # run: make test 49 | 50 | - name: debug k8s 51 | if: ${{ failure() }} 52 | run: | 53 | kubectl get pod -A 54 | release: 55 | needs: test 56 | if: github.event_name == 'push' || github.event_name == 'release' 57 | runs-on: ubuntu-latest 58 | permissions: 59 | contents: read 60 | packages: write 61 | steps: 62 | - uses: actions/checkout@v2 63 | 64 | - name: chart-version 65 | run: | 66 | CHART_VERSION=$(helm show chart charts/firefly | grep '^version:' | awk '{ printf("%s", $2) }') 67 | echo "CHART_VERSION=${CHART_VERSION}" >> $GITHUB_ENV 68 | 69 | - name: head-version 70 | if: github.event_name == 'push' 71 | run: | 72 | BUILD_TAG=${{ env.CHART_VERSION }}-$(date +"%Y%m%d")-$GITHUB_RUN_NUMBER 73 | echo "PUBLISH_VERSION=${BUILD_TAG}" >> $GITHUB_ENV 74 | 75 | - name: release-version 76 | if: github.event_name == 'release' 77 | run: | 78 | # chop off the 'v' preceeding the semver in the git tag 79 | TAG_VERSION=$(echo -n "${GITHUB_REF##*/}" | sed 's/v//g') 80 | if [[ "$TAG_VERSION" != "${{ env.CHART_VERSION }}" ]]; then 81 | echo "Release tag version [$TAG_VERSION] does not match the chart's version [${{ env.CHART_VERSION }}]" 82 | exit 1 83 | fi 84 | echo "PUBLISH_VERSION=${{ env.CHART_VERSION }}" >> $GITHUB_ENV 85 | 86 | - name: setup helm 87 | uses: azure/setup-helm@v1 88 | with: 89 | version: 3.7.2 90 | 91 | - name: helm publish 92 | run: | 93 | echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u $GITHUB_ACTOR --password-stdin 94 | 95 | helm package --version ${{ env.PUBLISH_VERSION }} ./charts/firefly-evmconnect 96 | helm push firefly-evmconnect-${{ env.PUBLISH_VERSION }}.tgz oci://ghcr.io/hyperledger/helm 97 | 98 | helm dep up ./charts/firefly 99 | helm package --version ${{ env.PUBLISH_VERSION }} ./charts/firefly 100 | helm push firefly-${{ env.PUBLISH_VERSION }}.tgz oci://ghcr.io/hyperledger/helm 101 | env: 102 | HELM_EXPERIMENTAL_OCI: "1" 103 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/helm,macos,linux,windows,visualstudiocode,intellij 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=helm,macos,linux,windows,visualstudiocode,intellij 4 | 5 | local-values*.yaml 6 | 7 | ### Helm ### 8 | # Chart dependencies 9 | **/charts/*.tgz 10 | **/local-values*.yaml 11 | 12 | ### Intellij ### 13 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 14 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 15 | 16 | # User-specific stuff 17 | .idea/**/workspace.xml 18 | .idea/**/tasks.xml 19 | .idea/**/usage.statistics.xml 20 | .idea/**/dictionaries 21 | .idea/**/shelf 22 | *.iml 23 | 24 | # AWS User-specific 25 | .idea/**/aws.xml 26 | 27 | # Generated files 28 | .idea/**/contentModel.xml 29 | 30 | # Sensitive or high-churn files 31 | .idea/**/dataSources/ 32 | .idea/**/dataSources.ids 33 | .idea/**/dataSources.local.xml 34 | .idea/**/sqlDataSources.xml 35 | .idea/**/dynamic.xml 36 | .idea/**/uiDesigner.xml 37 | .idea/**/dbnavigator.xml 38 | 39 | # Gradle 40 | .idea/**/gradle.xml 41 | .idea/**/libraries 42 | 43 | # Gradle and Maven with auto-import 44 | # When using Gradle or Maven with auto-import, you should exclude module files, 45 | # since they will be recreated, and may cause churn. Uncomment if using 46 | # auto-import. 47 | # .idea/artifacts 48 | # .idea/compiler.xml 49 | # .idea/jarRepositories.xml 50 | # .idea/modules.xml 51 | # .idea/*.iml 52 | # .idea/modules 53 | # *.iml 54 | # *.ipr 55 | 56 | # CMake 57 | cmake-build-*/ 58 | 59 | # Mongo Explorer plugin 60 | .idea/**/mongoSettings.xml 61 | 62 | # File-based project format 63 | *.iws 64 | 65 | # IntelliJ 66 | out/ 67 | 68 | # mpeltonen/sbt-idea plugin 69 | .idea_modules/ 70 | 71 | # JIRA plugin 72 | atlassian-ide-plugin.xml 73 | 74 | # Cursive Clojure plugin 75 | .idea/replstate.xml 76 | 77 | # SonarLint plugin 78 | .idea/sonarlint/ 79 | 80 | # Crashlytics plugin (for Android Studio and IntelliJ) 81 | com_crashlytics_export_strings.xml 82 | crashlytics.properties 83 | crashlytics-build.properties 84 | fabric.properties 85 | 86 | # Editor-based Rest Client 87 | .idea/httpRequests 88 | 89 | # Android studio 3.1+ serialized cache file 90 | .idea/caches/build_file_checksums.ser 91 | 92 | ### Intellij Patch ### 93 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 94 | 95 | # *.iml 96 | # modules.xml 97 | # .idea/misc.xml 98 | # *.ipr 99 | 100 | # Sonarlint plugin 101 | # https://plugins.jetbrains.com/plugin/7973-sonarlint 102 | .idea/**/sonarlint/ 103 | 104 | # SonarQube Plugin 105 | # https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin 106 | .idea/**/sonarIssues.xml 107 | 108 | # Markdown Navigator plugin 109 | # https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced 110 | .idea/**/markdown-navigator.xml 111 | .idea/**/markdown-navigator-enh.xml 112 | .idea/**/markdown-navigator/ 113 | 114 | # Cache file creation bug 115 | # See https://youtrack.jetbrains.com/issue/JBR-2257 116 | .idea/$CACHE_FILE$ 117 | 118 | # CodeStream plugin 119 | # https://plugins.jetbrains.com/plugin/12206-codestream 120 | .idea/codestream.xml 121 | 122 | ### Linux ### 123 | *~ 124 | 125 | # temporary files which can be created if a process still has a handle open of a deleted file 126 | .fuse_hidden* 127 | 128 | # KDE directory preferences 129 | .directory 130 | 131 | # Linux trash folder which might appear on any partition or disk 132 | .Trash-* 133 | 134 | # .nfs files are created when an open file is removed but is still being accessed 135 | .nfs* 136 | 137 | ### macOS ### 138 | # General 139 | .DS_Store 140 | .AppleDouble 141 | .LSOverride 142 | 143 | # Icon must end with two \r 144 | Icon 145 | 146 | 147 | # Thumbnails 148 | ._* 149 | 150 | # Files that might appear in the root of a volume 151 | .DocumentRevisions-V100 152 | .fseventsd 153 | .Spotlight-V100 154 | .TemporaryItems 155 | .Trashes 156 | .VolumeIcon.icns 157 | .com.apple.timemachine.donotpresent 158 | 159 | # Directories potentially created on remote AFP share 160 | .AppleDB 161 | .AppleDesktop 162 | Network Trash Folder 163 | Temporary Items 164 | .apdisk 165 | 166 | ### VisualStudioCode ### 167 | .vscode/* 168 | !.vscode/settings.json 169 | !.vscode/tasks.json 170 | !.vscode/launch.json 171 | !.vscode/extensions.json 172 | !.vscode/*.code-snippets 173 | 174 | # Local History for Visual Studio Code 175 | .history/ 176 | 177 | # Built Visual Studio Code Extensions 178 | *.vsix 179 | 180 | ### VisualStudioCode Patch ### 181 | # Ignore all local history of files 182 | .history 183 | .ionide 184 | 185 | # Support for Project snippet scope 186 | 187 | ### Windows ### 188 | # Windows thumbnail cache files 189 | Thumbs.db 190 | Thumbs.db:encryptable 191 | ehthumbs.db 192 | ehthumbs_vista.db 193 | 194 | # Dump file 195 | *.stackdump 196 | 197 | # Folder config file 198 | [Dd]esktop.ini 199 | 200 | # Recycle Bin used on file shares 201 | $RECYCLE.BIN/ 202 | 203 | # Windows Installer files 204 | *.cab 205 | *.msi 206 | *.msix 207 | *.msm 208 | *.msp 209 | 210 | # Windows shortcuts 211 | *.lnk 212 | 213 | # End of https://www.toptal.com/developers/gitignore/api/helm,macos,linux,windows,visualstudiocode,intellij 214 | 215 | besu 216 | besu-chart -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | 3 | - @hyperledger/firefly-helm-charts-maintainers 4 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | Code of Conduct Guidelines 2 | ========================== 3 | 4 | Please review the Hyperledger [Code of 5 | Conduct](https://wiki.hyperledger.org/community/hyperledger-project-code-of-conduct) 6 | before participating. It is important that we keep things civil. 7 | 8 | Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2018 Kaleido 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | # Maintainers 2 | 3 | The following is the list of current maintainers this repo: 4 | 5 | | Name | GitHub | Email | LFID | 6 | | ---------------- | --------------- | --------------------------- | --------------- | 7 | | Hayden Fuss | hfuss | hayden.fuss@kaleido.io | hfuss | 8 | | Peter Broadhurst | peterbroadhurst | peter.broadhurst@kaleido.io | peterbroadhurst | 9 | | Enrique Lacal | enriquel8 | enrique.lacal@kaleido.io | enrique.lacal | 10 | | Sam May | sammaywork | sam.may@kaleido.io | sammaywork | 11 | 12 | This list is to be kept up to date as maintainers are added or removed. 13 | 14 | For the full list of maintainers across all repos, the expectations of a maintainer and the process for becoming a maintainer, please see the [FireFly Maintainers page on the Hyperledger Wiki](https://wiki.hyperledger.org/display/FIR/Maintainers). 15 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | all: lint e2e 4 | 5 | kind: 6 | kind create cluster --name firefly --config kind-config.yml 7 | kind export kubeconfig -n firefly 8 | 9 | clean: 10 | kind delete cluster 11 | 12 | lint: 13 | helm dep up charts/firefly 14 | helm template charts/firefly --set "erc20erc721.enabled=true" --set "erc1155.enabled=true" --set "ethconnect.enabled=true" --set "evmconnect.enabled=true" 15 | ct lint \ 16 | --target-branch=main \ 17 | --exclude-deprecated \ 18 | --excluded-charts besu-node,besu-genesis\ 19 | --check-version-increment=false \ 20 | --lint-conf=./charts/lintconf.yaml 21 | ./hack/enforce-chart-conventions.sh 22 | 23 | besu: 24 | kubectl --namespace default apply -f ./values/monitoring/ 25 | mkdir -p besu 26 | git clone --depth 1 https://github.com/Consensys/quorum-kubernetes besu-chart 27 | helm upgrade --install genesis ./besu-chart/helm/charts/besu-genesis --namespace default --create-namespace --values ./values/genesis-besu.yml 28 | kubectl --namespace default wait --for=condition=complete job/besu-genesis-init --timeout=600s 29 | helm upgrade --install validator-1 ./besu-chart/helm/charts/besu-node --namespace default --values ./values/validator.yml 30 | kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=besu-statefulset --timeout=600s 31 | 32 | deps: 33 | kubectl create ns cert-manager || true 34 | kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.4.0/cert-manager.crds.yaml 35 | helm repo add jetstack https://charts.jetstack.io || true 36 | helm upgrade --install --skip-crds -n cert-manager cert-manager jetstack/cert-manager --wait 37 | kubectl apply -n cert-manager -f manifests/tls-issuers.yaml 38 | helm repo add prometheus-community https://prometheus-community.github.io/helm-charts || true 39 | helm upgrade --install --set kubeStateMetrics.enabled=false --set nodeExporter.enabled=false --set grafana.enabled=false kube-prometheus prometheus-community/kube-prometheus-stack 40 | helm repo add bitnami https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami || true 41 | helm upgrade --install --set global.postgresql.auth.postgresPassword=firef1y --set extraEnv[0].name=POSTGRES_DATABASE --set extraEnv[0].value=firefly postgresql bitnami/postgresql --version 14.3.0 42 | kubectl create secret generic custom-psql-config --dry-run --from-literal="url=postgres://postgres:firef1y@postgresql.default.svc:5432/postgres?sslmode=disable" -o json | kubectl apply -f - 43 | kubectl apply -n default -f manifests/mtls-cert.yaml 44 | helm upgrade --install ipfs ./charts/ipfs -f ./charts/ipfs/values.yaml 45 | 46 | starter: charts/firefly/local-values.yaml 47 | 48 | charts/firefly/local-values.yaml: 49 | cp ./charts/firefly/ci/eth-values.yaml charts/firefly/local-values.yaml 50 | 51 | deploy: 52 | helm upgrade -i firefly ./charts/firefly -f ./charts/firefly/local-values.yaml 53 | 54 | test: 55 | ct install --namespace default --helm-extra-args="--timeout 120s" --charts charts/firefly 56 | 57 | e2e: kind deps test 58 | 59 | stack: kind deps besu 60 | helm upgrade -i firefly-signer ./charts/firefly-signer -f ./charts/firefly/values.yaml 61 | helm upgrade -i firefly ./charts/firefly -f ./charts/firefly/local-kind-values.yaml 62 | 63 | clean-stack: 64 | kind delete cluster --name firefly 65 | yq -i '.config.fireflyContracts = []' ./hack/multiparty-values.yaml 66 | rm -rf besu/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hyperledger FireFly Helm Charts 2 | 3 | 4 | 5 | The official [Helm chart](https://helm.sh/) for [Hypeledger Firefly](https://hyperledger.github.io/firefly/) and its 6 | related connector microservices. See the [chart `README`](charts/firefly/README.md) for installation and 7 | configuration instructions. 8 | 9 | ## Quick Start 10 | 11 | If you want to run these charts locally on your own machine, you can run a single command to get a fully working stack, end-to-end: 12 | 13 | ``` 14 | make stack 15 | ``` 16 | 17 | This will create a pre-set environment with the following configuration: 18 | 19 | - Runs all containers in [kind](https://kind.sigs.k8s.io/) 20 | - Sets up a PostgreSQL DB in the K8s cluster 21 | - Creates a basic single node Besu blockchain also running in the K8s cluster 22 | - Sets up FireFly and all of its dependencies to use these services 23 | - Sets up an ERC-20 / ERC-721 Token Connector in this stack 24 | - Provides an optional script to enable multiparty mode after initial set up 25 | 26 | If you wish to make changes to your stack you can modify `./charts/firefly/local-kind-values.yaml` and run: 27 | 28 | ``` 29 | helm upgrade --install firefly ./charts/firefly -f ./charts/firefly/local-kind-values.yaml 30 | ``` 31 | 32 | ### Enabling multiparty mode 33 | 34 | After you run the quickstart command above, you can also (optionally) enable Multiparty mode. This will enabled FireFly's advanced Messaging features. To enable that, you can run the shell script: 35 | 36 | ``` 37 | ./hack/multiparty.sh 38 | ``` 39 | 40 | This will deploy the multiparty contract, update the config file, and register the org/node for you automatically. If you need to upgrade the multiparty in the future, you can run this script again and it will deploy and configure a new contract. It will not re-run registration if the org/node are already registered. 41 | 42 | > NOTE: If you have enabled multiparty mode and you wish to make changes by customizing your values file, be sure to include the multiparty values as well, otherwise they will be removed and your multiparty network will not work. 43 | > 44 | > ``` 45 | > helm upgrade --install firefly ./charts/firefly -f ./charts/firefly/local-kind-values.yaml -f ./hack/multiparty-values.yaml 46 | > ``` 47 | 48 | ### Modifying configuration 49 | 50 | Configuration of the stack for non-default options is possible using these charts, broadly there are 2 places to make changes. For Besu charts, the appropriate `values.yaml` files in the `values` directory allows for configuration of values such as the genesis block, and Besu-specific options. For FireFly related components the `values.yaml` file within the sub-directory for the chart (stored in `charts/`) contains the configuration for options. 51 | 52 | Viewing the appropriate README for each microservice, will give information around the values and structure of the configuration in the `values.yaml` files. 53 | 54 | ## Accessing the Helm Repo 55 | 56 | Helm's [experimental OCI registry support](https://helm.sh/docs/topics/registries/) is used for publishing and retrieving 57 | the FireFly Helm chart, as a result one must log into [GHCR](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) 58 | to download the chart: 59 | 60 | ```shell 61 | export HELM_EXPERIMENTAL_OCI=1 62 | 63 | helm registry login ghcr.io 64 | ``` 65 | 66 | > **NOTE**: you must use a [GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) 67 | > when authenticating to the GHCR registry as opposed to using your GitHub password. 68 | 69 | ## Development 70 | 71 | ### Prerequisites 72 | 73 | - [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installing-with-a-package-manager) 0.11+ 74 | - [helm](https://helm.sh/docs/intro/install/) 3.7+ 75 | - [ct](https://github.com/helm/chart-testing#installation) 3.4+ 76 | 77 | ### Linting 78 | 79 | Lint the chart using [`ct`](https://github.com/helm/chart-testing) and ensure it adheres to the project conventions: 80 | 81 | ```shell 82 | make lint 83 | ``` 84 | 85 | ### Testing 86 | 87 | Create a local Kubernetes cluster in Docker via [`kind`](https://kind.sigs.k8s.io/): 88 | 89 | ```shell 90 | make kind 91 | ``` 92 | 93 | Then install FireFly dependencies to the cluster (i.e. PostgreSQL, cert-manager, Prometheus): 94 | 95 | ```shell 96 | make deps 97 | ``` 98 | 99 | Run the E2E tests: 100 | 101 | ```shell 102 | make test 103 | ``` 104 | 105 | Or deploy the chart using your own customized `charts/firefly/local-values.yaml`: 106 | 107 | ```shell 108 | make deploy 109 | ``` 110 | 111 | If you are unsure of what to initially put in your `charts/firefly/locall-values.yaml` file, we 112 | suggest using the [Ethereum CI values](charts/firefly/ci/eth-values.yaml) as a starting point 113 | and reading the [chart configuration documentation](charts/firefly/README.md#configuration): 114 | 115 | ```shell 116 | make starter 117 | ``` 118 | 119 | If you are developing with a Fabric blockchain see the [Fabric CI values](charts/firefly/ci/fab-values.yaml) and 120 | [additional chart documentation](charts/firefly/README.md#fabric). 121 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Hyperledger Security Policy 2 | 3 | ## Reporting a Security Bug 4 | 5 | If you think you have discovered a security issue in any of the Hyperledger projects, we'd love to 6 | hear from you. We will take all security bugs seriously and if confirmed upon investigation we will 7 | patch it within a reasonable amount of time and release a public security bulletin discussing the 8 | impact and credit the discoverer. 9 | 10 | There are two ways to report a security bug. The easiest is to email a description of the flaw and 11 | any related information (e.g. reproduction steps, version) to 12 | [security at hyperledger dot org](mailto:security@hyperledger.org). 13 | 14 | The other way is to file a confidential security bug in our 15 | [JIRA bug tracking system](https://jira.hyperledger.org). Be sure to set the “Security Level” to 16 | “Security issue”. 17 | 18 | The process by which the Hyperledger Security Team handles security bugs is documented further in 19 | our [Defect Response page](https://wiki.hyperledger.org/display/SEC/Defect+Response) on our 20 | [wiki](https://wiki.hyperledger.org). 21 | -------------------------------------------------------------------------------- /charts/firefly-evmconnect/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /charts/firefly-evmconnect/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: firefly-evmconnect 3 | description: | 4 | A Helm chart for deploying the FireFly EVMConnect microservice to Kubernetes. 5 | Requires a running instance of FireFly and a persistent volume for managing its 6 | transaction state. 7 | type: application 8 | 9 | # Generally we follow this practice for updates to the chart version number: 10 | # - Significant changes to the structure or purpose of the chart (major version update) 11 | # - FireFly EVM Connect major release (minor version update) 12 | # - Smaller release and updates (patch version updates) 13 | version: 0.8.1 14 | appVersion: "v1.3.20" 15 | 16 | maintainers: 17 | - name: onelapahead 18 | email: hayden.fuss@kaleido.io 19 | - name: peterbroadhurst 20 | email: peter.broadhurst@kaleido.io 21 | - name: calbritt 22 | email: cari.albritton@kaleido.io 23 | -------------------------------------------------------------------------------- /charts/firefly-evmconnect/ci/gasless-sidechain-values.yaml: -------------------------------------------------------------------------------- 1 | fullnameOverride: "evmconnect-nogas" 2 | 3 | config: 4 | jsonRpcUrl: "http://geth.local:8545" 5 | 6 | policyEngine: | 7 | policyengine.simple: 8 | fixedGasPrice: "0" 9 | resubmitInterval: 5m 10 | gasOracle: 11 | mode: fixed -------------------------------------------------------------------------------- /charts/firefly-evmconnect/ci/goerli-values.yaml: -------------------------------------------------------------------------------- 1 | fullnameOverride: "evmconnect-public" 2 | 3 | config: 4 | jsonRpcUrl: "https://goerli.infura.io/v3/apikey" 5 | 6 | confirmations: 7 | required: 20 8 | 9 | connector: | 10 | url: {{ .Values.config.jsonRpcUrl | quote }} 11 | pollingInterval: 10s 12 | -------------------------------------------------------------------------------- /charts/firefly-evmconnect/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "firefly-evmconnect.name" -}} 5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 | {{- end }} 7 | 8 | {{/* 9 | Create a default fully qualified app name. 10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 11 | If release name contains chart name it will be used as a full name. 12 | */}} 13 | {{- define "firefly-evmconnect.fullname" -}} 14 | {{- if .Values.fullnameOverride }} 15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 16 | {{- else }} 17 | {{- $name := default .Chart.Name .Values.nameOverride }} 18 | {{- if contains $name .Release.Name }} 19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 20 | {{- else }} 21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{/* 27 | Create chart name and version as used by the chart label. 28 | */}} 29 | {{- define "firefly-evmconnect.chart" -}} 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 31 | {{- end }} 32 | 33 | {{/* 34 | Common labels 35 | */}} 36 | {{- define "firefly-evmconnect.labels" -}} 37 | helm.sh/chart: {{ include "firefly-evmconnect.chart" . }} 38 | {{ include "firefly-evmconnect.selectorLabels" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} 43 | {{- end }} 44 | 45 | {{/* 46 | Selector labels 47 | */}} 48 | {{- define "firefly-evmconnect.selectorLabels" -}} 49 | app.kubernetes.io/name: {{ include "firefly-evmconnect.name" . }} 50 | app.kubernetes.io/instance: {{ .Release.Name }} 51 | app.kubernetes.io/component: evmconnect 52 | {{- end }} 53 | -------------------------------------------------------------------------------- /charts/firefly-evmconnect/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: v1 20 | kind: Secret 21 | metadata: 22 | name: {{ include "firefly-evmconnect.fullname" . }}-config 23 | labels: 24 | {{- include "firefly-evmconnect.labels" . | nindent 4 }} 25 | stringData: 26 | config.yaml: |- 27 | {{- with .Values.config.confirmations }} 28 | confirmations: 29 | {{- toYaml . | nindent 6 }} 30 | {{- end }} 31 | 32 | {{- with .Values.config.eventstreams }} 33 | eventstreams: 34 | {{- toYaml . | nindent 6 }} 35 | {{- end }} 36 | 37 | {{- with .Values.config.webhooks }} 38 | webhooks: 39 | {{- toYaml . | nindent 6 }} 40 | {{- end }} 41 | 42 | {{- with .Values.config.policyLoop }} 43 | policyloop: 44 | {{- toYaml . | nindent 6 }} 45 | {{- end }} 46 | 47 | {{- with .Values.config.transactions }} 48 | transactions: 49 | {{- toYaml . | nindent 6 }} 50 | {{- end }} 51 | 52 | {{- tpl .Values.config.policyEngine . | nindent 4 }} 53 | 54 | log: 55 | level: {{ .Values.config.log.level | quote }} 56 | json: 57 | enabled: {{ .Values.config.log.jsonEnabled }} 58 | 59 | persistence: 60 | {{- if eq .Values.config.persistence.type "leveldb" }} 61 | type: leveldb 62 | leveldb: 63 | maxHandles: {{ .Values.config.persistence.leveldb.maxHandles | int }} 64 | path: /var/run/leveldb 65 | syncWrites: {{ .Values.config.persistence.leveldb.syncWrites }} 66 | {{- else if .Values.config.persistence.templateOverride }} 67 | {{ tpl .Values.config.persistence.templateOverride . | nindent 8 }} 68 | {{- end }} 69 | 70 | connector: 71 | {{- tpl .Values.config.connector . | nindent 6 }} 72 | 73 | api: 74 | port: {{ .Values.service.port }} 75 | address: 0.0.0.0 76 | publicURL: "http://{{ include "firefly-evmconnect.fullname" . }}:{{ .Values.service.port }}" 77 | -------------------------------------------------------------------------------- /charts/firefly-evmconnect/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: {{ include "firefly-evmconnect.fullname" . }} 23 | labels: 24 | {{- include "firefly-evmconnect.labels" . | nindent 4 }} 25 | spec: 26 | type: {{ .Values.service.type }} 27 | ports: 28 | - port: {{ .Values.service.port }} 29 | targetPort: http 30 | protocol: TCP 31 | name: http 32 | selector: 33 | {{- include "firefly-evmconnect.selectorLabels" . | nindent 4 }} 34 | -------------------------------------------------------------------------------- /charts/firefly-evmconnect/templates/statefulset.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: apps/v1 20 | kind: StatefulSet 21 | metadata: 22 | name: {{ include "firefly-evmconnect.fullname" . }} 23 | labels: 24 | {{- include "firefly-evmconnect.labels" . | nindent 4 }} 25 | spec: 26 | replicas: 1 27 | serviceName: {{ include "firefly-evmconnect.fullname" . }} 28 | updateStrategy: 29 | type: RollingUpdate 30 | selector: 31 | matchLabels: 32 | {{- include "firefly-evmconnect.selectorLabels" . | nindent 6 }} 33 | template: 34 | metadata: 35 | annotations: 36 | checksum/config: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | labels: 41 | {{- include "firefly-evmconnect.selectorLabels" . | nindent 8 }} 42 | spec: 43 | {{- with .Values.imagePullSecrets }} 44 | imagePullSecrets: 45 | {{- toYaml . | nindent 8 }} 46 | {{- end }} 47 | securityContext: 48 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 49 | {{- if .Values.initContainers }} 50 | initContainers: 51 | {{- tpl .Values.initContainers . | nindent 8 }} 52 | {{- end }} 53 | containers: 54 | - name: evmconnect 55 | securityContext: 56 | {{- toYaml .Values.securityContext | nindent 12 }} 57 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}" 58 | imagePullPolicy: {{ .Values.image.pullPolicy }} 59 | args: 60 | - -f 61 | - /etc/evmconnect/config.yaml 62 | {{- if .Values.extraEnv }} 63 | env: 64 | {{- toYaml .Values.extraEnv | nindent 12 }} 65 | {{- end }} 66 | ports: 67 | - name: http 68 | containerPort: {{ .Values.service.port }} 69 | protocol: TCP 70 | livenessProbe: 71 | tcpSocket: 72 | port: http 73 | initialDelaySeconds: 5 74 | failureThreshold: 5 75 | successThreshold: 1 76 | periodSeconds: 5 77 | readinessProbe: 78 | tcpSocket: 79 | port: http 80 | initialDelaySeconds: 5 81 | failureThreshold: 10 82 | successThreshold: 3 83 | periodSeconds: 3 84 | resources: 85 | {{- toYaml .Values.resources | nindent 12 }} 86 | volumeMounts: 87 | - mountPath: /var/run/leveldb 88 | name: evmconnect 89 | - mountPath: /etc/evmconnect/config.yaml 90 | name: config 91 | subPath: config.yaml 92 | {{- if .Values.extraContainers }} 93 | {{- tpl .Values.extraContainers . | nindent 8 }} 94 | {{- end }} 95 | {{- with .Values.nodeSelector }} 96 | nodeSelector: 97 | {{- toYaml . | nindent 8 }} 98 | {{- end }} 99 | {{- with .Values.affinity }} 100 | affinity: 101 | {{- toYaml . | nindent 8 }} 102 | {{- end }} 103 | {{- with .Values.tolerations }} 104 | tolerations: 105 | {{- toYaml . | nindent 8 }} 106 | {{- end }} 107 | volumes: 108 | - name: config 109 | secret: 110 | secretName: "{{ include "firefly-evmconnect.fullname" . }}-config" 111 | volumeClaimTemplates: 112 | {{- if eq .Values.config.persistence.type "leveldb" }} 113 | - metadata: 114 | name: evmconnect 115 | {{- with .Values.persistentVolume }} 116 | {{- with .annotations }} 117 | annotations: 118 | {{- toYaml . | nindent 10 }} 119 | {{- end }} 120 | spec: 121 | accessModes: 122 | {{- toYaml .accessModes | nindent 10 }} 123 | storageClassName: {{ .storageClass }} 124 | resources: 125 | requests: 126 | storage: {{ .size }} 127 | {{- end }} 128 | {{- end }} 129 | {{- if .Values.extraVolumeClaimTemplates }} 130 | {{- tpl .Values.extraVolumeClaimTemplates . | nindent 4 }} 131 | {{- end }} 132 | -------------------------------------------------------------------------------- /charts/firefly-evmconnect/values.yaml: -------------------------------------------------------------------------------- 1 | fullnameOverride: "" 2 | 3 | service: 4 | type: ClusterIP 5 | port: 5000 6 | 7 | podAnnotations: {} 8 | 9 | imagePullSecrets: [] 10 | 11 | podSecurityContext: 12 | fsGroup: 1001 13 | 14 | securityContext: {} 15 | 16 | extraEnv: [] 17 | 18 | initContainers: "" 19 | extraContainers: "" 20 | extraVolumeClaimTemplates: "" 21 | 22 | resources: {} 23 | 24 | nodeSelector: {} 25 | 26 | affinity: {} 27 | 28 | tolerations: {} 29 | 30 | persistentVolume: 31 | accessModes: 32 | - ReadWriteOnce 33 | annotations: {} 34 | size: 2Gi 35 | storageClass: "" 36 | 37 | image: 38 | repository: ghcr.io/hyperledger/firefly-evmconnect 39 | pullPolicy: IfNotPresent 40 | tag: "v1.3.20" 41 | 42 | # see https://github.com/hyperledger/firefly-evmconnect/blob/main/config.md for more info 43 | config: 44 | jsonRpcUrl: "" 45 | 46 | log: 47 | level: debug 48 | jsonEnabled: false 49 | 50 | confirmations: 51 | required: 0 52 | # blockQueueLength: 50 53 | # staleReceiptTimeout: 1m 54 | # notificationQueueLength: 50 55 | 56 | persistence: 57 | type: leveldb 58 | leveldb: 59 | maxHandles: 100 60 | syncWrites: false 61 | templateOverride: "" 62 | 63 | connector: | 64 | url: {{ .Values.config.jsonRpcUrl | quote }} 65 | 66 | policyEngine: "" 67 | 68 | policyLoop: {} 69 | 70 | transactions: {} 71 | 72 | webhooks: {} 73 | 74 | eventstreams: {} 75 | -------------------------------------------------------------------------------- /charts/firefly-signer/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: firefly-signer 3 | description: | 4 | A Helm chart for deploying the FireFly Signer microservice to Kubernetes 5 | type: application 6 | 7 | # Generally we follow this practice for updates to the chart version number: 8 | # - Significant changes to the structure or purpose of the chart (major version update) 9 | # - FireFly Signer major release (minor version update) 10 | # - Smaller release and updates (patch version updates) 11 | version: 0.8.0 12 | appVersion: "1.1.17" 13 | 14 | maintainers: 15 | - name: EnriqueL8 16 | email: enrique.lacal@kaleido.io 17 | - name: onelapahead 18 | email: hayden.fuss@kaleido.io 19 | -------------------------------------------------------------------------------- /charts/firefly-signer/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "firefly-signer.name" -}} 5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 | {{- end }} 7 | 8 | {{/* 9 | Create a default fully qualified app name. 10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 11 | If release name contains chart name it will be used as a full name. 12 | */}} 13 | {{- define "firefly-signer.fullname" -}} 14 | {{- if .Values.fullnameOverride }} 15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 16 | {{- else }} 17 | {{- $name := default .Chart.Name .Values.nameOverride }} 18 | {{- if contains $name .Release.Name }} 19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 20 | {{- else }} 21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{/* 27 | Create chart name and version as used by the chart label. 28 | */}} 29 | {{- define "firefly-signer.chart" -}} 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 31 | {{- end }} 32 | 33 | {{/* 34 | Common labels 35 | */}} 36 | {{- define "firefly-signer.labels" -}} 37 | helm.sh/chart: {{ include "firefly-signer.chart" . }} 38 | {{ include "firefly-signer.selectorLabels" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} 43 | {{- end }} 44 | 45 | {{/* 46 | Selector labels 47 | */}} 48 | {{- define "firefly-signer.selectorLabels" -}} 49 | app.kubernetes.io/name: {{ include "firefly-signer.name" . }} 50 | app.kubernetes.io/instance: {{ .Release.Name }} 51 | app.kubernetes.io/component: evmconnect 52 | {{- end }} 53 | -------------------------------------------------------------------------------- /charts/firefly-signer/templates/ethsigner.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.signer.enabled }} 20 | apiVersion: v1 21 | kind: Secret 22 | metadata: 23 | name: {{ include "firefly-signer.fullname" . }}-config 24 | labels: 25 | {{- include "firefly-signer.labels" . | nindent 4 }} 26 | stringData: 27 | config.yaml: |- 28 | server: 29 | port: 8545 30 | address: 0.0.0.0 31 | backend: 32 | chainId: {{ .Values.backend.chainId }} 33 | url: {{ .Values.backend.url }} 34 | fileWallet: 35 | path: /data/keystore 36 | filenames: 37 | primaryExt: .toml 38 | metadata: 39 | format: toml 40 | keyFileProperty: '{{ "{{" }} index .signing "key-file" {{ "}}" }}' 41 | passwordFileProperty: '{{ "{{" }} index .signing "password-file" {{ "}}" }}' 42 | log: 43 | level: debug 44 | {{- end }} 45 | -------------------------------------------------------------------------------- /charts/firefly-signer/templates/keystore.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.signer.enabled }} 20 | apiVersion: v1 21 | kind: Secret 22 | metadata: 23 | name: {{ include "firefly-signer.fullname" . }}-keystore 24 | labels: 25 | {{- include "firefly-signer.labels" . | nindent 4 }} 26 | stringData: 27 | 75a99473917701038e854ef6999c76cd947c9f9e: |- 28 | {"address":"75a99473917701038e854ef6999c76cd947c9f9e","id":"8cfd0d87-b5ac-45a4-acb9-55f5b2b9bb2e","version":3,"crypto":{"cipher":"aes-128-ctr","ciphertext":"72c8d1f61787f7b1455d7e081edd72d7e1f41f503f363cb7afe08634c10bcd09","cipherparams":{"iv":"8731e724016127b91cf013bc0b4f7f82"},"kdf":"scrypt","mac":"af4de886e6a7e22beefbeaea213e621f00ebca859528c7d474635850800a8de6","kdfparams":{"dklen":32,"n":1024,"p":1,"r":8,"salt":"b1e3901cfe16ed73c538e1adaef5c584ea3b0a405ec1dd1c8776e55c3385c27b"}}} 29 | 75a99473917701038e854ef6999c76cd947c9f9e.toml: |- 30 | [metadata] 31 | createdAt = 2019-11-05T08:15:30-05:00 32 | description = "File based configuration" 33 | 34 | [signing] 35 | type = "file-based-signer" 36 | key-file = "/data/keystore/75a99473917701038e854ef6999c76cd947c9f9e" 37 | password-file = "/data/password" 38 | password: correcthorsebatterystaple 39 | 40 | 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /charts/firefly-signer/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: {{ include "firefly-signer.fullname" . }} 23 | labels: 24 | {{- include "firefly-signer.labels" . | nindent 4 }} 25 | spec: 26 | type: {{ .Values.service.type }} 27 | ports: 28 | - port: {{ .Values.service.port }} 29 | targetPort: http 30 | protocol: TCP 31 | name: http 32 | selector: 33 | {{- include "firefly-signer.selectorLabels" . | nindent 4 }} 34 | -------------------------------------------------------------------------------- /charts/firefly-signer/templates/statefulset.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: apps/v1 20 | kind: StatefulSet 21 | metadata: 22 | name: {{ include "firefly-signer.fullname" . }} 23 | labels: 24 | {{- include "firefly-signer.labels" . | nindent 4 }} 25 | spec: 26 | replicas: 1 27 | serviceName: {{ include "firefly-signer.fullname" . }} 28 | updateStrategy: 29 | type: RollingUpdate 30 | selector: 31 | matchLabels: 32 | {{- include "firefly-signer.selectorLabels" . | nindent 6 }} 33 | template: 34 | metadata: 35 | annotations: 36 | checksum/config: {{ include (print $.Template.BasePath "/ethsigner.yaml") . | sha256sum }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | labels: 41 | {{- include "firefly-signer.selectorLabels" . | nindent 8 }} 42 | spec: 43 | {{- with .Values.imagePullSecrets }} 44 | imagePullSecrets: 45 | {{- toYaml . | nindent 8 }} 46 | {{- end }} 47 | securityContext: 48 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 49 | {{- if .Values.initContainers }} 50 | initContainers: 51 | {{- tpl .Values.initContainers . | nindent 8 }} 52 | {{- end }} 53 | containers: 54 | - name: signer 55 | securityContext: 56 | {{- toYaml .Values.securityContext | nindent 12 }} 57 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}" 58 | imagePullPolicy: {{ .Values.image.pullPolicy }} 59 | args: 60 | - -f 61 | - /etc/signer/config.yaml 62 | {{- if .Values.extraEnv }} 63 | env: 64 | {{- toYaml .Values.extraEnv | nindent 12 }} 65 | {{- end }} 66 | ports: 67 | - name: http 68 | containerPort: {{ .Values.service.port }} 69 | protocol: TCP 70 | livenessProbe: 71 | tcpSocket: 72 | port: http 73 | initialDelaySeconds: 5 74 | failureThreshold: 5 75 | successThreshold: 1 76 | periodSeconds: 5 77 | readinessProbe: 78 | tcpSocket: 79 | port: http 80 | initialDelaySeconds: 5 81 | failureThreshold: 10 82 | successThreshold: 3 83 | periodSeconds: 3 84 | resources: 85 | {{- toYaml .Values.resources | nindent 12 }} 86 | volumeMounts: 87 | - mountPath: /etc/signer/config.yaml 88 | name: config 89 | subPath: config.yaml 90 | - mountPath: /data/keystore/75a99473917701038e854ef6999c76cd947c9f9e 91 | name: keystore 92 | subPath: 75a99473917701038e854ef6999c76cd947c9f9e 93 | - mountPath: /data/keystore/75a99473917701038e854ef6999c76cd947c9f9e.toml 94 | name: keystore 95 | subPath: 75a99473917701038e854ef6999c76cd947c9f9e.toml 96 | - mountPath: /data/password 97 | name: keystore 98 | subPath: password 99 | {{- if .Values.extraContainers }} 100 | {{- tpl .Values.extraContainers . | nindent 8 }} 101 | {{- end }} 102 | {{- with .Values.nodeSelector }} 103 | nodeSelector: 104 | {{- toYaml . | nindent 8 }} 105 | {{- end }} 106 | {{- with .Values.affinity }} 107 | affinity: 108 | {{- toYaml . | nindent 8 }} 109 | {{- end }} 110 | {{- with .Values.tolerations }} 111 | tolerations: 112 | {{- toYaml . | nindent 8 }} 113 | {{- end }} 114 | volumes: 115 | - name: config 116 | secret: 117 | secretName: {{ include "firefly-signer.fullname" . }}-config 118 | - name: keystore 119 | secret: 120 | secretName: {{ include "firefly-signer.fullname" . }}-keystore -------------------------------------------------------------------------------- /charts/firefly-signer/values.yaml: -------------------------------------------------------------------------------- 1 | image: 2 | repository: ghcr.io/hyperledger/firefly-signer 3 | pullPolicy: IfNotPresent 4 | tag: "v1.1.20" 5 | 6 | backend: 7 | url: http://besu-node-validator-1.default.svc.cluster.local:8545 8 | chainId: 1337 9 | 10 | signer: 11 | enabled: true 12 | 13 | service: 14 | type: ClusterIP 15 | port: 8545 16 | -------------------------------------------------------------------------------- /charts/firefly/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | ci/ -------------------------------------------------------------------------------- /charts/firefly/Chart.lock: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: firefly-evmconnect 3 | repository: file://../firefly-evmconnect 4 | version: 0.7.0 5 | digest: sha256:e4ad97fde4a1472e88883da2be6f294b548988730525a8dccdce5ea3e5a7f371 6 | generated: "2024-03-07T16:00:27.196626-05:00" 7 | -------------------------------------------------------------------------------- /charts/firefly/Chart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright © 2024 Kaleido, Inc. 2 | # 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://swww.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | apiVersion: v2 18 | name: firefly 19 | description: | 20 | A Helm chart for deploying FireFly and its various plugin microservices onto Kubernetes. 21 | By default allows the user to deploy FireFly with a single multi-party namespace, with the 22 | ability to template additional multi-party or gateway namespaces. 23 | type: application 24 | 25 | appVersion: "1.3.3" 26 | 27 | # Generally we follow this practice for updates to the chart version number: 28 | # - Significant changes to the structure or purpose of the chart (major version update) 29 | # - FireFly major release (minor version update) 30 | # - Smaller release and updates (patch version updates) 31 | # 32 | # For example, a release of FireFly like 1.3.1 -> 1.3.2 would correlate to a patch version 33 | # update, whereas a change like 1.2.2 -> 1.3.0 would be a minor version update. 34 | version: "0.9.1" 35 | 36 | maintainers: 37 | - name: onelapahead 38 | email: hayden.fuss@kaleido.io 39 | - name: peterbroadhurst 40 | email: peter.broadhurst@kaleido.io 41 | - name: calbritt 42 | email: cari.albritton@kaleido.io 43 | 44 | dependencies: 45 | - name: firefly-evmconnect 46 | repository: "file://../firefly-evmconnect" 47 | alias: evmconnect 48 | condition: evmconnect.enabled 49 | version: "0.8.1" 50 | -------------------------------------------------------------------------------- /charts/firefly/ci/database-override-values.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | debugEnabled: true 3 | adminEnabled: true 4 | metricsEnabled: true 5 | preInit: true 6 | 7 | organizationName: "firefly-os" 8 | organizationKey: "0xeb7284ce905e0665b7d42cabe31c76c45da1d331" 9 | fireflyContractAddress: "0xeb7284ce905e0665b7d42cabe31c76c45da1d254" 10 | 11 | ethconnectUrl: "http://ethconnect.firefly-os" 12 | 13 | ipfsApiUrl: "http://ipfs.firefly-os:5001" 14 | ipfsGatewayUrl: "http://ipfs.firefly-os:8080" 15 | 16 | databaseOverride: |- 17 | type: postgres 18 | postgres: 19 | migrations: 20 | auto: false 21 | 22 | core: 23 | extraEnv: 24 | - name: FIREFLY_DATABASE_POSTGRES_URL 25 | valueFrom: 26 | secretKeyRef: 27 | name: custom-psql-config 28 | key: url 29 | jobs: 30 | postgresMigrations: 31 | enabled: true 32 | extraEnv: 33 | - name: PSQL_URL 34 | valueFrom: 35 | secretKeyRef: 36 | name: custom-psql-config 37 | key: url 38 | 39 | metrics: 40 | serviceMonitor: 41 | enabled: true 42 | 43 | dataexchange: 44 | certificate: 45 | enabled: true 46 | issuerRef: 47 | kind: ClusterIssuer 48 | name: selfsigned-ca 49 | 50 | tlsSecret: 51 | enabled: false 52 | -------------------------------------------------------------------------------- /charts/firefly/ci/eth-values.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | debugEnabled: true 3 | adminEnabled: true 4 | metricsEnabled: true 5 | preInit: true 6 | 7 | organizationName: "firefly-os" 8 | organizationKey: "0xeb7284ce905e0665b7d42cabe31c76c45da1d331" 9 | fireflyContractAddress: "0xeb7284ce905e0665b7d42cabe31c76c45da1d254" 10 | 11 | ethconnectUrl: "http://ethconnect.firefly-os" 12 | 13 | postgresUrl: "postgres://postgres:firef1y@postgresql.default.svc:5432?sslmode=disable" 14 | postgresAutomigrate: true 15 | 16 | ipfsApiUrl: "http://ipfs.firefly-os:5001" 17 | ipfsGatewayUrl: "http://ipfs.firefly-os:8080" 18 | 19 | addresssResolverUrlTemplate: "http://address-resolver.firefly-os/wallets/{{.Key}}" 20 | 21 | core: 22 | metrics: 23 | serviceMonitor: 24 | enabled: true 25 | 26 | dataexchange: 27 | certificate: 28 | enabled: true 29 | issuerRef: 30 | kind: ClusterIssuer 31 | name: selfsigned-ca 32 | 33 | tlsSecret: 34 | enabled: false 35 | -------------------------------------------------------------------------------- /charts/firefly/ci/fab-values.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | debugEnabled: true 3 | adminEnabled: true 4 | preInit: true 5 | 6 | organizationName: "firefly-os" 7 | organizationKey: "firefly-os" 8 | 9 | fabconnectUrl: "http://fabconnect.firefly-os" 10 | 11 | postgresUrl: "postgres://postgres:firef1y@postgresql.default.svc:5432?sslmode=disable" 12 | postgresAutomigrate: true 13 | 14 | ipfsApiUrl: "http://ipfs.firefly-os:5001" 15 | ipfsGatewayUrl: "http://ipfs.firefly-os:8080" 16 | 17 | dataexchange: 18 | certificate: 19 | enabled: true 20 | issuerRef: 21 | kind: ClusterIssuer 22 | name: selfsigned-ca 23 | 24 | tlsSecret: 25 | enabled: false 26 | -------------------------------------------------------------------------------- /charts/firefly/ci/mtls-values.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | debugEnabled: true 3 | adminEnabled: true 4 | metricsEnabled: true 5 | preInit: true 6 | 7 | organizationName: "firefly-os" 8 | organizationKey: "0xeb7284ce905e0665b7d42cabe31c76c45da1d331" 9 | fireflyContractAddress: "0xeb7284ce905e0665b7d42cabe31c76c45da1d254" 10 | 11 | ethconnectUrl: "http://ethconnect.firefly-os" 12 | 13 | postgresUrl: "postgres://postgres:firef1y@postgresql.default.svc:5432?sslmode=disable" 14 | postgresAutomigrate: true 15 | 16 | ipfsApiUrl: "http://ipfs.firefly-os:5001" 17 | ipfsGatewayUrl: "http://ipfs.firefly-os:8080" 18 | 19 | addresssResolverUrlTemplate: "http://address-resolver.firefly-os/wallets/{{.Key}}" 20 | 21 | httpTls: 22 | caFile: /etc/pki/internal/ca.crt 23 | certFile: /etc/pki/internal/tls.crt 24 | keyFile: /etc/pki/internal/tls.key 25 | enabled: true 26 | clientAuth: true 27 | 28 | core: 29 | metrics: 30 | serviceMonitor: 31 | enabled: true 32 | 33 | extraVolumeMounts: | 34 | - name: firefly-mtls 35 | mountPath: /etc/pki/internal/ 36 | 37 | extraVolumes: | 38 | - name: firefly-mtls 39 | secret: 40 | secretName: firefly-mtls-tls 41 | 42 | dataexchange: 43 | certificate: 44 | enabled: true 45 | issuerRef: 46 | kind: ClusterIssuer 47 | name: selfsigned-ca 48 | 49 | tlsSecret: 50 | enabled: false -------------------------------------------------------------------------------- /charts/firefly/contracts/firefly.json: -------------------------------------------------------------------------------- 1 | { 2 | "abi": [ 3 | { 4 | "anonymous": false, 5 | "inputs": [ 6 | { 7 | "indexed": false, 8 | "internalType": "address", 9 | "name": "author", 10 | "type": "address" 11 | }, 12 | { 13 | "indexed": false, 14 | "internalType": "uint256", 15 | "name": "timestamp", 16 | "type": "uint256" 17 | }, 18 | { 19 | "indexed": false, 20 | "internalType": "string", 21 | "name": "namespace", 22 | "type": "string" 23 | }, 24 | { 25 | "indexed": false, 26 | "internalType": "bytes32", 27 | "name": "uuids", 28 | "type": "bytes32" 29 | }, 30 | { 31 | "indexed": false, 32 | "internalType": "bytes32", 33 | "name": "batchHash", 34 | "type": "bytes32" 35 | }, 36 | { 37 | "indexed": false, 38 | "internalType": "string", 39 | "name": "payloadRef", 40 | "type": "string" 41 | }, 42 | { 43 | "indexed": false, 44 | "internalType": "bytes32[]", 45 | "name": "contexts", 46 | "type": "bytes32[]" 47 | } 48 | ], 49 | "name": "BatchPin", 50 | "type": "event" 51 | }, 52 | { 53 | "inputs": [ 54 | { 55 | "internalType": "string", 56 | "name": "namespace", 57 | "type": "string" 58 | }, 59 | { 60 | "internalType": "bytes32", 61 | "name": "uuids", 62 | "type": "bytes32" 63 | }, 64 | { 65 | "internalType": "bytes32", 66 | "name": "batchHash", 67 | "type": "bytes32" 68 | }, 69 | { 70 | "internalType": "string", 71 | "name": "payloadRef", 72 | "type": "string" 73 | }, 74 | { 75 | "internalType": "bytes32[]", 76 | "name": "contexts", 77 | "type": "bytes32[]" 78 | } 79 | ], 80 | "name": "pinBatch", 81 | "outputs": [], 82 | "stateMutability": "nonpayable", 83 | "type": "function" 84 | } 85 | ], 86 | "bytecode": "0x608060405234801561001057600080fd5b506103ef806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c80633674e15c14610030575b600080fd5b610228600480360360a081101561004657600080fd5b810190808035906020019064010000000081111561006357600080fd5b82018360208201111561007557600080fd5b8035906020019184600183028401116401000000008311171561009757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190803590602001909291908035906020019064010000000081111561010e57600080fd5b82018360208201111561012057600080fd5b8035906020019184600183028401116401000000008311171561014257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101a557600080fd5b8201836020820111156101b757600080fd5b803590602001918460208302840111640100000000831117156101d957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061022a565b005b7f805721bc246bccc732581be0c0aa2dd8f7ec93e97ba4b307be84428c98b0a12f33428787878787604051808873ffffffffffffffffffffffffffffffffffffffff168152602001878152602001806020018681526020018581526020018060200180602001848103845289818151815260200191508051906020019080838360005b838110156102c85780820151818401526020810190506102ad565b50505050905090810190601f1680156102f55780820380516001836020036101000a031916815260200191505b50848103835286818151815260200191508051906020019080838360005b8381101561032e578082015181840152602081019050610313565b50505050905090810190601f16801561035b5780820380516001836020036101000a031916815260200191505b50848103825285818151815260200191508051906020019060200280838360005b8381101561039757808201518184015260208101905061037c565b505050509050019a505050505050505050505060405180910390a1505050505056fea26469706673582212206f68bd7aadfa7ce49bc9ae969928ac075d5f54d8b13c581d17a917c7cb3508ab64736f6c63430007060033" 87 | } 88 | -------------------------------------------------------------------------------- /charts/firefly/local-kind-values.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | debugEnabled: true 3 | adminEnabled: true 4 | metricsEnabled: true 5 | preInit: true 6 | multipartyEnabled: false 7 | 8 | organizationName: "exampleOrg" 9 | organizationKey: "0x75a99473917701038e854ef6999c76cd947c9f9e" 10 | 11 | ethconnectUrl: "http://firefly-evmconnect:5000" 12 | 13 | postgresUrl: "postgres://postgres:firef1y@postgresql.default.svc:5432?sslmode=disable" 14 | postgresAutomigrate: true 15 | 16 | ipfsApiUrl: "http://ipfs-ipfs:5001" 17 | ipfsGatewayUrl: "http://ipfs-ipfs:8080" 18 | 19 | core: 20 | metrics: 21 | serviceMonitor: 22 | enabled: false 23 | 24 | dataexchange: 25 | certificate: 26 | enabled: true 27 | issuerRef: 28 | kind: ClusterIssuer 29 | name: selfsigned-ca 30 | 31 | tlsSecret: 32 | enabled: false 33 | 34 | signer: 35 | enabled: true 36 | 37 | evmconnect: 38 | enabled: true 39 | image: 40 | tag: v1.3.20 41 | config: 42 | jsonRpcUrl: "http://firefly-signer:8545" 43 | policyEngine: | 44 | policyengine.simple: 45 | fixedGasPrice: "0" 46 | resubmitInterval: 5m 47 | gasOracle: 48 | mode: fixed 49 | -------------------------------------------------------------------------------- /charts/firefly/scripts/ff-db-migrations.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright © 2024 Kaleido, Inc. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://swww.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # Extract the database name from the end of the PSQL URL, and check it's there 20 | DB_PARAMS=`echo ${PSQL_URL} | sed 's!^.*/!!'` 21 | DB_NAME=`echo ${DB_PARAMS} | sed 's!?.*!!'` 22 | echo "Database name: '${DB_NAME}'" 23 | USER_NAME=`echo ${PSQL_URL} | sed 's!^.*//!!' | sed 's!:.*$!!'` 24 | echo "Username: '${USER_NAME}'" 25 | COLONS=`echo -n $DB_NAME | sed 's/[^:]//g'` 26 | if [ -z "${DB_NAME}" ] || [ -n "${COLONS}" ] 27 | then 28 | echo "Error: Postgres URL does not appear to contain a database name (required)." 29 | exit 1 30 | fi 31 | 32 | # Check we can connect to the PSQL server using the default "postgres" database 33 | PSQL_SERVER=`echo ${PSQL_URL} | sed "s!${DB_PARAMS}!!"`postgres 34 | until psql -c "SELECT 1;" ${PSQL_SERVER}; do 35 | echo "Waiting for PSQL server connection..." 36 | sleep 1 37 | done 38 | 39 | # Create the database if it doesn't exist 40 | if ! psql -c "SELECT datname FROM pg_database WHERE datname = '${DB_NAME}';" ${PSQL_SERVER} | grep ${DB_NAME} 41 | then 42 | echo "Database '${DB_NAME}' does not exist; creating." 43 | psql -c "CREATE DATABASE \"${DB_NAME}\" WITH OWNER \"${USER_NAME}\";" ${PSQL_SERVER} 44 | fi 45 | 46 | # Wait for the database itself to be available 47 | until psql -c "SELECT 1;" ${PSQL_URL}; do 48 | echo "Waiting for database..." 49 | sleep 1 50 | done 51 | 52 | # Do the migrations 53 | migrate -database ${PSQL_URL} -path db/migrations/postgres up 54 | -------------------------------------------------------------------------------- /charts/firefly/scripts/ff-deploy-erc20-erc721-contracts/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | // Copyright © 2024 Kaleido, Inc. 4 | // 5 | // SPDX-License-Identifier: Apache-2.0 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); 8 | // you may not use this file except in compliance with the License. 9 | // You may obtain a copy of the License at 10 | // 11 | // http://swww.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, 15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | // See the License for the specific language governing permissions and 17 | // limitations under the License. 18 | 19 | const axios = require('axios'); 20 | 21 | const erc20ContractJson = require('/root/solidity/build/contracts/ERC20WithData.json'); 22 | const erc721ContractJson = require('/root/solidity/build/contracts/ERC721WithData.json'); 23 | 24 | const deployContracts = async () => { 25 | let FormData = require("form-data"); 26 | const ETHCONNECT_BASE_URL = process.env.ETHCONNECT_URL; 27 | const ETHCONNECT_PREFIX = process.env.ETHCONNECT_PREFIX || "firefly"; 28 | const ABIS_URI = process.env.ABIS_URI || "/abis"; 29 | const CONTRACTS_URI = process.env.CONTRACTS_URI || "/contracts"; 30 | 31 | // does not currently support using an address resolver to look up the wallet address i.e. must be in hex format 32 | const TOKENS_OWNER_KEY = process.env.TOKENS_OWNER_KEY; 33 | 34 | const ERC20_ENABLED = process.env.ERC20_ENABLED === "true"; 35 | const ERC20_TOKEN_NAME = process.env.ERC20_TOKEN_NAME; 36 | 37 | const ERC721_ENABLED = process.env.ERC721_ENABLED === "true"; 38 | const ERC721_TOKEN_NAME = process.env.ERC721_TOKEN_NAME; 39 | 40 | async function deployTokenContract(jsonLink, tokenName) { 41 | const abi = jsonLink.abi; 42 | const byteCode = jsonLink.bytecode; 43 | 44 | // POST /abis 45 | const bodyFormData = new FormData(); 46 | bodyFormData.append("abi", JSON.stringify(abi)); 47 | bodyFormData.append("bytecode", byteCode); 48 | console.log(`POST ${ETHCONNECT_BASE_URL}${ABIS_URI} with abi/bytecode form data`); 49 | const abiRes = await axios 50 | .post(`${ETHCONNECT_BASE_URL}${ABIS_URI}`, bodyFormData, { 51 | headers: bodyFormData.getHeaders(), 52 | }) 53 | .catch((err) => { 54 | throw `Error in POST ${ETHCONNECT_BASE_URL}${ABIS_URI} with form data. ${err}`; 55 | }); 56 | 57 | console.log("Sleeping 10s for sync..."); 58 | await new Promise((f) => setTimeout(f, 10000)); 59 | 60 | // POST /abis/ 61 | console.log(`POST ${ETHCONNECT_BASE_URL}${ABIS_URI}/${abiRes.data.id}`); 62 | const contractRes = await axios 63 | .post( 64 | `${ETHCONNECT_BASE_URL}${ABIS_URI}/${abiRes.data.id}`, 65 | JSON.stringify({ 66 | name: tokenName, 67 | symbol: tokenName, 68 | }), 69 | { 70 | headers: { 71 | accept: "application/json", 72 | "Content-Type": "application/json", 73 | [`x-${ETHCONNECT_PREFIX}-from`]: TOKENS_OWNER_KEY, 74 | }, 75 | } 76 | ) 77 | .catch((err) => { 78 | throw `Error in POST ${ETHCONNECT_BASE_URL}${ABIS_URI}/${abiRes.data.id}. ${err}`; 79 | }); 80 | 81 | console.log("Sleeping 10s for sync..."); 82 | await new Promise((f) => setTimeout(f, 10000)); 83 | 84 | console.log(`GET ${ETHCONNECT_BASE_URL}${CONTRACTS_URI}`); 85 | const contracts = await axios 86 | .get(`${ETHCONNECT_BASE_URL}${CONTRACTS_URI}`, { 87 | headers: { 88 | accept: "application/json", 89 | "Content-Type": "application/json", 90 | }, 91 | }) 92 | .catch((err) => { 93 | console.log(`Error in GET ${ETHCONNECT_BASE_URL}${CONTRACTS_URI}. ${err}`); 94 | }); 95 | 96 | const contract = contracts.data.filter(contract => contract.abi === abiRes.data.id)[0]; 97 | 98 | return { 99 | address: `0x${contract.address}`, 100 | abiId: abiRes.data.id 101 | }; 102 | } 103 | 104 | 105 | console.log("\n\n"); 106 | 107 | if (ERC20_ENABLED) { 108 | const erc20Contract = await deployTokenContract(erc20ContractJson, ERC20_TOKEN_NAME); 109 | console.log("ERC20"); 110 | console.log(`\tAddress: ${erc20Contract.address}`); 111 | console.log(`\tABI ID: ${erc20Contract.abiId}\n`); 112 | } 113 | 114 | if (ERC721_ENABLED) { 115 | const erc721Contract = await deployTokenContract(erc721ContractJson, ERC721_TOKEN_NAME); 116 | console.log("ERC721"); 117 | console.log(`\tAddress: ${erc721Contract.address}`); 118 | console.log(`\tABI ID: ${erc721Contract.abiId}\n`); 119 | } 120 | }; 121 | 122 | (async () => { 123 | try { 124 | await deployContracts(); 125 | } catch (e) { 126 | console.error(`Failed to deploy contracts due to: ${e}`); 127 | process.exit(1); 128 | } 129 | })(); 130 | -------------------------------------------------------------------------------- /charts/firefly/scripts/ff-deploy-erc20-erc721-contracts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ff-deploy-erc20-erc721-contracts", 3 | "version": "0.1.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "private": true, 10 | "author": "", 11 | "license": "Apache-2.0", 12 | "dependencies": { 13 | "axios": "^0.25.0", 14 | "form-data": "^4.0.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /charts/firefly/scripts/ff-register-contracts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright © 2024 Kaleido, Inc. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://swww.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | set -e 20 | 21 | until STATUS=$(curl --fail -s ${ETHCONNECT_URL}/contracts); do 22 | echo "Waiting for Ethconnect..." 23 | sleep 5 24 | done 25 | 26 | # This script does the following for each pre-deployed contract: 27 | ## PublishABI 28 | ## POST /abis 29 | ## then 30 | ## RegisterContract 31 | ## POST /abis/{id}/{address} 32 | 33 | # NOTE: ERC20 is special since theres a pre-deployed Factory contract and then the ERC20 contract itself which must be published but not deployed 34 | 35 | # FF contract 36 | 37 | if ! curl --fail -s "${ETHCONNECT_URL}/contracts/${FIREFLY_CONTRACT_ADDRESS}"; then 38 | echo "[${FIREFLY_CONTRACT_ADDRESS}] has not been registered for the FireFly contract, registering now..." 39 | publishResponse=$(curl -s --fail -F "abi=$(cat /var/lib/ethconnect/contracts/firefly.json | jq -r '.abi')" -F bytecode=$(cat /var/lib/ethconnect/contracts/firefly.json | jq -r '.bytecode') "${ETHCONNECT_URL}/abis") 40 | curl -s --fail -H "Content-Type: application/json" -X POST -H "x-${ETHCONNECT_PREFIX}-sync: true" -H "x-${ETHCONNECT_PREFIX}-register: firefly" "${ETHCONNECT_URL}$(echo -n $publishResponse | jq -r .path)/${FIREFLY_CONTRACT_ADDRESS}" 41 | else 42 | echo "[${FIREFLY_CONTRACT_ADDRESS}] is already registered for the FireFly contract." 43 | fi 44 | 45 | 46 | # ERC1155 contract 47 | if [[ "${FIREFLY_ERC1155_ENABLED}" == "true" ]]; then 48 | 49 | if ! curl --fail -s "${ETHCONNECT_URL}/contracts/${FIREFLY_ERC1155_CONTRACT_ADDRESS}"; then 50 | # publish and register ERC1155 51 | echo "[${FIREFLY_ERC1155_CONTRACT_ADDRESS}] has not been registered for the FireFly ERC1155 contract, registering now..." 52 | publishResponse=$(curl -s --fail -F "abi=$(cat /var/lib/ethconnect/contracts/erc1155.json | jq -r '.abi')" -F bytecode=$(cat /var/lib/ethconnect/contracts/erc1155.json | jq -r '.bytecode') "${ETHCONNECT_URL}/abis") 53 | curl -s --fail -H "Content-Type: application/json" -X POST -H "x-${ETHCONNECT_PREFIX}-sync: true" -H "x-${ETHCONNECT_PREFIX}-register: firefly-erc1155" "${ETHCONNECT_URL}$(echo -n $publishResponse | jq -r .path)/${FIREFLY_ERC1155_CONTRACT_ADDRESS}" 54 | else 55 | echo "[${FIREFLY_ERC1155_CONTRACT_ADDRESS}] is already registered for the FireFly ERC1155 contract." 56 | fi 57 | fi 58 | -------------------------------------------------------------------------------- /charts/firefly/scripts/ff-registration.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Copyright © 2024 Kaleido, Inc. 4 | # 5 | # SPDX-License-Identifier: Apache-2.0 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://swww.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | for n in $FF_NAMESPACES; do 20 | until STATUS=$(curl ${FF_URL}/api/v1/namespaces/${n}/status -s); do 21 | echo "Waiting for FireFly..." 22 | sleep 5 23 | done 24 | 25 | if [ `echo $STATUS | jq -r .org.registered` != "true" ]; then 26 | 27 | echo "Registering organization" 28 | HTTP_CODE=`curl --silent --output /dev/stderr --write-out "%{http_code}" \ 29 | -X POST -d '{}' -H 'Content-Type: application/json' \ 30 | "${FF_URL}/api/v1/namespaces/${n}/network/organizations/self?confirm"` 31 | if [ "$HTTP_CODE" -ne 200 ]; then 32 | echo "Failed to register with code ${HTTP_CODE}" 33 | exit 1 34 | fi 35 | 36 | else 37 | 38 | echo "Org already registered." 39 | 40 | fi 41 | 42 | if [ `echo $STATUS | jq -r .node.registered` != "true" ]; then 43 | 44 | echo "Registering node" 45 | HTTP_CODE=`curl --silent --output /dev/stderr --write-out "%{http_code}" \ 46 | -X POST -d '{}' -H 'Content-Type: application/json' \ 47 | "${FF_URL}/api/v1/namespaces/${n}/network/nodes/self?confirm"` 48 | if [ "$HTTP_CODE" -ne 200 ]; then 49 | echo "Failed to register with code ${HTTP_CODE}" 50 | exit 1 51 | fi 52 | 53 | else 54 | 55 | echo "Node already registered." 56 | 57 | fi 58 | done 59 | -------------------------------------------------------------------------------- /charts/firefly/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | 1. Get the FireFly URL by running these commands: 2 | {{- if .Values.core.ingress.enabled }} 3 | {{- $host := index .Values.core.ingress.hosts 0 }} 4 | export FF_URL="http{{ if $.Values.core.ingress.tls }}s{{ end }}://{{ $host.host }}" 5 | {{- else if contains "NodePort" .Values.core.service.type }} 6 | export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "firefly.fullname" . }}) 7 | export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") 8 | export FF_URL="http://$NODE_IP:$NODE_PORT" 9 | {{- else if contains "LoadBalancer" .Values.core.service.type }} 10 | NOTE: It may take a few minutes for the LoadBalancer IP to be available. 11 | You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "firefly.fullname" . }}' 12 | export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "firefly.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") 13 | export FF_URL="http://$SERVICE_IP:{{ .Values.core.service.httpPort }}" 14 | {{- else if contains "ClusterIP" .Values.core.service.type }} 15 | export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "firefly.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") 16 | export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") 17 | export FF_URL="http://127.0.0.1:8080" 18 | kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT & 19 | {{- end }} 20 | echo "Visit $FF_URL/api to explore the API via Swagger" 21 | echo "Visit $FF_URL/ui to use explorer UI" 22 | 2. Assuming the FireFly smart contracts have been properly deployed and registered on the chain, you can register your FireFly node's organization via the API: 23 | curl -X POST -d '{}' -H 'Content-Type: application/json' $FF_URL/api/v1/network/register/node/organization 24 | 3. Wait until your organization then registered, you can confirm its registration by listing the orgs: 25 | curl -X GET $FF_URL/api/v1/network/organizations 26 | 4. Once the org is registered, you can register the node itself: 27 | curl -X POST -d '{}' -H 'Content-Type: application/json' $FF_URL/api/v1/network/register/node 28 | 5. Lastly, confirm the node has been registered: 29 | curl -X GET $FF_URL/api/v1/network/nodes 30 | -------------------------------------------------------------------------------- /charts/firefly/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{/* 20 | Expand the name of the chart. 21 | */}} 22 | {{- define "firefly.name" -}} 23 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 24 | {{- end }} 25 | 26 | {{/* 27 | Create a default fully qualified app name. 28 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 29 | If release name contains chart name it will be used as a full name. 30 | */}} 31 | {{- define "firefly.fullname" -}} 32 | {{- if .Values.fullnameOverride }} 33 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 34 | {{- else }} 35 | {{- $name := default .Chart.Name .Values.nameOverride }} 36 | {{- if contains $name .Release.Name }} 37 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 38 | {{- else }} 39 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 40 | {{- end }} 41 | {{- end }} 42 | {{- end }} 43 | 44 | {{/* 45 | Create chart name and version as used by the chart label. 46 | */}} 47 | {{- define "firefly.chart" -}} 48 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 49 | {{- end }} 50 | 51 | {{/* 52 | Create a Firefly node name. These must be unique within their Firefly network. 53 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 54 | */}} 55 | {{- define "firefly.nodeName" -}} 56 | {{- if .Values.core.nodeNameOverride }} 57 | {{- .Values.core.nodeNameOverride | trunc 63 | trimSuffix "-" }} 58 | {{- else }} 59 | {{- printf "%s-%s" .Release.Namespace (include "firefly.fullname" .) | trunc 63 | trimSuffix "-" }} 60 | {{- end }} 61 | {{- end }} 62 | 63 | {{/* 64 | Common labels 65 | */}} 66 | {{- define "firefly.coreLabels" -}} 67 | helm.sh/chart: {{ include "firefly.chart" . }} 68 | {{ include "firefly.coreSelectorLabels" . }} 69 | {{- if .Chart.AppVersion }} 70 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 71 | {{- end }} 72 | app.kubernetes.io/managed-by: {{ .Release.Service }} 73 | app.kubernetes.io/part-of: {{ .Chart.Name }} 74 | {{- end }} 75 | 76 | {{- define "firefly.dataexchangeLabels" -}} 77 | helm.sh/chart: {{ include "firefly.chart" . }} 78 | {{ include "firefly.dataexchangeSelectorLabels" . }} 79 | {{- if .Chart.AppVersion }} 80 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 81 | {{- end }} 82 | app.kubernetes.io/managed-by: {{ .Release.Service }} 83 | app.kubernetes.io/part-of: {{ .Chart.Name }} 84 | {{- end }} 85 | 86 | {{- define "firefly.ipfsLabels" -}} 87 | helm.sh/chart: {{ include "firefly.chart" . }} 88 | {{ include "firefly.ipfsSelectorLabels" . }} 89 | {{- if .Chart.AppVersion }} 90 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 91 | {{- end }} 92 | app.kubernetes.io/managed-by: {{ .Release.Service }} 93 | app.kubernetes.io/part-of: {{ .Chart.Name }} 94 | {{- end }} 95 | 96 | {{- define "firefly.erc1155Labels" -}} 97 | helm.sh/chart: {{ include "firefly.chart" . }} 98 | {{ include "firefly.erc1155SelectorLabels" . }} 99 | {{- if .Chart.AppVersion }} 100 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 101 | {{- end }} 102 | app.kubernetes.io/managed-by: {{ .Release.Service }} 103 | app.kubernetes.io/part-of: {{ .Chart.Name }} 104 | {{- end }} 105 | 106 | {{- define "firefly.erc20erc721Labels" -}} 107 | helm.sh/chart: {{ include "firefly.chart" . }} 108 | {{ include "firefly.erc20erc721SelectorLabels" . }} 109 | {{- if .Chart.AppVersion }} 110 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 111 | {{- end }} 112 | app.kubernetes.io/managed-by: {{ .Release.Service }} 113 | app.kubernetes.io/part-of: {{ .Chart.Name }} 114 | {{- end }} 115 | 116 | {{- define "firefly.sandboxLabels" -}} 117 | helm.sh/chart: {{ include "firefly.chart" . }} 118 | {{ include "firefly.sandboxSelectorLabels" . }} 119 | {{- if .Chart.AppVersion }} 120 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 121 | {{- end }} 122 | app.kubernetes.io/managed-by: {{ .Release.Service }} 123 | app.kubernetes.io/part-of: {{ .Chart.Name }} 124 | {{- end }} 125 | 126 | {{- define "firefly.ethconnectLabels" -}} 127 | helm.sh/chart: {{ include "firefly.chart" . }} 128 | {{ include "firefly.ethconnectSelectorLabels" . }} 129 | {{- if .Chart.AppVersion }} 130 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 131 | {{- end }} 132 | app.kubernetes.io/managed-by: {{ .Release.Service }} 133 | app.kubernetes.io/part-of: {{ .Chart.Name }} 134 | {{- end }} 135 | 136 | {{/* 137 | Selector labels 138 | */}} 139 | {{- define "firefly.coreSelectorLabels" -}} 140 | app.kubernetes.io/name: {{ include "firefly.name" . }} 141 | app.kubernetes.io/instance: {{ .Release.Name }} 142 | app.kubernetes.io/component: core 143 | {{- end }} 144 | 145 | {{- define "firefly.dataexchangeSelectorLabels" -}} 146 | app.kubernetes.io/name: {{ include "firefly.name" . }} 147 | app.kubernetes.io/instance: {{ .Release.Name }} 148 | app.kubernetes.io/component: dx 149 | {{- end }} 150 | 151 | {{- define "firefly.ipfsSelectorLabels" -}} 152 | app.kubernetes.io/name: {{ include "firefly.name" . }} 153 | app.kubernetes.io/instance: {{ .Release.Name }} 154 | app.kubernetes.io/component: ipfs 155 | {{- end }} 156 | 157 | {{- define "firefly.erc1155SelectorLabels" -}} 158 | app.kubernetes.io/name: {{ include "firefly.name" . }} 159 | app.kubernetes.io/instance: {{ .Release.Name }} 160 | app.kubernetes.io/component: erc1155 161 | {{- end }} 162 | 163 | {{- define "firefly.erc20erc721SelectorLabels" -}} 164 | app.kubernetes.io/name: {{ include "firefly.name" . }} 165 | app.kubernetes.io/instance: {{ .Release.Name }} 166 | app.kubernetes.io/component: erc20-erc721 167 | {{- end }} 168 | 169 | {{- define "firefly.ethconnectSelectorLabels" -}} 170 | app.kubernetes.io/name: {{ include "firefly.name" . }} 171 | app.kubernetes.io/instance: {{ .Release.Name }} 172 | app.kubernetes.io/component: ethconnect 173 | {{- end }} 174 | 175 | {{- define "firefly.sandboxSelectorLabels" -}} 176 | app.kubernetes.io/name: {{ include "firefly.name" . }} 177 | app.kubernetes.io/instance: {{ .Release.Name }} 178 | app.kubernetes.io/component: sandbox 179 | {{- end }} 180 | 181 | {{- define "firefly.ethconnectRegisterContractsJobName" -}} 182 | {{ printf "%s-%s-%s-register-contracts" (include "firefly.fullname" .) (.Values.config.organizationName | lower) .Chart.Version | trunc 63 | trimSuffix "-" }} 183 | {{- end }} 184 | 185 | {{- define "firefly.erc20erc721DeployContractsJobName" -}} 186 | {{ printf "%s-%s-%s-erc20-erc-721-deploy-contracts" (include "firefly.fullname" .) (.Values.config.organizationName | lower) .Chart.Version | trunc 63 | trimSuffix "-" }} 187 | {{- end }} 188 | 189 | {{/* 190 | Config helpers 191 | */}} 192 | {{- define "firefly.dataexchangeP2PHost" -}} 193 | {{- if .Values.dataexchange.ingress.enabled }} 194 | {{- (index .Values.dataexchange.ingress.hosts 0).host }} 195 | {{- else }} 196 | {{- printf "%s-dx.%s.svc:%d" (include "firefly.fullname" .) .Release.Namespace (.Values.dataexchange.service.p2pPort | int64) }} 197 | {{- end }} 198 | {{- end }} 199 | 200 | {{- define "firefly.coreHttpPublicURL" -}} 201 | {{- if .Values.core.ingress.enabled }} 202 | {{- if .Values.core.ingress.tls }} 203 | {{- printf "https://%s" (index .Values.core.ingress.hosts 0).host }} 204 | {{- else }} 205 | {{- printf "http://%s" (index .Values.core.ingress.hosts 0).host }} 206 | {{- end }} 207 | {{- else }} 208 | {{- printf "http://%s.%s.svc:%d" (include "firefly.fullname" .) .Release.Namespace (.Values.core.service.httpPort | int64) }} 209 | {{- end }} 210 | {{- end }} 211 | 212 | {{- define "firefly.coreAdminPublicURL" -}} 213 | {{- printf "http://%s.%s.svc:%d" (include "firefly.fullname" .) .Release.Namespace (.Values.core.service.adminPort | int64) }} 214 | {{- end }} 215 | 216 | {{- define "firefly.coreConfig" -}} 217 | {{- if .Values.config.debugEnabled }} 218 | log: 219 | level: debug 220 | debug: 221 | port: {{ .Values.core.service.debugPort }} 222 | {{- end }} 223 | http: 224 | port: {{ .Values.core.service.httpPort }} 225 | address: 0.0.0.0 226 | publicURL: {{ .Values.config.httpPublicUrl | default (include "firefly.coreHttpPublicURL" . ) }} 227 | {{- if .Values.config.httpTls }} 228 | tls: 229 | {{- toYaml .Values.config.httpTls | nindent 4 }} 230 | {{- end }} 231 | spi: 232 | port: {{ .Values.core.service.adminPort }} 233 | address: 0.0.0.0 234 | publicURL: {{ .Values.config.adminPublicUrl | default (include "firefly.coreAdminPublicURL" . ) }} 235 | enabled: {{ .Values.config.adminEnabled }} 236 | preinit: {{ and .Values.config.adminEnabled .Values.config.preInit }} 237 | metrics: 238 | enabled: {{ .Values.config.metricsEnabled }} 239 | {{- if .Values.config.metricsEnabled }} 240 | path: {{ .Values.config.metricsPath }} 241 | address: 0.0.0.0 242 | port: {{ .Values.core.service.metricsPort }} 243 | {{- end }} 244 | ui: 245 | path: ./frontend 246 | 247 | plugins: 248 | {{- if .Values.config.blockchainOverride }} 249 | blockchain: 250 | {{- tpl .Values.config.blockchainOverride . | nindent 4 }} 251 | {{- else }}{{/* if not overridden */}} 252 | blockchain: 253 | {{- if or .Values.config.ethconnectUrl .Values.ethconnect.enabled }} 254 | - name: eth0 255 | type: ethereum 256 | ethereum: 257 | ethconnect: 258 | {{ if .Values.ethconnect.enabled }} 259 | url: http://{{ include "firefly.fullname" . }}-ethconnect.{{ .Release.Namespace }}.svc:{{ .Values.ethconnect.service.apiPort }} 260 | {{ else }} 261 | url: {{ tpl .Values.config.ethconnectUrl . }} 262 | {{ end }} 263 | topic: {{ .Values.config.ethconnectTopic | quote }} 264 | retry: 265 | enable: {{ .Values.config.ethconnectRetry }} 266 | {{- if and .Values.config.ethconnectUsername .Values.config.ethconnectPassword }} 267 | auth: 268 | username: {{ .Values.config.ethconnectUsername | quote }} 269 | password: {{ .Values.config.ethconnectPassword | quote }} 270 | {{- end }} 271 | {{- if .Values.config.ethconnectPrefixShort }} 272 | prefixShort: {{ .Values.config.ethconnectPrefixShort }} 273 | {{- end }} 274 | {{- if .Values.config.ethconnectPrefixLong }} 275 | prefixLong: {{ .Values.config.ethconnectPrefixLong }} 276 | {{- end }} 277 | {{- if .Values.config.addresssResolverUrlTemplate }} 278 | addressResolver: 279 | urlTemplate: {{ .Values.config.addresssResolverUrlTemplate }} 280 | {{- end }} 281 | {{- else if .Values.evmconnect.enabled }} 282 | - name: eth0 283 | type: ethereum 284 | ethereum: 285 | ethconnect: 286 | {{- if .Values.evmconnect.enabled }} 287 | url: http://{{ include "firefly.fullname" . }}-evmconnect.{{ .Release.Namespace }}.svc:{{ .Values.evmconnect.service.port }} 288 | {{- end }} 289 | topic: {{ .Values.config.evmconnectTopic | quote }} 290 | retry: 291 | enable: {{ .Values.config.evmconnectRetry }} 292 | {{- if .Values.config.addresssResolverUrlTemplate }} 293 | addressResolver: 294 | urlTemplate: {{ .Values.config.addresssResolverUrlTemplate }} 295 | {{- end }} 296 | {{- end }} 297 | {{- if .Values.config.fabconnectUrl }} 298 | - name: fabric0 299 | type: fabric 300 | fabric: 301 | fabconnect: 302 | url: {{ tpl .Values.config.fabconnectUrl . }} 303 | {{- if and .Values.config.fabconnectUsername .Values.config.fabconnectPassword }} 304 | auth: 305 | username: {{ .Values.config.fabconnectUsername | quote }} 306 | password: {{ .Values.config.fabconnectPassword | quote }} 307 | {{- end }} 308 | retry: 309 | enable: {{ .Values.config.fabconnectRetry }} 310 | channel: {{ .Values.config.fabconnectChannel | quote }} 311 | chaincode: {{ .Values.config.fireflyChaincode | quote }} 312 | topic: {{ .Values.config.fabconnectTopic | quote }} 313 | signer: {{ .Values.config.fabconnectSigner | quote }} 314 | {{- end }} 315 | {{- if .Values.config.extraBlockchains }} 316 | {{- tpl .Values.config.extraBlockchains . | nindent 4 }} 317 | {{- end }} 318 | {{- end }} 319 | {{- if .Values.config.databaseOverride }} 320 | database: 321 | {{- tpl .Values.config.databaseOverride . | nindent 4 }} 322 | {{- else }} 323 | database: 324 | {{- if .Values.config.postgresUrl }} 325 | - name: database0 326 | type: postgres 327 | postgres: 328 | url: {{ tpl .Values.config.postgresUrl . }} 329 | migrations: 330 | auto: {{ .Values.config.postgresAutomigrate }} 331 | {{- end }} 332 | {{- if .Values.config.extraDatabases }} 333 | {{- tpl .Values.config.extraDatabases . | nindent 4 }} 334 | {{- end }} 335 | {{- end }} 336 | {{- if .Values.config.sharedstorageOverride }} 337 | sharedstorage: 338 | {{- tpl .Values.config.sharedstorageOverride . | nindent 4 }} 339 | {{- else }} 340 | sharedstorage: 341 | {{- if and .Values.config.ipfsApiUrl .Values.config.ipfsGatewayUrl }} 342 | - name: sharedstorage0 343 | type: ipfs 344 | ipfs: 345 | api: 346 | url: {{ tpl .Values.config.ipfsApiUrl . }} 347 | {{- if and .Values.config.ipfsApiUsername .Values.config.ipfsApiPassword }} 348 | auth: 349 | username: {{ .Values.config.ipfsApiUsername |quote }} 350 | password: {{ .Values.config.ipfsApiPassword | quote }} 351 | {{- end }} 352 | gateway: 353 | url: {{ tpl .Values.config.ipfsGatewayUrl . }} 354 | {{- if and .Values.config.ipfsGatewayUsername .Values.config.ipfsGatewayPassword }} 355 | auth: 356 | username: {{ .Values.config.ipfsGatewayUsername | quote }} 357 | password: {{ .Values.config.ipfsGatewayPassword | quote }} 358 | {{- end }} 359 | {{- end }} 360 | {{- if .Values.config.extraSharedstorage }} 361 | {{- tpl .Values.config.extraSharedstorage . | nindent 4 }} 362 | {{- end }} 363 | {{- end }} 364 | {{- if and .Values.config.dataexchangeOverride (not .Values.dataexchange.enabled) }} 365 | dataexchange: 366 | {{- tpl .Values.config.dataexchangeOverride . | nindent 4 }} 367 | {{- else }} 368 | dataexchange: 369 | {{- if .Values.dataexchange.enabled }} 370 | - type: ffdx 371 | name: dataexchange0 372 | ffdx: 373 | url: http://{{ include "firefly.fullname" . }}-dx.{{ .Release.Namespace }}.svc:{{ .Values.dataexchange.service.apiPort }} 374 | {{- if .Values.dataexchange.apiKey }} 375 | headers: 376 | x-api-key: {{ .Values.dataexchange.apiKey | quote }} 377 | {{- end }} 378 | {{- else }} 379 | - type: ffdx 380 | name: dataexchange0 381 | ffdx: 382 | url: {{ tpl .Values.config.dataexchangeUrl . }} 383 | {{- if .Values.config.dataexchangeAPIKey }} 384 | headers: 385 | x-api-key: {{ .Values.config.dataexchangeAPIKey | quote }} 386 | {{- end }} 387 | {{- end }} 388 | {{- if .Values.config.extraDataexchanges }} 389 | {{- tpl .Values.config.extraDataexchanges . | nindent 4 }} 390 | {{- end }} 391 | {{- end }} 392 | {{- if .Values.config.tokensOverride }} 393 | tokens: 394 | {{- tpl .Values.config.tokensOverride . | nindent 4 }} 395 | {{- else }} 396 | {{- if or .Values.erc1155.enabled .Values.erc20erc721.enabled .Values.config.extraTokens }} 397 | tokens: 398 | {{- if .Values.erc1155.enabled }} 399 | - type: fftokens 400 | name: erc1155 401 | remoteName: erc1155 402 | fftokens: 403 | url: http://{{ include "firefly.fullname" . }}-erc1155.{{ .Release.Namespace }}.svc:{{ .Values.erc1155.service.port }} 404 | {{- end }} 405 | {{- if .Values.erc20erc721.enabled }} 406 | - type: fftokens 407 | name: erc20-erc721 408 | remoteName: erc20-erc721 409 | fftokens: 410 | url: http://{{ include "firefly.fullname" . }}-erc20-erc721.{{ .Release.Namespace }}.svc:{{ .Values.erc20erc721.service.port }} 411 | {{- end }} 412 | {{- end }} 413 | {{- end }} 414 | 415 | namespaces: 416 | default: default 417 | predefined: 418 | {{- if .Values.config.extraNamespaces }} 419 | {{- tpl .Values.config.extraNamespaces . | nindent 4 }} 420 | {{- end }} 421 | - name: default 422 | remoteName: default 423 | description: Default predefined namespace 424 | {{- if and (eq .Values.config.defaultBlockchainType "ethereum") (or .Values.config.evmconnectUrl .Values.evmconnect.enabled .Values.config.ethconnectUrl .Values.ethconnect.enabled) }} 425 | defaultKey: {{ .Values.config.organizationKey }} 426 | {{- else if .Values.config.fabconnectUrl }} 427 | defaultKey: {{ .Values.config.fabconnectSigner }} 428 | {{- end }} 429 | plugins: 430 | - database0 431 | {{- if and (eq .Values.config.defaultBlockchainType "ethereum") (or .Values.config.evmconnectUrl .Values.evmconnect.enabled .Values.config.ethconnectUrl .Values.ethconnect.enabled) }} 432 | - eth0 433 | {{- else if .Values.config.fabconnectUrl }} 434 | - fabric0 435 | {{- end }} 436 | - dataexchange0 437 | - sharedstorage0 438 | {{- if .Values.erc1155.enabled }} 439 | - erc1155 440 | {{- end }} 441 | {{- if .Values.erc20erc721.enabled }} 442 | - erc20-erc721 443 | {{- end }} 444 | {{- if .Values.config.multipartyEnabled }} 445 | multiparty: 446 | enabled: true 447 | org: 448 | name: {{ .Values.config.organizationName }} 449 | description: The {{ .Values.config.organizationName }} organization 450 | {{- if and (eq .Values.config.defaultBlockchainType "ethereum") (or .Values.config.evmconnectUrl .Values.evmconnect.enabled .Values.config.ethconnectUrl .Values.ethconnect.enabled) }} 451 | key: {{ .Values.config.organizationKey }} 452 | {{- else if .Values.config.fabconnectUrl }} 453 | key: {{ .Values.config.fabconnectSigner }} 454 | {{- end }} 455 | node: 456 | name: {{ include "firefly.nodeName" . }} 457 | description: {{ include "firefly.nodeName" . }} 458 | contract: 459 | {{- if and (eq .Values.config.defaultBlockchainType "ethereum") (or .Values.config.evmconnectUrl .Values.evmconnect.enabled .Values.config.ethconnectUrl .Values.ethconnect.enabled) }} 460 | {{- if .Values.config.fireflyContracts }} 461 | {{- range .Values.config.fireflyContracts }} 462 | - location: 463 | address: {{ .address | quote }} 464 | firstEvent: {{ .firstEvent }} 465 | {{- end }} 466 | {{- end }} 467 | {{- else if .Values.config.fabconnectUrl }} 468 | - location: 469 | chaincode: {{ .Values.config.fireflyChaincode }} 470 | channel: {{ .Values.config.fabconnectChannel }} 471 | firstEvent: "" 472 | {{- if .Values.config.fireflyContracts }} 473 | {{- range .Values.config.fireflyContracts }} 474 | - location: 475 | channel: {{ .channel | quote }} 476 | chaincode: {{ .chaincode | quote }} 477 | firstEvent: {{ .firstEvent }} 478 | {{- end }} 479 | {{- end }} 480 | {{- end }} 481 | {{- end }} 482 | {{- end }} 483 | 484 | {{- define "firefly.ethconnectUrlEnvVar" -}} 485 | - name: ETHCONNECT_URL 486 | {{- if .Values.ethconnect.enabled }} 487 | value: "http://{{ include "firefly.fullname" . }}-ethconnect.{{ .Release.Namespace }}.svc:{{ .Values.ethconnect.service.apiPort }}" 488 | {{- else if .Values.evmconnect.enabled }} 489 | value: "http://{{ include "firefly.fullname" . }}-evmconnect.{{ .Release.Namespace }}.svc:{{ .Values.evmconnect.service.port }}" 490 | {{- else if .Values.config.ethconnectUrl }} 491 | value: {{ tpl .Values.config.ethconnectUrl . }} 492 | {{- else }} 493 | value: {{ tpl .Values.config.evmconnectUrl . }} 494 | {{- end }} 495 | {{- end }} -------------------------------------------------------------------------------- /charts/firefly/templates/core/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.core.ingress.enabled }} 20 | {{- $fullName := include "firefly.fullname" . -}} 21 | {{- $svcPort := .Values.core.service.httpPort -}} 22 | {{- if and .Values.core.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} 23 | {{- if not (hasKey .Values.core.ingress.annotations "kubernetes.io/ingress.class") }} 24 | {{- $_ := set .Values.core.ingress.annotations "kubernetes.io/ingress.class" .Values.core.ingress.className}} 25 | {{- end }} 26 | {{- end }} 27 | {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} 28 | apiVersion: networking.k8s.io/v1 29 | {{- else -}} 30 | apiVersion: networking.k8s.io/v1beta1 31 | {{- end }} 32 | kind: Ingress 33 | metadata: 34 | name: {{ $fullName }} 35 | labels: 36 | {{- include "firefly.coreLabels" . | nindent 4 }} 37 | {{- with .Values.core.ingress.annotations }} 38 | annotations: 39 | {{- toYaml . | nindent 4 }} 40 | {{- end }} 41 | spec: 42 | {{- if and .Values.core.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} 43 | ingressClassName: {{ .Values.core.ingress.className }} 44 | {{- end }} 45 | {{- if .Values.core.ingress.tls }} 46 | tls: 47 | {{- range .Values.core.ingress.tls }} 48 | - hosts: 49 | {{- range .hosts }} 50 | - {{ . | quote }} 51 | {{- end }} 52 | secretName: {{ .secretName }} 53 | {{- end }} 54 | {{- end }} 55 | rules: 56 | {{- range .Values.core.ingress.hosts }} 57 | - host: {{ .host | quote }} 58 | http: 59 | paths: 60 | - path: / 61 | {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} 62 | pathType: Prefix 63 | {{- end }} 64 | backend: 65 | {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} 66 | service: 67 | name: {{ $fullName }} 68 | port: 69 | number: {{ $svcPort }} 70 | {{- else }} 71 | serviceName: {{ $fullName }} 72 | servicePort: {{ $svcPort }} 73 | {{- end }} 74 | {{- end }} 75 | {{- end }} 76 | -------------------------------------------------------------------------------- /charts/firefly/templates/core/job-migrations.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.core.jobs.postgresMigrations.enabled }} 20 | apiVersion: batch/v1 21 | kind: Job 22 | metadata: 23 | name: "{{ include "firefly.fullname" . }}-{{ .Values.core.image.tag | default (printf "v%s" .Chart.AppVersion) }}-migrations" 24 | labels: 25 | {{- include "firefly.coreLabels" . | nindent 4 }} 26 | spec: 27 | backoffLimit: 5 28 | activeDeadlineSeconds: 12000 29 | template: 30 | spec: 31 | {{- with .Values.core.imagePullSecrets }} 32 | imagePullSecrets: 33 | {{- toYaml . | nindent 8 }} 34 | {{- end }} 35 | containers: 36 | - name: migration 37 | image: "{{ .Values.core.image.repository }}:{{ .Values.core.image.tag | default (printf "v%s" .Chart.AppVersion) }}" 38 | command: 39 | - sh 40 | - -ce 41 | - | 42 | {{ .Files.Get "scripts/ff-db-migrations.sh" | indent 10 }} 43 | {{- if or .Values.config.postgresUrl .Values.core.jobs.postgresMigrations.extraEnv }} 44 | env: 45 | {{- if .Values.config.postgresUrl }} 46 | - name: PSQL_URL 47 | valueFrom: 48 | secretKeyRef: 49 | name: {{ include "firefly.fullname" . }}-config 50 | key: psql_url 51 | {{- end }} 52 | {{- if .Values.core.jobs.postgresMigrations.extraEnv }} 53 | {{- toYaml .Values.core.jobs.postgresMigrations.extraEnv | nindent 12 }} 54 | {{- end }} 55 | {{- end }} 56 | restartPolicy: Never 57 | {{- end }} 58 | -------------------------------------------------------------------------------- /charts/firefly/templates/core/job-registration.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.core.jobs.registration.enabled }} 20 | apiVersion: batch/v1 21 | kind: Job 22 | metadata: 23 | name: "{{ include "firefly.fullname" . }}-{{ .Values.config.organizationName | lower }}-{{ .Values.core.image.tag | default (printf "v%s" .Chart.AppVersion) }}-registration" 24 | labels: 25 | {{- include "firefly.coreLabels" . | nindent 4 }} 26 | spec: 27 | backoffLimit: 5 28 | activeDeadlineSeconds: 12000 29 | template: 30 | spec: 31 | {{- with .Values.core.imagePullSecrets }} 32 | imagePullSecrets: 33 | {{- toYaml . | nindent 8 }} 34 | {{- end }} 35 | containers: 36 | - name: registration 37 | image: "{{ .Values.core.image.repository }}:{{ .Values.core.image.tag | default (printf "v%s" .Chart.AppVersion) }}" 38 | command: 39 | - sh 40 | - -ce 41 | - | 42 | {{ .Files.Get "scripts/ff-registration.sh" | indent 10 }} 43 | env: 44 | {{- if .Values.core.jobs.registration.ffUrl }} 45 | - name: FF_URL 46 | value: "{{ tpl .Values.core.jobs.registration.ffUrl . }}" 47 | {{- else }} 48 | - name: FF_URL 49 | value: "http://{{ include "firefly.fullname" . }}:{{ .Values.core.service.httpPort }}" 50 | {{- end }} 51 | - name: FF_NAMESPACES 52 | value: {{ join " " .Values.core.jobs.registration.ffNamespaces | quote }} 53 | restartPolicy: Never 54 | {{- end }} 55 | -------------------------------------------------------------------------------- /charts/firefly/templates/core/secret.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: v1 20 | kind: Secret 21 | metadata: 22 | name: {{ include "firefly.fullname" . }}-config 23 | labels: 24 | {{- include "firefly.coreLabels" . | nindent 4 }} 25 | stringData: 26 | {{- if and .Values.config.postgresUrl .Values.core.jobs.postgresMigrations.enabled }} 27 | psql_url: {{ tpl .Values.config.postgresUrl . }} 28 | {{- end }} 29 | firefly.core: | 30 | {{- if .Values.config.templateOverride }} 31 | {{- tpl .Values.config.templateOverride . | nindent 4 }} 32 | {{- else }} 33 | {{- include "firefly.coreConfig" . | nindent 4 }} 34 | {{- end }} 35 | -------------------------------------------------------------------------------- /charts/firefly/templates/core/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: {{ include "firefly.fullname" . }} 23 | labels: 24 | {{- include "firefly.coreLabels" . | nindent 4 }} 25 | spec: 26 | type: {{ .Values.core.service.type }} 27 | ports: 28 | {{- if .Values.config.debugEnabled }} 29 | - port: {{ .Values.core.service.debugPort }} 30 | targetPort: debug 31 | protocol: TCP 32 | name: debug 33 | {{- end }} 34 | - port: {{ .Values.core.service.httpPort }} 35 | targetPort: http 36 | protocol: TCP 37 | name: http 38 | {{- if .Values.config.adminEnabled }} 39 | - port: {{ .Values.core.service.adminPort }} 40 | targetPort: admin 41 | protocol: TCP 42 | name: admin 43 | {{- end }} 44 | {{- if .Values.config.metricsEnabled }} 45 | - port: {{ .Values.core.service.metricsPort }} 46 | targetPort: metrics 47 | protocol: TCP 48 | name: metrics 49 | {{- end }} 50 | selector: 51 | {{- include "firefly.coreSelectorLabels" . | nindent 4 }} 52 | -------------------------------------------------------------------------------- /charts/firefly/templates/core/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if and .Values.core.metrics.serviceMonitor.enabled .Values.config.metricsEnabled }} 20 | {{- if not (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }} 21 | # WARNING: prometheus-operator is not installed but serivcemonitor has been enabled, this will fail. Please install 22 | # prometheus-operator to resolve this. 23 | {{- end }} 24 | apiVersion: monitoring.coreos.com/v1 25 | kind: ServiceMonitor 26 | metadata: 27 | name: {{ include "firefly.fullname" . }} 28 | labels: 29 | {{- include "firefly.coreLabels" . | nindent 4 }} 30 | spec: 31 | endpoints: 32 | - port: metrics 33 | path: {{ .Values.config.metricsPath }} 34 | interval: {{ .Values.core.metrics.serviceMonitor.scrapeInterval }} 35 | {{- if .Values.core.metrics.serviceMonitor.honorLabels }} 36 | honorLabels: true 37 | {{- end }} 38 | {{- if .Values.core.metrics.serviceMonitor.metricRelabelings }} 39 | metricRelabelings: {{ toYaml .Values.core.metrics.serviceMonitor.metricRelabelings | nindent 8 }} 40 | {{- end }} 41 | {{- if .Values.core.metrics.serviceMonitor.jobLabel }} 42 | jobLabel: {{ .Values.core.metrics.serviceMonitor.jobLabel | quote }} 43 | {{- end }} 44 | {{- if .Values.core.metrics.serviceMonitor.namespaceSelector }} 45 | namespaceSelector: {{ toYaml .Values.core.metrics.serviceMonitor.namespaceSelector | nindent 4 }} 46 | {{- end }} 47 | {{- if .Values.core.metrics.serviceMonitor.targetLabels }} 48 | targetLabels: 49 | {{- range .Values.core.metrics.serviceMonitor.targetLabels }} 50 | - {{ . }} 51 | {{- end }} 52 | {{- end }} 53 | selector: 54 | matchLabels: 55 | {{- include "firefly.coreSelectorLabels" . | nindent 6 }} 56 | {{- end }} 57 | 58 | -------------------------------------------------------------------------------- /charts/firefly/templates/core/statefulset.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: apps/v1 20 | kind: StatefulSet 21 | metadata: 22 | name: {{ include "firefly.fullname" . }} 23 | labels: 24 | {{- include "firefly.coreLabels" . | nindent 4 }} 25 | spec: 26 | serviceName: {{ include "firefly.fullname" . }} 27 | updateStrategy: 28 | type: RollingUpdate 29 | replicas: 1 30 | selector: 31 | matchLabels: 32 | {{- include "firefly.coreSelectorLabels" . | nindent 6 }} 33 | template: 34 | metadata: 35 | annotations: 36 | checksum/config: {{ include (print $.Template.BasePath "/core/secret.yaml") . | sha256sum }} 37 | {{- with .Values.core.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | labels: 41 | {{- include "firefly.coreSelectorLabels" . | nindent 8 }} 42 | spec: 43 | {{- with .Values.core.imagePullSecrets }} 44 | imagePullSecrets: 45 | {{- toYaml . | nindent 8 }} 46 | {{- end }} 47 | securityContext: 48 | {{- toYaml .Values.core.podSecurityContext | nindent 8 }} 49 | {{- if .Values.core.initContainers }} 50 | initContainers: 51 | {{- tpl .Values.core.initContainers . | nindent 8 }} 52 | {{- end }} 53 | containers: 54 | - name: firefly 55 | securityContext: 56 | {{- toYaml .Values.core.securityContext | nindent 12 }} 57 | image: "{{ .Values.core.image.repository }}:{{ .Values.core.image.tag | default (printf "v%s" .Chart.AppVersion) }}" 58 | imagePullPolicy: {{ .Values.core.image.pullPolicy }} 59 | env: 60 | {{- if .Values.core.extraEnv }} 61 | {{- toYaml .Values.core.extraEnv | nindent 12 }} 62 | {{- end }} 63 | ports: 64 | - name: http 65 | containerPort: {{ .Values.core.service.httpPort }} 66 | protocol: TCP 67 | {{- if .Values.config.debugEnabled }} 68 | - name: debug 69 | containerPort: {{ .Values.core.service.debugPort }} 70 | protocol: TCP 71 | {{- end }} 72 | {{- if .Values.config.adminEnabled }} 73 | - name: admin 74 | containerPort: {{ .Values.core.service.adminPort }} 75 | protocol: TCP 76 | {{- end }} 77 | {{- if .Values.config.metricsEnabled }} 78 | - name: metrics 79 | containerPort: {{ .Values.core.service.metricsPort }} 80 | protocol: TCP 81 | {{- end }} 82 | livenessProbe: 83 | tcpSocket: 84 | port: {{ if and .Values.config.adminEnabled .Values.config.preInit }}admin{{ else }}http{{ end }} 85 | initialDelaySeconds: 10 86 | failureThreshold: 5 87 | successThreshold: 1 88 | periodSeconds: 5 89 | readinessProbe: 90 | tcpSocket: 91 | port: {{ if and .Values.config.adminEnabled .Values.config.preInit }}admin{{ else }}http{{ end }} 92 | failureThreshold: 10 93 | successThreshold: 3 94 | periodSeconds: 3 95 | volumeMounts: 96 | - mountPath: /etc/firefly/ 97 | name: firefly-config 98 | {{- if .Values.core.extraVolumeMounts }} 99 | {{- tpl .Values.core.extraVolumeMounts . | nindent 12 }} 100 | {{- end }} 101 | resources: 102 | {{- toYaml .Values.core.resources | nindent 12 }} 103 | {{- if .Values.core.extraContainers }} 104 | {{- tpl .Values.core.extraContainers . | nindent 8 }} 105 | {{- end }} 106 | {{- with .Values.core.nodeSelector }} 107 | nodeSelector: 108 | {{- toYaml . | nindent 8 }} 109 | {{- end }} 110 | {{- with .Values.core.affinity }} 111 | affinity: 112 | {{- toYaml . | nindent 8 }} 113 | {{- end }} 114 | {{- with .Values.core.tolerations }} 115 | tolerations: 116 | {{- toYaml . | nindent 8 }} 117 | {{- end }} 118 | volumes: 119 | - name: firefly-config 120 | secret: 121 | secretName: {{ include "firefly.fullname" . }}-config 122 | {{- if .Values.core.extraVolumes }} 123 | {{- tpl .Values.core.extraVolumes . | nindent 8 }} 124 | {{- end }} 125 | {{- if .Values.core.volumeClaimTemplates }} 126 | volumeClaimTemplates: 127 | {{- tpl .Values.core.volumeClaimTemplates . | nindent 4 }} 128 | {{- end }} 129 | -------------------------------------------------------------------------------- /charts/firefly/templates/dataexchange/certificate.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if and .Values.dataexchange.enabled .Values.dataexchange.certificate.enabled }} 20 | {{- if not (.Capabilities.APIVersions.Has "cert-manager.io/v1") }} 21 | # WARNING: cert-manager is not installed but certificate has been enabled, this will fail. Please either 22 | # provide your own TLS certificate via tlsSecret.name or install cert-manager to resolve this. 23 | {{- end }} 24 | apiVersion: cert-manager.io/v1 25 | kind: Certificate 26 | metadata: 27 | name: "{{ include "firefly.fullname" . }}-dx" 28 | labels: 29 | {{- include "firefly.dataexchangeLabels" . | nindent 4 }} 30 | spec: 31 | # NOTE: issuer should always be an internal / self-signed CA so that the subject is included 32 | # LetsEncrypt will not work w/ DX currently bc those certs cannot have subject, etc. configured. 33 | # Nor will a self-signed cert due to https://github.com/jetstack/cert-manager/issues/3651 34 | issuerRef: 35 | {{- toYaml .Values.dataexchange.certificate.issuerRef | nindent 4 }} 36 | secretName: "{{ include "firefly.fullname" . }}-dx-tls" 37 | subject: 38 | organizations: 39 | - {{ .Values.config.organizationName }} 40 | commonName: {{ if .Values.dataexchange.ingress.enabled }}{{ (index .Values.dataexchange.ingress.hosts 0).host }}{{ else }}{{ include "firefly.fullname" . }}-dx{{ end }} 41 | usages: 42 | - server auth 43 | - client auth 44 | {{- if .Values.dataexchange.certificate.duration }} 45 | duration: {{ .Values.dataexchange.certificate.duration | quote }} 46 | {{- end }} 47 | dnsNames: 48 | {{- if .Values.dataexchange.ingress.enabled }} 49 | {{- range .Values.dataexchange.ingress.hosts }} 50 | - {{ .host }} 51 | {{- end }} 52 | {{- end }} 53 | - {{ include "firefly.fullname" . }}-dx 54 | - {{ include "firefly.fullname" . }}-dx.{{ .Release.Namespace }}.svc 55 | - {{ include "firefly.fullname" . }}-dx.{{ .Release.Namespace }}.svc.cluster.local 56 | {{- end }} 57 | -------------------------------------------------------------------------------- /charts/firefly/templates/dataexchange/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if and .Values.dataexchange.enabled .Values.dataexchange.ingress.enabled }} 20 | {{- $fullName := include "firefly.fullname" . -}} 21 | {{- $svcPort := .Values.dataexchange.service.p2pPort -}} 22 | {{- if and .Values.dataexchange.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} 23 | {{- if not (hasKey .Values.dataexchange.ingress.annotations "kubernetes.io/ingress.class") }} 24 | {{- $_ := set .Values.dataexchange.ingress.annotations "kubernetes.io/ingress.class" .Values.dataexchange.ingress.className}} 25 | {{- end }} 26 | {{- end }} 27 | {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} 28 | apiVersion: networking.k8s.io/v1 29 | {{- else -}} 30 | apiVersion: networking.k8s.io/v1beta1 31 | {{- end }} 32 | kind: Ingress 33 | metadata: 34 | name: {{ $fullName }}-dx 35 | labels: 36 | {{- include "firefly.dataexchangeLabels" . | nindent 4 }} 37 | {{- with .Values.dataexchange.ingress.annotations }} 38 | annotations: 39 | {{- toYaml . | nindent 4 }} 40 | {{- end }} 41 | spec: 42 | {{- if and .Values.dataexchange.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} 43 | ingressClassName: {{ .Values.dataexchange.ingress.className }} 44 | {{- end }} 45 | {{- $tlsSecretName := .Values.dataexchange.tlsSecret.name }} 46 | {{- if and .Values.dataexchange.certificate.enabled (not .Values.dataexchange.tlsSecret.enabled) }} 47 | {{- $tlsSecretName = printf "%s-dx-tls" $fullName}} 48 | {{- end }} 49 | tls: 50 | - hosts: 51 | {{- range .Values.dataexchange.ingress.hosts }} 52 | - {{ .host | quote }} 53 | {{- end }} 54 | secretName: {{ $tlsSecretName }} 55 | rules: 56 | {{- range .Values.dataexchange.ingress.hosts }} 57 | - host: {{ .host | quote }} 58 | http: 59 | paths: 60 | - path: / 61 | {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} 62 | pathType: Prefix 63 | {{- end }} 64 | backend: 65 | {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} 66 | service: 67 | name: {{ $fullName }}-dx 68 | port: 69 | number: {{ $svcPort }} 70 | {{- else }} 71 | serviceName: {{ $fullName }}-dx 72 | servicePort: {{ $svcPort }} 73 | {{- end }} 74 | {{- end }} 75 | {{- end }} 76 | -------------------------------------------------------------------------------- /charts/firefly/templates/dataexchange/secret.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.dataexchange.enabled }} 20 | apiVersion: v1 21 | kind: Secret 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-dx-config 24 | labels: 25 | {{- include "firefly.dataexchangeLabels" . | nindent 4 }} 26 | stringData: 27 | config.json: | 28 | { 29 | {{- if .Values.dataexchange.apiKey }} 30 | "apiKey": {{ .Values.dataexchange.apiKey | quote }}, 31 | {{- end }} 32 | "api": { 33 | "hostname": "0.0.0.0", 34 | "port": {{ .Values.dataexchange.service.apiPort }} 35 | }, 36 | "p2p": { 37 | "hostname": "0.0.0.0", 38 | "port": {{ .Values.dataexchange.service.p2pPort }}, 39 | "endpoint": "https://{{ include "firefly.dataexchangeP2PHost" . }}" 40 | } 41 | } 42 | {{- end }} 43 | -------------------------------------------------------------------------------- /charts/firefly/templates/dataexchange/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.dataexchange.enabled }} 20 | apiVersion: v1 21 | kind: Service 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-dx 24 | labels: 25 | {{- include "firefly.dataexchangeLabels" . | nindent 4 }} 26 | spec: 27 | type: {{ .Values.dataexchange.service.type }} 28 | ports: 29 | - port: {{ .Values.dataexchange.service.apiPort }} 30 | targetPort: http 31 | protocol: TCP 32 | name: http 33 | - port: {{ .Values.dataexchange.service.p2pPort }} 34 | targetPort: p2p 35 | protocol: TCP 36 | name: p2p 37 | selector: 38 | {{- include "firefly.dataexchangeSelectorLabels" . | nindent 4 }} 39 | {{- end }} 40 | -------------------------------------------------------------------------------- /charts/firefly/templates/dataexchange/statefulset.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.dataexchange.enabled }} 20 | apiVersion: apps/v1 21 | kind: StatefulSet 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-dx 24 | labels: 25 | {{- include "firefly.dataexchangeLabels" . | nindent 4 }} 26 | spec: 27 | replicas: 1 28 | serviceName: {{ include "firefly.fullname" . }}-dx 29 | updateStrategy: 30 | type: RollingUpdate 31 | selector: 32 | matchLabels: 33 | {{- include "firefly.dataexchangeSelectorLabels" . | nindent 6 }} 34 | template: 35 | metadata: 36 | annotations: 37 | checksum/config: {{ include (print $.Template.BasePath "/dataexchange/secret.yaml") . | sha256sum }} 38 | {{- if .Values.dataexchange.certificate.enabled }} 39 | checksum/certificate: {{ include (print $.Template.BasePath "/dataexchange/certificate.yaml") . | sha256sum }} 40 | {{- end }} 41 | {{- with .Values.dataexchange.podAnnotations }} 42 | {{- toYaml . | nindent 8 }} 43 | {{- end }} 44 | labels: 45 | {{- include "firefly.dataexchangeSelectorLabels" . | nindent 8 }} 46 | spec: 47 | {{- with .Values.dataexchange.imagePullSecrets }} 48 | imagePullSecrets: 49 | {{- toYaml . | nindent 8 }} 50 | {{- end }} 51 | securityContext: 52 | {{- toYaml .Values.dataexchange.podSecurityContext | nindent 8 }} 53 | containers: 54 | - name: dx 55 | securityContext: 56 | {{- toYaml .Values.dataexchange.securityContext | nindent 12 }} 57 | image: "{{ .Values.dataexchange.image.repository }}:{{ .Values.dataexchange.image.tag }}" 58 | imagePullPolicy: {{ .Values.dataexchange.image.pullPolicy }} 59 | {{- if .Values.dataexchange.extraEnv }} 60 | env: 61 | {{- toYaml .Values.dataexchange.extraEnv | nindent 12 }} 62 | {{- end }} 63 | ports: 64 | - name: http 65 | containerPort: {{ .Values.dataexchange.service.apiPort }} 66 | protocol: TCP 67 | - name: p2p 68 | containerPort: {{ .Values.dataexchange.service.p2pPort }} 69 | protocol: TCP 70 | livenessProbe: 71 | tcpSocket: 72 | port: http 73 | initialDelaySeconds: 5 74 | failureThreshold: 5 75 | successThreshold: 1 76 | periodSeconds: 5 77 | readinessProbe: 78 | tcpSocket: 79 | port: p2p 80 | initialDelaySeconds: 5 81 | failureThreshold: 10 82 | successThreshold: 3 83 | periodSeconds: 3 84 | resources: 85 | {{- toYaml .Values.dataexchange.resources | nindent 12 }} 86 | volumeMounts: 87 | - mountPath: /data/peer-certs 88 | subPath: peer-certs 89 | name: dx-peers 90 | - mountPath: /data/peers 91 | subPath: peers 92 | name: dx-peers 93 | - mountPath: /data/destinations 94 | subPath: destinations 95 | name: dx-peers 96 | - mountPath: /data/config.json 97 | name: config 98 | subPath: config.json 99 | - mountPath: /data/key.pem 100 | name: tls 101 | subPath: tls.key 102 | - mountPath: /data/cert.pem 103 | name: tls 104 | subPath: tls.crt 105 | - mountPath: /data/ca.pem 106 | name: tls 107 | subPath: ca.crt 108 | - mountPath: /data/blobs 109 | {{- if and .Values.dataexchange.persistentVolumes.blobs.enabled .Values.dataexchange.persistentVolumes.blobs.subPath }} 110 | subPath: {{ .Values.dataexchange.persistentVolumes.blobs.subPath | quote }} 111 | {{- end }} 112 | name: dx-blobs 113 | {{- with .Values.dataexchange.nodeSelector }} 114 | nodeSelector: 115 | {{- toYaml . | nindent 8 }} 116 | {{- end }} 117 | {{- with .Values.dataexchange.affinity }} 118 | affinity: 119 | {{- toYaml . | nindent 8 }} 120 | {{- end }} 121 | {{- with .Values.dataexchange.tolerations }} 122 | tolerations: 123 | {{- toYaml . | nindent 8 }} 124 | {{- end }} 125 | volumes: 126 | - name: config 127 | secret: 128 | secretName: "{{ include "firefly.fullname" . }}-dx-config" 129 | - name: tls 130 | secret: 131 | secretName: {{ if and .Values.dataexchange.certificate.enabled (not .Values.dataexchange.tlsSecret.enabled) }}"{{ include "firefly.fullname" . }}-dx-tls"{{ else }}{{ .Values.dataexchange.tlsSecret.name }}{{ end }} 132 | {{- if not .Values.dataexchange.persistentVolumes.blobs.enabled }} 133 | - name: dx-blobs 134 | emptyDir: {} 135 | {{- end }} 136 | {{- if or .Values.dataexchange.persistentVolumes.blobs.enabled .Values.dataexchange.persistentVolumes.peers.enabled }} 137 | volumeClaimTemplates: 138 | - metadata: 139 | name: dx-blobs 140 | {{- with .Values.dataexchange.persistentVolumes.blobs }} 141 | {{- with .annotations }} 142 | annotations: 143 | {{- toYaml . | nindent 10 }} 144 | {{- end }} 145 | spec: 146 | accessModes: 147 | {{- toYaml .accessModes | nindent 10 }} 148 | storageClassName: {{ .storageClass }} 149 | resources: 150 | requests: 151 | storage: {{ .size }} 152 | {{- end }} 153 | {{- end }} 154 | - metadata: 155 | name: dx-peers 156 | {{- with .Values.dataexchange.persistentVolumes.peers }} 157 | {{- with .annotations }} 158 | annotations: 159 | {{- toYaml . | nindent 10 }} 160 | {{- end }} 161 | spec: 162 | accessModes: 163 | {{- toYaml .accessModes | nindent 10 }} 164 | storageClassName: {{ .storageClass }} 165 | resources: 166 | requests: 167 | storage: {{ .size }} 168 | {{- end }} 169 | {{- end }} 170 | -------------------------------------------------------------------------------- /charts/firefly/templates/erc1155/deployment.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.erc1155.enabled }} 20 | apiVersion: apps/v1 21 | kind: Deployment 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-erc1155 24 | labels: 25 | {{- include "firefly.erc1155Labels" . | nindent 4 }} 26 | spec: 27 | replicas: 1 28 | selector: 29 | matchLabels: 30 | {{- include "firefly.erc1155SelectorLabels" . | nindent 6 }} 31 | template: 32 | metadata: 33 | {{- with .Values.erc1155.podAnnotations }} 34 | annotations: 35 | {{- toYaml . | nindent 8 }} 36 | {{- end }} 37 | labels: 38 | {{- include "firefly.erc1155SelectorLabels" . | nindent 8 }} 39 | spec: 40 | {{- with .Values.erc1155.imagePullSecrets }} 41 | imagePullSecrets: 42 | {{- toYaml . | nindent 8 }} 43 | {{- end }} 44 | securityContext: 45 | {{- toYaml .Values.erc1155.podSecurityContext | nindent 8 }} 46 | containers: 47 | - name: {{ .Chart.Name }}-erc1155 48 | securityContext: 49 | {{- toYaml .Values.erc1155.securityContext | nindent 12 }} 50 | image: "{{ .Values.erc1155.image.repository }}:{{ .Values.erc1155.image.tag }}" 51 | imagePullPolicy: {{ .Values.erc1155.image.pullPolicy }} 52 | ports: 53 | - name: http 54 | containerPort: {{ .Values.erc1155.service.port }} 55 | protocol: TCP 56 | livenessProbe: 57 | httpGet: 58 | path: /api/v1/health/liveness 59 | port: http 60 | successThreshold: 1 61 | failureThreshold: 2 62 | periodSeconds: 10 63 | timeoutSeconds: 1 64 | initialDelaySeconds: 5 65 | readinessProbe: 66 | httpGet: 67 | path: /api/v1/health/readiness 68 | port: http 69 | successThreshold: 1 70 | failureThreshold: 4 71 | periodSeconds: 15 72 | timeoutSeconds: 2 73 | initialDelaySeconds: 15 74 | env: 75 | {{- include "firefly.ethconnectUrlEnvVar" . | nindent 12 }} 76 | - name: CONTRACT_ADDRESS 77 | value: {{ .Values.erc1155.contractAddress | quote }} 78 | - name: PORT 79 | value: {{ .Values.erc1155.service.port | quote }} 80 | - name: ETHCONNECT_INSTANCE 81 | value: {{ .Values.erc1155.ethconnectInstance }} 82 | - name: ETHCONNECT_TOPIC 83 | value: {{ .Values.erc1155.ethconnectTopic | quote }} 84 | - name: ETHCONNECT_PREFIX 85 | value: {{ .Values.config.ethconnectPrefixShort | default "fly" }} 86 | {{- if and .Values.config.ethconnectUsername .Values.config.ethconnectPassword }} 87 | - name: ETHCONNECT_USERNAME 88 | value: {{ .Values.config.ethconnectUsername | quote }} 89 | - name: ETHCONNECT_PASSWORD 90 | value: {{ .Values.config.ethconnectPassword | quote }} 91 | {{- end }} 92 | - name: AUTO_INIT 93 | value: "true" 94 | resources: 95 | {{- toYaml .Values.erc1155.resources | nindent 12 }} 96 | {{- with .Values.erc1155.nodeSelector }} 97 | nodeSelector: 98 | {{- toYaml . | nindent 8 }} 99 | {{- end }} 100 | {{- with .Values.erc1155.affinity }} 101 | affinity: 102 | {{- toYaml . | nindent 8 }} 103 | {{- end }} 104 | {{- with .Values.erc1155.tolerations }} 105 | tolerations: 106 | {{- toYaml . | nindent 8 }} 107 | {{- end }} 108 | {{- end }} 109 | -------------------------------------------------------------------------------- /charts/firefly/templates/erc1155/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.erc1155.enabled }} 20 | apiVersion: v1 21 | kind: Service 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-erc1155 24 | labels: 25 | {{- include "firefly.erc1155Labels" . | nindent 4 }} 26 | spec: 27 | type: {{ .Values.erc1155.service.type }} 28 | ports: 29 | - port: {{ .Values.erc1155.service.port }} 30 | targetPort: http 31 | protocol: TCP 32 | name: http 33 | selector: 34 | {{- include "firefly.erc1155SelectorLabels" . | nindent 4 }} 35 | {{- end }} 36 | -------------------------------------------------------------------------------- /charts/firefly/templates/erc20erc721/configmap-deploy-scripts.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if and .Values.erc20erc721.enabled .Values.erc20erc721.job.deployContracts.enabled }} 20 | apiVersion: v1 21 | kind: ConfigMap 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-erc20-erc721-deploy-scripts 24 | labels: 25 | {{- include "firefly.erc20erc721Labels" . | nindent 4 }} 26 | data: 27 | {{ (.Files.Glob "scripts/ff-deploy-erc20-erc721-contracts/*").AsConfig | indent 2 }} 28 | {{- end }} -------------------------------------------------------------------------------- /charts/firefly/templates/erc20erc721/deployment.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.erc20erc721.enabled }} 20 | apiVersion: apps/v1 21 | kind: Deployment 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-erc20-erc721 24 | labels: 25 | {{- include "firefly.erc20erc721Labels" . | nindent 4 }} 26 | spec: 27 | replicas: 1 28 | selector: 29 | matchLabels: 30 | {{- include "firefly.erc20erc721SelectorLabels" . | nindent 6 }} 31 | template: 32 | metadata: 33 | {{- with .Values.erc20erc721.podAnnotations }} 34 | annotations: 35 | {{- toYaml . | nindent 8 }} 36 | {{- end }} 37 | labels: 38 | {{- include "firefly.erc20erc721SelectorLabels" . | nindent 8 }} 39 | spec: 40 | {{- with .Values.erc20erc721.imagePullSecrets }} 41 | imagePullSecrets: 42 | {{- toYaml . | nindent 8 }} 43 | {{- end }} 44 | securityContext: 45 | {{- toYaml .Values.erc20erc721.podSecurityContext | nindent 8 }} 46 | containers: 47 | - name: {{ .Chart.Name }}-erc20 48 | securityContext: 49 | {{- toYaml .Values.erc20erc721.securityContext | nindent 12 }} 50 | image: "{{ .Values.erc20erc721.image.repository }}:{{ .Values.erc20erc721.image.tag }}" 51 | imagePullPolicy: {{ .Values.erc20erc721.image.pullPolicy }} 52 | ports: 53 | - name: http 54 | containerPort: {{ .Values.erc20erc721.service.port }} 55 | protocol: TCP 56 | livenessProbe: 57 | httpGet: 58 | path: /api/v1/health/liveness 59 | port: http 60 | successThreshold: 1 61 | failureThreshold: 2 62 | periodSeconds: 10 63 | timeoutSeconds: 1 64 | initialDelaySeconds: 5 65 | readinessProbe: 66 | httpGet: 67 | path: /api/v1/health/readiness 68 | port: http 69 | successThreshold: 1 70 | failureThreshold: 4 71 | periodSeconds: 15 72 | timeoutSeconds: 2 73 | initialDelaySeconds: 15 74 | env: 75 | {{- include "firefly.ethconnectUrlEnvVar" . | nindent 12 }} 76 | - name: PORT 77 | value: {{ .Values.erc20erc721.service.port | quote }} 78 | - name: ETHCONNECT_TOPIC 79 | value: {{ .Values.erc20erc721.ethconnectTopic | quote }} 80 | - name: ETHCONNECT_PREFIX 81 | value: {{ .Values.config.ethconnectPrefixShort | default "fly" }} 82 | {{- if and .Values.config.ethconnectUsername .Values.config.ethconnectPassword }} 83 | - name: ETHCONNECT_USERNAME 84 | value: {{ .Values.config.ethconnectUsername | quote }} 85 | - name: ETHCONNECT_PASSWORD 86 | value: {{ .Values.config.ethconnectPassword | quote }} 87 | {{- end }} 88 | - name: AUTO_INIT 89 | value: "true" 90 | resources: 91 | {{- toYaml .Values.erc20erc721.resources | nindent 12 }} 92 | {{- with .Values.erc20erc721.nodeSelector }} 93 | nodeSelector: 94 | {{- toYaml . | nindent 8 }} 95 | {{- end }} 96 | {{- with .Values.erc20erc721.affinity }} 97 | affinity: 98 | {{- toYaml . | nindent 8 }} 99 | {{- end }} 100 | {{- with .Values.erc20erc721.tolerations }} 101 | tolerations: 102 | {{- toYaml . | nindent 8 }} 103 | {{- end }} 104 | {{- end }} -------------------------------------------------------------------------------- /charts/firefly/templates/erc20erc721/job-deploy-contracts.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if and .Values.erc20erc721.enabled .Values.erc20erc721.job.deployContracts.enabled .Values.ethconnect.enabled }} 20 | apiVersion: batch/v1 21 | kind: Job 22 | metadata: 23 | name: "{{ include "firefly.erc20erc721DeployContractsJobName" . }}" 24 | labels: 25 | {{- include "firefly.erc20erc721Labels" . | nindent 4 }} 26 | spec: 27 | backoffLimit: 5 28 | activeDeadlineSeconds: 12000 29 | template: 30 | spec: 31 | volumes: 32 | - name: deploy-scripts 33 | configMap: 34 | name: {{ include "firefly.fullname" . }}-erc20-erc721-deploy-scripts 35 | - name: tmp 36 | emptyDir: {} 37 | {{- with .Values.erc20erc721.imagePullSecrets }} 38 | imagePullSecrets: 39 | {{- toYaml . | nindent 8 }} 40 | {{- end }} 41 | containers: 42 | - name: deploy-contracts 43 | image: "{{ .Values.erc20erc721.image.repository }}:{{ .Values.erc20erc721.image.tag }}" 44 | command: 45 | - sh 46 | - -ce 47 | - | 48 | #!/bin/sh 49 | 50 | until STATUS=$(curl --fail -s ${ETHCONNECT_URL}/status); do 51 | echo "Waiting for Ethconnect... " 52 | sleep 5 53 | done 54 | 55 | set -e 56 | 57 | mkdir /tmp/ff-deploy-erc20-erc721-contracts 58 | cp /var/lib/ff-deploy-erc20-erc721-contracts/* /tmp/ff-deploy-erc20-erc721-contracts/ 59 | cd /tmp/ff-deploy-erc20-erc721-contracts/ 60 | 61 | npm i 62 | exec node index.js 63 | env: 64 | {{- include "firefly.ethconnectUrlEnvVar" . | nindent 12 }} 65 | - name: ETHCONNECT_PREFIX 66 | value: {{ .Values.config.ethconnectPrefixLong | default "firefly" }} 67 | - name: ABIS_URI 68 | value: {{ .Values.erc20erc721.abisUri | default "/abis" }} 69 | - name: CONTRACTS_URI 70 | value: {{ .Values.erc20erc721.contractsUri | default "/contracts" }} 71 | - name: TOKENS_OWNER_KEY 72 | value: {{ .Values.erc20erc721.ownerKey | default .Values.config.organizationKey }} 73 | - name: ERC20_ENABLED 74 | value: {{ .Values.erc20erc721.erc20.enabled | quote }} 75 | - name: ERC20_TOKEN_NAME 76 | value: {{ .Values.erc20erc721.erc20.tokenName }} 77 | - name: ERC721_ENABLED 78 | value: {{ .Values.erc20erc721.erc721.enabled | quote }} 79 | - name: ERC721_TOKEN_NAME 80 | value: {{ .Values.erc20erc721.erc721.tokenName }} 81 | volumeMounts: 82 | - name: deploy-scripts 83 | mountPath: /var/lib/ff-deploy-erc20-erc721-contracts/ 84 | - name: tmp 85 | mountPath: /tmp 86 | restartPolicy: Never 87 | {{- end }} -------------------------------------------------------------------------------- /charts/firefly/templates/erc20erc721/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.erc20erc721.enabled }} 20 | apiVersion: v1 21 | kind: Service 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-erc20-erc721 24 | labels: 25 | {{- include "firefly.erc20erc721Labels" . | nindent 4 }} 26 | spec: 27 | type: {{ .Values.erc20erc721.service.type }} 28 | ports: 29 | - port: {{ .Values.erc20erc721.service.port }} 30 | targetPort: http 31 | protocol: TCP 32 | name: http 33 | selector: 34 | {{- include "firefly.erc20erc721SelectorLabels" . | nindent 4 }} 35 | {{- end }} -------------------------------------------------------------------------------- /charts/firefly/templates/ethconnect/configmap-contracts.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if and .Values.ethconnect.enabled .Values.ethconnect.job.registerContracts.enabled }} 20 | apiVersion: v1 21 | kind: ConfigMap 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-contracts 24 | labels: 25 | {{- include "firefly.ethconnectLabels" . | nindent 4 }} 26 | data: 27 | {{ (.Files.Glob "contracts/*.json").AsConfig | indent 2 }} 28 | {{- end }} 29 | -------------------------------------------------------------------------------- /charts/firefly/templates/ethconnect/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if and .Values.ethconnect.enabled .Values.ethconnect.ingress.enabled -}} 20 | {{- $fullName := include "firefly.fullname" . -}} 21 | {{- $svcPort := .Values.ethconnect.service.apiPort -}} 22 | {{- if and .Values.ethconnect.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} 23 | {{- if not (hasKey .Values.ethconnect.ingress.annotations "kubernetes.io/ingress.class") }} 24 | {{- $_ := set .Values.ethconnect.ingress.annotations "kubernetes.io/ingress.class" .Values.ethconnect.ingress.className}} 25 | {{- end }} 26 | {{- end }} 27 | {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} 28 | apiVersion: networking.k8s.io/v1 29 | {{- else -}} 30 | apiVersion: networking.k8s.io/v1beta1 31 | {{- end }} 32 | kind: Ingress 33 | metadata: 34 | name: {{ $fullName }}-ethconnect 35 | labels: 36 | {{- include "firefly.ethconnectLabels" . | nindent 4 }} 37 | {{- with .Values.ethconnect.ingress.annotations }} 38 | annotations: 39 | {{- toYaml . | nindent 4 }} 40 | {{- end }} 41 | spec: 42 | {{- if and .Values.ethconnect.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} 43 | ingressClassName: {{ .Values.ethconnect.ingress.className }} 44 | {{- end }} 45 | {{- if .Values.ethconnect.ingress.tls }} 46 | tls: 47 | {{- range .Values.ethconnect.ingress.tls }} 48 | - hosts: 49 | {{- range .hosts }} 50 | - {{ . | quote }} 51 | {{- end }} 52 | secretName: {{ .secretName }} 53 | {{- end }} 54 | {{- end }} 55 | rules: 56 | {{- range .Values.ethconnect.ingress.hosts }} 57 | - host: {{ .host | quote }} 58 | http: 59 | paths: 60 | - path: / 61 | {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} 62 | pathType: Prefix 63 | {{- end }} 64 | backend: 65 | {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} 66 | service: 67 | name: {{ $fullName }}-ethconnect 68 | port: 69 | number: {{ $svcPort }} 70 | {{- else }} 71 | serviceName: {{ $fullName }}-ethconnect 72 | servicePort: {{ $svcPort }} 73 | {{- end }} 74 | {{- end }} 75 | {{- end }} 76 | -------------------------------------------------------------------------------- /charts/firefly/templates/ethconnect/job-register-contracts.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if and .Values.ethconnect.enabled .Values.ethconnect.job.registerContracts.enabled }} 20 | apiVersion: batch/v1 21 | kind: Job 22 | metadata: 23 | name: "{{ include "firefly.ethconnectRegisterContractsJobName" . }}" 24 | labels: 25 | {{- include "firefly.ethconnectLabels" . | nindent 4 }} 26 | spec: 27 | backoffLimit: 5 28 | activeDeadlineSeconds: 12000 29 | template: 30 | spec: 31 | volumes: 32 | - name: contracts 33 | configMap: 34 | name: {{ include "firefly.fullname" . }}-contracts 35 | - name: tmp 36 | emptyDir: {} 37 | {{- with .Values.core.imagePullSecrets }} 38 | imagePullSecrets: 39 | {{- toYaml . | nindent 8 }} 40 | {{- end }} 41 | containers: 42 | - name: register-contracts 43 | image: "{{ .Values.core.image.repository }}:{{ .Values.core.image.tag | default (printf "v%s" .Chart.AppVersion) }}" 44 | command: 45 | - sh 46 | - -ce 47 | - | 48 | {{ .Files.Get "scripts/ff-register-contracts.sh" | indent 12 }} 49 | env: 50 | {{- include "firefly.ethconnectUrlEnvVar" . | nindent 12 }} 51 | - name: ETHCONNECT_PREFIX 52 | value: {{ .Values.config.ethconnectPrefixShort | default "fly" }} 53 | - name: FIREFLY_CONTRACT_ADDRESS 54 | value: {{ .Values.config.fireflyContractAddress | replace "/contracts/" "" }} 55 | {{- if .Values.erc1155.enabled }} 56 | - name: FIREFLY_ERC1155_ENABLED 57 | value: "true" 58 | - name: FIREFLY_ERC1155_CONTRACT_ADDRESS 59 | value: {{ .Values.erc1155.contractAddress | replace "/contracts/" "" }} 60 | {{- end }} 61 | volumeMounts: 62 | - name: contracts 63 | mountPath: /var/lib/ethconnect/contracts 64 | - name: tmp 65 | mountPath: /tmp 66 | restartPolicy: Never 67 | {{- end }} -------------------------------------------------------------------------------- /charts/firefly/templates/ethconnect/secret.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.ethconnect.enabled }} 20 | apiVersion: v1 21 | kind: Secret 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-ethconnect-config 24 | labels: 25 | {{- include "firefly.ethconnectLabels" . | nindent 4 }} 26 | stringData: 27 | config.yaml: |- 28 | rest: 29 | rest-gateway: 30 | rpc: 31 | url: {{ tpl .Values.ethconnect.config.jsonRpcUrl . }} 32 | openapi: 33 | eventPollingIntervalSec: {{ .Values.ethconnect.config.eventPollingIntervalSec }} 34 | storagePath: /var/run/ethconnect/abis 35 | eventsDB: /var/run/ethconnect/events 36 | catchupModePageSize: {{ .Values.ethconnect.config.catchupModePageSize }} 37 | catchupModeBlockGap: {{ .Values.ethconnect.config.catchupModeBlockGap }} 38 | http: 39 | port: {{ .Values.ethconnect.service.apiPort }} 40 | maxTXWaitTime: {{ .Values.ethconnect.config.maxTXWaitTimeSec }} 41 | maxInFlight: {{ .Values.ethconnect.config.maxInFlight }} 42 | gasEstimationFactor: {{ .Values.ethconnect.config.gasEstimationFactor }} 43 | alwaysManageNonce: true 44 | {{- end }} 45 | -------------------------------------------------------------------------------- /charts/firefly/templates/ethconnect/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.ethconnect.enabled }} 20 | apiVersion: v1 21 | kind: Service 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-ethconnect 24 | labels: 25 | {{- include "firefly.ethconnectLabels" . | nindent 4 }} 26 | spec: 27 | type: {{ .Values.ethconnect.service.type }} 28 | ports: 29 | - port: {{ .Values.ethconnect.service.apiPort }} 30 | targetPort: http 31 | protocol: TCP 32 | name: http 33 | selector: 34 | {{- include "firefly.ethconnectSelectorLabels" . | nindent 4 }} 35 | {{- end }} 36 | -------------------------------------------------------------------------------- /charts/firefly/templates/ethconnect/statefulset.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.ethconnect.enabled }} 20 | apiVersion: apps/v1 21 | kind: StatefulSet 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-ethconnect 24 | labels: 25 | {{- include "firefly.ethconnectLabels" . | nindent 4 }} 26 | spec: 27 | replicas: 1 28 | serviceName: {{ include "firefly.fullname" . }}-ethconnect 29 | updateStrategy: 30 | type: RollingUpdate 31 | selector: 32 | matchLabels: 33 | {{- include "firefly.ethconnectSelectorLabels" . | nindent 6 }} 34 | template: 35 | metadata: 36 | annotations: 37 | checksum/config: {{ include (print $.Template.BasePath "/ethconnect/secret.yaml") . | sha256sum }} 38 | {{- with .Values.ethconnect.podAnnotations }} 39 | {{- toYaml . | nindent 8 }} 40 | {{- end }} 41 | labels: 42 | {{- include "firefly.ethconnectSelectorLabels" . | nindent 8 }} 43 | spec: 44 | {{- with .Values.ethconnect.imagePullSecrets }} 45 | imagePullSecrets: 46 | {{- toYaml . | nindent 8 }} 47 | {{- end }} 48 | securityContext: 49 | {{- toYaml .Values.ethconnect.podSecurityContext | nindent 8 }} 50 | {{- if .Values.ethconnect.initContainers }} 51 | initContainers: 52 | {{- tpl .Values.ethconnect.initContainers . | nindent 8 }} 53 | {{- end }} 54 | containers: 55 | - name: ethconnect 56 | securityContext: 57 | {{- toYaml .Values.ethconnect.securityContext | nindent 12 }} 58 | image: "{{ .Values.ethconnect.image.repository }}:{{ .Values.ethconnect.image.tag }}" 59 | imagePullPolicy: {{ .Values.ethconnect.image.pullPolicy }} 60 | env: 61 | - name: ETHCONNECT_CONFIGFILE 62 | value: /etc/ethconnect/config.yaml 63 | {{- if .Values.ethconnect.extraEnv }} 64 | {{- toYaml .Values.ethconnect.extraEnv | nindent 12 }} 65 | {{- end }} 66 | ports: 67 | - name: http 68 | containerPort: {{ .Values.ethconnect.service.apiPort }} 69 | protocol: TCP 70 | livenessProbe: 71 | tcpSocket: 72 | port: http 73 | initialDelaySeconds: 5 74 | failureThreshold: 5 75 | successThreshold: 1 76 | periodSeconds: 5 77 | readinessProbe: 78 | tcpSocket: 79 | port: http 80 | initialDelaySeconds: 5 81 | failureThreshold: 10 82 | successThreshold: 3 83 | periodSeconds: 3 84 | resources: 85 | {{- toYaml .Values.ethconnect.resources | nindent 12 }} 86 | volumeMounts: 87 | - mountPath: /var/run/ethconnect/abis 88 | subPath: abis 89 | name: ethconnect 90 | - mountPath: /var/run/ethconnect/events 91 | subPath: events 92 | name: ethconnect 93 | - mountPath: /etc/ethconnect/config.yaml 94 | name: config 95 | subPath: config.yaml 96 | {{- if .Values.ethconnect.extraContainers }} 97 | {{- tpl .Values.ethconnect.extraContainers . | nindent 8 }} 98 | {{- end }} 99 | {{- with .Values.ethconnect.nodeSelector }} 100 | nodeSelector: 101 | {{- toYaml . | nindent 8 }} 102 | {{- end }} 103 | {{- with .Values.ethconnect.affinity }} 104 | affinity: 105 | {{- toYaml . | nindent 8 }} 106 | {{- end }} 107 | {{- with .Values.ethconnect.tolerations }} 108 | tolerations: 109 | {{- toYaml . | nindent 8 }} 110 | {{- end }} 111 | volumes: 112 | - name: config 113 | secret: 114 | secretName: "{{ include "firefly.fullname" . }}-ethconnect-config" 115 | volumeClaimTemplates: 116 | - metadata: 117 | name: ethconnect 118 | {{- with .Values.ethconnect.persistentVolume }} 119 | {{- with .annotations }} 120 | annotations: 121 | {{- toYaml . | nindent 10 }} 122 | {{- end }} 123 | spec: 124 | accessModes: 125 | {{- toYaml .accessModes | nindent 10 }} 126 | storageClassName: {{ .storageClass }} 127 | resources: 128 | requests: 129 | storage: {{ .size }} 130 | {{- end }} 131 | {{- if .Values.ethconnect.extraVolumeClaimTemplates }} 132 | {{- tpl .Values.ethconnect.extraVolumeClaimTemplates . | nindent 4 }} 133 | {{- end }} 134 | {{- end }} -------------------------------------------------------------------------------- /charts/firefly/templates/sandbox/deployment.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.sandbox.enabled }} 20 | apiVersion: apps/v1 21 | kind: Deployment 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-sandbox 24 | labels: 25 | {{- include "firefly.sandboxLabels" . | nindent 4 }} 26 | spec: 27 | replicas: 1 28 | selector: 29 | matchLabels: 30 | {{- include "firefly.sandboxSelectorLabels" . | nindent 6 }} 31 | template: 32 | metadata: 33 | {{- with .Values.sandbox.podAnnotations }} 34 | annotations: 35 | {{- toYaml . | nindent 8 }} 36 | {{- end }} 37 | labels: 38 | {{- include "firefly.sandboxSelectorLabels" . | nindent 8 }} 39 | spec: 40 | {{- with .Values.sandbox.imagePullSecrets }} 41 | imagePullSecrets: 42 | {{- toYaml . | nindent 8 }} 43 | {{- end }} 44 | securityContext: 45 | {{- toYaml .Values.sandbox.podSecurityContext | nindent 8 }} 46 | containers: 47 | - name: {{ .Chart.Name }}-sandbox 48 | securityContext: 49 | {{- toYaml .Values.sandbox.securityContext | nindent 12 }} 50 | image: "{{ .Values.sandbox.image.repository }}:{{ .Values.sandbox.image.tag }}" 51 | imagePullPolicy: {{ .Values.sandbox.image.pullPolicy }} 52 | ports: 53 | - name: http 54 | containerPort: {{ .Values.sandbox.service.port }} 55 | protocol: TCP 56 | livenessProbe: 57 | httpGet: 58 | path: /api 59 | port: http 60 | successThreshold: 1 61 | failureThreshold: 2 62 | periodSeconds: 10 63 | timeoutSeconds: 1 64 | initialDelaySeconds: 5 65 | readinessProbe: 66 | httpGet: 67 | path: /api 68 | port: http 69 | successThreshold: 1 70 | failureThreshold: 4 71 | periodSeconds: 15 72 | timeoutSeconds: 2 73 | initialDelaySeconds: 15 74 | env: 75 | - name: SERVER_PORT 76 | value: {{ .Values.sandbox.service.port | quote }} 77 | - name: FF_ENDPOINT 78 | value: "http://{{ include "firefly.fullname" . }}:{{ .Values.core.service.httpPort }}" 79 | resources: 80 | {{- toYaml .Values.sandbox.resources | nindent 12 }} 81 | {{- with .Values.sandbox.nodeSelector }} 82 | nodeSelector: 83 | {{- toYaml . | nindent 8 }} 84 | {{- end }} 85 | {{- with .Values.sandbox.affinity }} 86 | affinity: 87 | {{- toYaml . | nindent 8 }} 88 | {{- end }} 89 | {{- with .Values.sandbox.tolerations }} 90 | tolerations: 91 | {{- toYaml . | nindent 8 }} 92 | {{- end }} 93 | {{- end }} -------------------------------------------------------------------------------- /charts/firefly/templates/sandbox/ingress.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.sandbox.ingress.enabled }} 20 | {{- $fullName := include "firefly.fullname" . -}} 21 | {{- $svcPort := .Values.sandbox.service.port -}} 22 | {{- if and .Values.sandbox.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} 23 | {{- if not (hasKey .Values.sandbox.ingress.annotations "kubernetes.io/ingress.class") }} 24 | {{- $_ := set .Values.sandbox.ingress.annotations "kubernetes.io/ingress.class" .Values.sandbox.ingress.className}} 25 | {{- end }} 26 | {{- end }} 27 | {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} 28 | apiVersion: networking.k8s.io/v1 29 | {{- else -}} 30 | apiVersion: networking.k8s.io/v1beta1 31 | {{- end }} 32 | kind: Ingress 33 | metadata: 34 | name: {{ $fullName }}-sandbox 35 | labels: 36 | {{- include "firefly.sandboxLabels" . | nindent 4 }} 37 | {{- with .Values.sandbox.ingress.annotations }} 38 | annotations: 39 | {{- toYaml . | nindent 4 }} 40 | {{- end }} 41 | spec: 42 | {{- if and .Values.sandbox.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} 43 | ingressClassName: {{ .Values.sandbox.ingress.className }} 44 | {{- end }} 45 | {{- if .Values.sandbox.ingress.tls }} 46 | tls: 47 | {{- range .Values.sandbox.ingress.tls }} 48 | - hosts: 49 | {{- range .hosts }} 50 | - {{ . | quote }} 51 | {{- end }} 52 | secretName: {{ .secretName }} 53 | {{- end }} 54 | {{- end }} 55 | rules: 56 | {{- range .Values.sandbox.ingress.hosts }} 57 | - host: {{ .host | quote }} 58 | http: 59 | paths: 60 | - path: / 61 | {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} 62 | pathType: Prefix 63 | {{- end }} 64 | backend: 65 | {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} 66 | service: 67 | name: {{ $fullName }}-sandbox 68 | port: 69 | number: {{ $svcPort }} 70 | {{- else }} 71 | serviceName: {{ $fullName }}-sandbox 72 | servicePort: {{ $svcPort }} 73 | {{- end }} 74 | {{- end }} 75 | {{- end }} 76 | -------------------------------------------------------------------------------- /charts/firefly/templates/sandbox/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | {{- if .Values.sandbox.enabled }} 20 | apiVersion: v1 21 | kind: Service 22 | metadata: 23 | name: {{ include "firefly.fullname" . }}-sandbox 24 | labels: 25 | {{- include "firefly.sandboxLabels" . | nindent 4 }} 26 | spec: 27 | type: {{ .Values.sandbox.service.type }} 28 | ports: 29 | - port: {{ .Values.sandbox.service.port }} 30 | targetPort: http 31 | protocol: TCP 32 | name: http 33 | selector: 34 | {{- include "firefly.sandboxSelectorLabels" . | nindent 4 }} 35 | {{- end }} -------------------------------------------------------------------------------- /charts/ipfs/Chart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright © 2024 Kaleido, Inc. 2 | # 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://swww.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | apiVersion: v2 18 | name: ipfs 19 | description: | 20 | A Helm chart for a private IPFS node for use in a FireFly multiparty namespace 21 | type: application 22 | appVersion: "0.27.2" 23 | version: "0.7.0" 24 | 25 | maintainers: 26 | - name: onelapahead 27 | email: hayden.fuss@kaleido.io 28 | - name: peterbroadhurst 29 | email: peter.broadhurst@kaleido.io 30 | - name: calbritt 31 | email: cari.albritton@kaleido.io 32 | -------------------------------------------------------------------------------- /charts/ipfs/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "ipfs.name" -}} 5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 | {{- end }} 7 | 8 | {{/* 9 | Create a default fully qualified app name. 10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 11 | If release name contains chart name it will be used as a full name. 12 | */}} 13 | {{- define "ipfs.fullname" -}} 14 | {{- if .Values.fullnameOverride }} 15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 16 | {{- else }} 17 | {{- $name := default .Chart.Name .Values.nameOverride }} 18 | {{- if contains $name .Release.Name }} 19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 20 | {{- else }} 21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{/* 27 | Create chart name and version as used by the chart label. 28 | */}} 29 | {{- define "ipfs.chart" -}} 30 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 31 | {{- end }} 32 | 33 | {{/* 34 | Common labels 35 | */}} 36 | {{- define "ipfs.labels" -}} 37 | helm.sh/chart: {{ include "ipfs.chart" . }} 38 | {{ include "ipfs.selectorLabels" . }} 39 | {{- if .Chart.AppVersion }} 40 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 41 | {{- end }} 42 | app.kubernetes.io/managed-by: {{ .Release.Service }} 43 | {{- end }} 44 | 45 | {{/* 46 | Selector labels 47 | */}} 48 | {{- define "ipfs.selectorLabels" -}} 49 | app.kubernetes.io/name: {{ include "ipfs.name" . }} 50 | app.kubernetes.io/instance: {{ .Release.Name }} 51 | app.kubernetes.io/component: evmconnect 52 | {{- end }} 53 | -------------------------------------------------------------------------------- /charts/ipfs/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: apps/v1 20 | kind: Deployment 21 | metadata: 22 | name: {{ include "ipfs.fullname" . }} 23 | labels: 24 | {{- include "ipfs.labels" . | nindent 4 }} 25 | spec: 26 | replicas: 1 27 | selector: 28 | matchLabels: 29 | {{- include "ipfs.selectorLabels" . | nindent 6 }} 30 | template: 31 | metadata: 32 | {{- with .Values.podAnnotations }} 33 | annotations: 34 | {{- toYaml . | nindent 8 }} 35 | {{- end }} 36 | labels: 37 | {{- include "ipfs.selectorLabels" . | nindent 8 }} 38 | spec: 39 | {{- with .Values.imagePullSecrets }} 40 | imagePullSecrets: 41 | {{- toYaml . | nindent 8 }} 42 | {{- end }} 43 | securityContext: 44 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 45 | containers: 46 | - name: {{ .Chart.Name }}-ipfs 47 | securityContext: 48 | {{- toYaml .Values.securityContext | nindent 12 }} 49 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" 50 | imagePullPolicy: {{ .Values.image.pullPolicy }} 51 | ports: 52 | - name: gateway 53 | containerPort: {{ .Values.service.gatewayPort }} 54 | protocol: TCP 55 | - name: api 56 | containerPort: {{ .Values.service.apiPort }} 57 | protocol: TCP 58 | livenessProbe: 59 | tcpSocket: 60 | port: gateway 61 | successThreshold: 1 62 | failureThreshold: 4 63 | periodSeconds: 15 64 | timeoutSeconds: 2 65 | initialDelaySeconds: 15 66 | readinessProbe: 67 | tcpSocket: 68 | port: gateway 69 | successThreshold: 1 70 | failureThreshold: 4 71 | periodSeconds: 15 72 | timeoutSeconds: 2 73 | initialDelaySeconds: 15 74 | env: 75 | - name: LIBP2P_FORCE_PNET 76 | value: "1" 77 | - name: IPFS_SWARM_KEY 78 | value: "/key/swarm/psk/1.0.0/\n/base16/\n4c7bb736979e508ac819cdc3f498cde999b921c036f7560028aa159591e6f939" 79 | - name: IPFS_PATH 80 | value: "/data/ipfs" 81 | resources: 82 | {{- toYaml .Values.resources | nindent 12 }} 83 | {{- with .Values.nodeSelector }} 84 | nodeSelector: 85 | {{- toYaml . | nindent 8 }} 86 | {{- end }} 87 | {{- with .Values.affinity }} 88 | affinity: 89 | {{- toYaml . | nindent 8 }} 90 | {{- end }} 91 | {{- with .Values.tolerations }} 92 | tolerations: 93 | {{- toYaml . | nindent 8 }} 94 | {{- end }} 95 | -------------------------------------------------------------------------------- /charts/ipfs/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: {{ include "ipfs.fullname" . }}-ipfs 23 | labels: 24 | {{- include "ipfs.labels" . | nindent 4 }} 25 | spec: 26 | type: {{ .Values.service.type }} 27 | ports: 28 | - port: {{ .Values.service.gatewayPort }} 29 | targetPort: gateway 30 | protocol: TCP 31 | name: http-gateway 32 | - port: {{ .Values.service.apiPort }} 33 | targetPort: api 34 | protocol: TCP 35 | name: http-api 36 | selector: 37 | {{- include "ipfs.selectorLabels" . | nindent 4 }} 38 | -------------------------------------------------------------------------------- /charts/ipfs/values.yaml: -------------------------------------------------------------------------------- 1 | image: 2 | repository: ipfs/kubo 3 | pullPolicy: IfNotPresent 4 | tag: "v0.27.0" 5 | 6 | service: 7 | type: ClusterIP 8 | apiPort: 5001 9 | gatewayPort: 8080 10 | 11 | podAnnotations: {} 12 | -------------------------------------------------------------------------------- /charts/license.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Copyright © 2024 Kaleido, Inc. 3 | 4 | SPDX-License-Identifier: Apache-2.0 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://swww.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */}} 18 | -------------------------------------------------------------------------------- /charts/lintconf.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | rules: 3 | braces: 4 | min-spaces-inside: 0 5 | max-spaces-inside: 0 6 | min-spaces-inside-empty: -1 7 | max-spaces-inside-empty: -1 8 | brackets: 9 | min-spaces-inside: 0 10 | max-spaces-inside: 0 11 | min-spaces-inside-empty: -1 12 | max-spaces-inside-empty: -1 13 | colons: 14 | max-spaces-before: 0 15 | max-spaces-after: 1 16 | commas: 17 | max-spaces-before: 0 18 | min-spaces-after: 1 19 | max-spaces-after: 1 20 | comments: 21 | require-starting-space: true 22 | min-spaces-from-content: 2 23 | document-end: disable 24 | document-start: disable # No --- to start a file 25 | empty-lines: 26 | max: 2 27 | max-start: 0 28 | max-end: 0 29 | hyphens: 30 | max-spaces-after: 1 31 | indentation: 32 | spaces: consistent 33 | indent-sequences: whatever # - list indentation will handle both indentation and without 34 | check-multi-line-strings: false 35 | key-duplicates: enable 36 | line-length: disable # Lines can be any length 37 | new-line-at-end-of-file: disable 38 | new-lines: 39 | type: unix 40 | trailing-spaces: enable 41 | truthy: 42 | level: warning 43 | -------------------------------------------------------------------------------- /hack/Firefly.json: -------------------------------------------------------------------------------- 1 | { 2 | "_format": "hh-sol-artifact-1", 3 | "contractName": "Firefly", 4 | "sourceName": "contracts/Firefly.sol", 5 | "abi": [ 6 | { 7 | "anonymous": false, 8 | "inputs": [ 9 | { 10 | "indexed": false, 11 | "internalType": "address", 12 | "name": "author", 13 | "type": "address" 14 | }, 15 | { 16 | "indexed": false, 17 | "internalType": "uint256", 18 | "name": "timestamp", 19 | "type": "uint256" 20 | }, 21 | { 22 | "indexed": false, 23 | "internalType": "string", 24 | "name": "action", 25 | "type": "string" 26 | }, 27 | { 28 | "indexed": false, 29 | "internalType": "bytes32", 30 | "name": "uuids", 31 | "type": "bytes32" 32 | }, 33 | { 34 | "indexed": false, 35 | "internalType": "bytes32", 36 | "name": "batchHash", 37 | "type": "bytes32" 38 | }, 39 | { 40 | "indexed": false, 41 | "internalType": "string", 42 | "name": "payloadRef", 43 | "type": "string" 44 | }, 45 | { 46 | "indexed": false, 47 | "internalType": "bytes32[]", 48 | "name": "contexts", 49 | "type": "bytes32[]" 50 | } 51 | ], 52 | "name": "BatchPin", 53 | "type": "event" 54 | }, 55 | { 56 | "inputs": [ 57 | { 58 | "internalType": "string", 59 | "name": "action", 60 | "type": "string" 61 | }, 62 | { 63 | "internalType": "string", 64 | "name": "payload", 65 | "type": "string" 66 | } 67 | ], 68 | "name": "networkAction", 69 | "outputs": [], 70 | "stateMutability": "nonpayable", 71 | "type": "function" 72 | }, 73 | { 74 | "inputs": [], 75 | "name": "networkVersion", 76 | "outputs": [ 77 | { 78 | "internalType": "uint8", 79 | "name": "", 80 | "type": "uint8" 81 | } 82 | ], 83 | "stateMutability": "pure", 84 | "type": "function" 85 | }, 86 | { 87 | "inputs": [ 88 | { 89 | "internalType": "bytes32", 90 | "name": "uuids", 91 | "type": "bytes32" 92 | }, 93 | { 94 | "internalType": "bytes32", 95 | "name": "batchHash", 96 | "type": "bytes32" 97 | }, 98 | { 99 | "internalType": "string", 100 | "name": "payloadRef", 101 | "type": "string" 102 | }, 103 | { 104 | "internalType": "bytes32[]", 105 | "name": "contexts", 106 | "type": "bytes32[]" 107 | } 108 | ], 109 | "name": "pinBatch", 110 | "outputs": [], 111 | "stateMutability": "nonpayable", 112 | "type": "function" 113 | }, 114 | { 115 | "inputs": [ 116 | { 117 | "internalType": "bytes", 118 | "name": "data", 119 | "type": "bytes" 120 | } 121 | ], 122 | "name": "pinBatchData", 123 | "outputs": [], 124 | "stateMutability": "nonpayable", 125 | "type": "function" 126 | } 127 | ], 128 | "bytecode": "0x608060405234801561001057600080fd5b50610a0c806100206000396000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c806348ce1dcc146100515780635766032e1461006d57806397eacfe614610089578063fb9066c1146100a7575b600080fd5b61006b60048036038101906100669190610329565b6100c3565b005b610087600480360381019061008291906103bc565b61010a565b005b610091610178565b60405161009e9190610744565b60405180910390f35b6100c160048036038101906100bc9190610401565b610181565b005b7f805721bc246bccc732581be0c0aa2dd8f7ec93e97ba4b307be84428c98b0a12f3242868686866040516100fc96959493929190610640565b60405180910390a150505050565b600080606080858581019061011f9190610329565b809450819550829650839750505050507f805721bc246bccc732581be0c0aa2dd8f7ec93e97ba4b307be84428c98b0a12f324286868686604051610168969594939291906106c2565b60405180910390a1505050505050565b60006002905090565b60607f805721bc246bccc732581be0c0aa2dd8f7ec93e97ba4b307be84428c98b0a12f32428560008087876040516101bf97969594939291906105bc565b60405180910390a1505050565b60006101df6101da84610784565b61075f565b905080838252602082019050828560208602820111156101fe57600080fd5b60005b8581101561022e578161021488826102a0565b845260208401935060208301925050600181019050610201565b5050509392505050565b600061024b610246846107b0565b61075f565b90508281526020810184848401111561026357600080fd5b61026e8482856108ad565b509392505050565b600082601f83011261028757600080fd5b81356102978482602086016101cc565b91505092915050565b6000813590506102af816109bf565b92915050565b60008083601f8401126102c757600080fd5b8235905067ffffffffffffffff8111156102e057600080fd5b6020830191508360018202830111156102f857600080fd5b9250929050565b600082601f83011261031057600080fd5b8135610320848260208601610238565b91505092915050565b6000806000806080858703121561033f57600080fd5b600061034d878288016102a0565b945050602061035e878288016102a0565b935050604085013567ffffffffffffffff81111561037b57600080fd5b610387878288016102ff565b925050606085013567ffffffffffffffff8111156103a457600080fd5b6103b087828801610276565b91505092959194509250565b600080602083850312156103cf57600080fd5b600083013567ffffffffffffffff8111156103e957600080fd5b6103f5858286016102b5565b92509250509250929050565b6000806040838503121561041457600080fd5b600083013567ffffffffffffffff81111561042e57600080fd5b61043a858286016102ff565b925050602083013567ffffffffffffffff81111561045757600080fd5b610463858286016102ff565b9150509250929050565b600061047983836104f2565b60208301905092915050565b61048e81610836565b82525050565b600061049f826107f1565b6104a98185610814565b93506104b4836107e1565b8060005b838110156104e55781516104cc888261046d565b97506104d783610807565b9250506001810190506104b8565b5085935050505092915050565b6104fb81610848565b82525050565b61050a81610848565b82525050565b61051981610893565b82525050565b600061052a826107fc565b6105348185610825565b93506105448185602086016108bc565b61054d8161094f565b840191505092915050565b6000610565601183610825565b91506105708261096d565b602082019050919050565b6000610588601b83610825565b915061059382610996565b602082019050919050565b6105a78161087c565b82525050565b6105b681610886565b82525050565b600060e0820190506105d1600083018a610485565b6105de602083018961059e565b81810360408301526105f0818861051f565b90506105ff6060830187610510565b61060c6080830186610510565b81810360a083015261061e818561051f565b905081810360c08301526106328184610494565b905098975050505050505050565b600060e0820190506106556000830189610485565b610662602083018861059e565b818103604083015261067381610558565b90506106826060830187610501565b61068f6080830186610501565b81810360a08301526106a1818561051f565b905081810360c08301526106b58184610494565b9050979650505050505050565b600060e0820190506106d76000830189610485565b6106e4602083018861059e565b81810360408301526106f58161057b565b90506107046060830187610501565b6107116080830186610501565b81810360a0830152610723818561051f565b905081810360c08301526107378184610494565b9050979650505050505050565b600060208201905061075960008301846105ad565b92915050565b600061076961077a565b905061077582826108ef565b919050565b6000604051905090565b600067ffffffffffffffff82111561079f5761079e610920565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156107cb576107ca610920565b5b6107d48261094f565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006108418261085c565b9050919050565b6000819050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006108a66108a183610852565b610960565b9050919050565b82818337600083830152505050565b60005b838110156108da5780820151818401526020810190506108bf565b838111156108e9576000848401525b50505050565b6108f88261094f565b810181811067ffffffffffffffff8211171561091757610916610920565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160001b9050919050565b7f66697265666c793a62617463685f70696e000000000000000000000000000000600082015250565b7f66697265666c793a636f6e74726163745f696e766f6b655f70696e0000000000600082015250565b6109c881610848565b81146109d357600080fd5b5056fea26469706673582212202f2120ca7260e76363bd5184e6ff539696c4ed05b5fa24fffe6ffc71e141dacf64736f6c63430008040033", 129 | "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806348ce1dcc146100515780635766032e1461006d57806397eacfe614610089578063fb9066c1146100a7575b600080fd5b61006b60048036038101906100669190610329565b6100c3565b005b610087600480360381019061008291906103bc565b61010a565b005b610091610178565b60405161009e9190610744565b60405180910390f35b6100c160048036038101906100bc9190610401565b610181565b005b7f805721bc246bccc732581be0c0aa2dd8f7ec93e97ba4b307be84428c98b0a12f3242868686866040516100fc96959493929190610640565b60405180910390a150505050565b600080606080858581019061011f9190610329565b809450819550829650839750505050507f805721bc246bccc732581be0c0aa2dd8f7ec93e97ba4b307be84428c98b0a12f324286868686604051610168969594939291906106c2565b60405180910390a1505050505050565b60006002905090565b60607f805721bc246bccc732581be0c0aa2dd8f7ec93e97ba4b307be84428c98b0a12f32428560008087876040516101bf97969594939291906105bc565b60405180910390a1505050565b60006101df6101da84610784565b61075f565b905080838252602082019050828560208602820111156101fe57600080fd5b60005b8581101561022e578161021488826102a0565b845260208401935060208301925050600181019050610201565b5050509392505050565b600061024b610246846107b0565b61075f565b90508281526020810184848401111561026357600080fd5b61026e8482856108ad565b509392505050565b600082601f83011261028757600080fd5b81356102978482602086016101cc565b91505092915050565b6000813590506102af816109bf565b92915050565b60008083601f8401126102c757600080fd5b8235905067ffffffffffffffff8111156102e057600080fd5b6020830191508360018202830111156102f857600080fd5b9250929050565b600082601f83011261031057600080fd5b8135610320848260208601610238565b91505092915050565b6000806000806080858703121561033f57600080fd5b600061034d878288016102a0565b945050602061035e878288016102a0565b935050604085013567ffffffffffffffff81111561037b57600080fd5b610387878288016102ff565b925050606085013567ffffffffffffffff8111156103a457600080fd5b6103b087828801610276565b91505092959194509250565b600080602083850312156103cf57600080fd5b600083013567ffffffffffffffff8111156103e957600080fd5b6103f5858286016102b5565b92509250509250929050565b6000806040838503121561041457600080fd5b600083013567ffffffffffffffff81111561042e57600080fd5b61043a858286016102ff565b925050602083013567ffffffffffffffff81111561045757600080fd5b610463858286016102ff565b9150509250929050565b600061047983836104f2565b60208301905092915050565b61048e81610836565b82525050565b600061049f826107f1565b6104a98185610814565b93506104b4836107e1565b8060005b838110156104e55781516104cc888261046d565b97506104d783610807565b9250506001810190506104b8565b5085935050505092915050565b6104fb81610848565b82525050565b61050a81610848565b82525050565b61051981610893565b82525050565b600061052a826107fc565b6105348185610825565b93506105448185602086016108bc565b61054d8161094f565b840191505092915050565b6000610565601183610825565b91506105708261096d565b602082019050919050565b6000610588601b83610825565b915061059382610996565b602082019050919050565b6105a78161087c565b82525050565b6105b681610886565b82525050565b600060e0820190506105d1600083018a610485565b6105de602083018961059e565b81810360408301526105f0818861051f565b90506105ff6060830187610510565b61060c6080830186610510565b81810360a083015261061e818561051f565b905081810360c08301526106328184610494565b905098975050505050505050565b600060e0820190506106556000830189610485565b610662602083018861059e565b818103604083015261067381610558565b90506106826060830187610501565b61068f6080830186610501565b81810360a08301526106a1818561051f565b905081810360c08301526106b58184610494565b9050979650505050505050565b600060e0820190506106d76000830189610485565b6106e4602083018861059e565b81810360408301526106f58161057b565b90506107046060830187610501565b6107116080830186610501565b81810360a0830152610723818561051f565b905081810360c08301526107378184610494565b9050979650505050505050565b600060208201905061075960008301846105ad565b92915050565b600061076961077a565b905061077582826108ef565b919050565b6000604051905090565b600067ffffffffffffffff82111561079f5761079e610920565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156107cb576107ca610920565b5b6107d48261094f565b9050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006108418261085c565b9050919050565b6000819050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006108a66108a183610852565b610960565b9050919050565b82818337600083830152505050565b60005b838110156108da5780820151818401526020810190506108bf565b838111156108e9576000848401525b50505050565b6108f88261094f565b810181811067ffffffffffffffff8211171561091757610916610920565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160001b9050919050565b7f66697265666c793a62617463685f70696e000000000000000000000000000000600082015250565b7f66697265666c793a636f6e74726163745f696e766f6b655f70696e0000000000600082015250565b6109c881610848565b81146109d357600080fd5b5056fea26469706673582212202f2120ca7260e76363bd5184e6ff539696c4ed05b5fa24fffe6ffc71e141dacf64736f6c63430008040033", 130 | "linkReferences": {}, 131 | "deployedLinkReferences": {} 132 | } 133 | -------------------------------------------------------------------------------- /hack/enforce-chart-conventions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | failed=0 4 | for yamlTemplate in $(find ./charts -regex '^\.\/charts\/.*\/templates\/[^\/]*.*\/*.*\.yaml'); do 5 | kind=$(cat $yamlTemplate | grep -e '^kind:' | awk '{ printf("%s\n", $2) }' | tr '[:upper:]' '[:lower:]') 6 | 7 | case "$yamlTemplate" in 8 | *"./charts/besu-"*) 9 | # Ingore the besu charts as they were just copied over from their repo 10 | ;; 11 | *) 12 | if ! cat $yamlTemplate | grep "$(cat ./charts/license.tpl)" > /dev/null; then 13 | echo "ERROR: $yamlTemplate filename does not start with the license" 14 | failed=$(($failed+1)) 15 | fi 16 | ;; 17 | esac 18 | done 19 | 20 | if [[ $failed -gt 0 ]]; then 21 | exit 1 22 | fi 23 | -------------------------------------------------------------------------------- /hack/multiparty-values.yaml: -------------------------------------------------------------------------------- 1 | config: 2 | multipartyEnabled: true 3 | fireflyContracts: [] 4 | -------------------------------------------------------------------------------- /hack/multiparty.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # set -x 3 | 4 | FORWARDED_PORT=5555 5 | 6 | script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) 7 | cd "$script_path" 8 | 9 | # Read the compiled bytecode and ABI for the batch pin contract 10 | ABI=$(jq -r -c .abi ./Firefly.json) 11 | BYTECODE=$(jq -r -c .bytecode ./Firefly.json) 12 | 13 | # Set up a port forward to the service in the background. We will kill this before the end of the script 14 | kubectl port-forward svc/firefly $FORWARDED_PORT:http & 15 | PORTFORWARD_PID=$! 16 | sleep 1 17 | 18 | echo "Deploying contract..." 19 | 20 | # Use FireFly's API to deploy the multiparty contract 21 | RESPONSE=$(curl --location "http://127.0.0.1:$FORWARDED_PORT/api/v1/namespaces/default/contracts/deploy?confirm=true" \ 22 | --header 'Content-Type: application/json' \ 23 | --data '{ 24 | "definition": '$ABI', 25 | "contract": "'$BYTECODE'" 26 | }') 27 | 28 | kill $PORTFORWARD_PID 29 | 30 | # Parse the resposne from FireFly to get the address and block number in which the contract was deployed 31 | ADDRESS=$(jq -r .output.contractLocation.address <<< $RESPONSE) 32 | BLOCK_NUMBER=$(jq -r .output.protocolId <<< $RESPONSE | cut -d '/' -f1 | sed 's/^0*//') 33 | 34 | echo ADDRESS: $ADDRESS 35 | echo BLOCK_NUMBER: $BLOCK_NUMBER 36 | 37 | # Append to the list of deployed multiparty contracts 38 | yq -i '.config.fireflyContracts += {"address": "'$ADDRESS'", "firstEvent": "'$BLOCK_NUMBER'"} | .config.fireflyContracts.[].address style="double"' ./multiparty-values.yaml 39 | 40 | # Apply the new values to the FireFly config 41 | helm upgrade --install firefly ../charts/firefly -f ../charts/firefly/local-kind-values.yaml -f ./multiparty-values.yaml --wait 42 | 43 | 44 | # Wait here until FF comes back up after the config change 45 | kubectl wait --for=condition=ready pod/firefly-0 46 | 47 | # Set up a port forward to the service in the background. We will kill this before the end of the script 48 | kubectl port-forward svc/firefly $FORWARDED_PORT:http & 49 | PORTFORWARD_PID=$! 50 | sleep 1 51 | 52 | # Check to see if multiparty mode has already been enabled - we will need this later in the script 53 | ORG_REGISTERED=$(curl http://127.0.0.1:$FORWARDED_PORT/api/v1/namespaces/default/status | jq .org.registered) 54 | 55 | echo $ORG_REGISTERED 56 | if [ $ORG_REGISTERED == "true" ] 57 | then 58 | echo "Switching to new contract at $ADDRESS from block $BLOCK_NUMBER..." 59 | curl --location "http://127.0.0.1:$FORWARDED_PORT/api/v1/network/action" \ 60 | --header 'Content-Type: application/json' \ 61 | --data '{"type": "terminate"}' 62 | else 63 | echo "Registering org..." 64 | curl --location "http://127.0.0.1:$FORWARDED_PORT/api/v1/network/organizations/self?confirm=true" \ 65 | --header 'Content-Type: application/json' \ 66 | --data '{}' 67 | echo "Registering node..." 68 | curl --location "http://127.0.0.1:$FORWARDED_PORT/api/v1/network/nodes/self?confirm=true" \ 69 | --header 'Content-Type: application/json' \ 70 | --data '{}' 71 | fi 72 | 73 | kill $PORTFORWARD_PID 74 | echo "done" -------------------------------------------------------------------------------- /img/helm_chart_deployment_architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyperledger/firefly-helm-charts/c3261be67af23f8cb7114d48387389a6a7063b2d/img/helm_chart_deployment_architecture.jpg -------------------------------------------------------------------------------- /kind-config.yml: -------------------------------------------------------------------------------- 1 | # three node (two workers) cluster config 2 | kind: Cluster 3 | apiVersion: kind.x-k8s.io/v1alpha4 4 | nodes: 5 | - role: control-plane 6 | - role: worker 7 | - role: worker 8 | -------------------------------------------------------------------------------- /manifests/mtls-cert.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: cert-manager.io/v1 3 | kind: Certificate 4 | metadata: 5 | name: firefly-mtls 6 | spec: 7 | issuerRef: 8 | name: selfsigned-ca 9 | kind: ClusterIssuer 10 | secretName: firefly-mtls-tls 11 | commonName: firefly-mtls 12 | dnsNames: 13 | - firefly.default.svc 14 | -------------------------------------------------------------------------------- /manifests/tls-issuers.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: cert-manager.io/v1 3 | kind: ClusterIssuer 4 | metadata: 5 | name: selfsigned 6 | spec: 7 | selfSigned: {} 8 | --- 9 | apiVersion: cert-manager.io/v1 10 | kind: Certificate 11 | metadata: 12 | name: selfsigned-ca 13 | spec: 14 | issuerRef: 15 | name: selfsigned 16 | kind: ClusterIssuer 17 | isCA: true 18 | secretName: selfsigned-ca-tls 19 | commonName: selfsigned-ca 20 | --- 21 | apiVersion: cert-manager.io/v1 22 | kind: ClusterIssuer 23 | metadata: 24 | name: selfsigned-ca 25 | spec: 26 | ca: 27 | secretName: selfsigned-ca-tls 28 | -------------------------------------------------------------------------------- /values/genesis-besu.yml: -------------------------------------------------------------------------------- 1 | --- 2 | quorumFlags: 3 | removeGenesisOnDelete: false 4 | 5 | cluster: 6 | provider: local # choose from: local | aws | azure 7 | cloudNativeServices: false 8 | 9 | # the raw Genesis config 10 | # rawGenesisConfig.blockchain.nodes set the number of validators/signers 11 | rawGenesisConfig: 12 | genesis: 13 | config: 14 | chainId: 1337 15 | algorithm: 16 | consensus: qbft # choose from: ibft2 | qbft | clique 17 | blockperiodseconds: 5 18 | epochlength: 30000 19 | requesttimeoutseconds: 20 20 | gasLimit: "0x1fffffffffffff" 21 | difficulty: "0x1" 22 | coinbase: "0x0000000000000000000000000000000000000000" 23 | includeQuickStartAccounts: false # set to true if you would like to use the quorum-dev-quickstart test accounts. This setting will be forced false if cloudNativeServices is set to true which is assuming a prod environment 24 | blockchain: 25 | nodes: 26 | generate: true 27 | count: 1 28 | accountPassword: "password" 29 | -------------------------------------------------------------------------------- /values/monitoring/alerting-besu-nodes.yml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: monitoring.coreos.com/v1 3 | kind: PrometheusRule 4 | metadata: 5 | labels: 6 | app: besu 7 | name: besu-alerts 8 | namespace: default 9 | spec: 10 | groups: 11 | - name: besu-chain-stalled 12 | rules: 13 | - alert: BesuChainStalled 14 | annotations: 15 | description: Besu Chain behind more than 1 minute ({{ $value }} seconds) 16 | summary: Besu Chain behind more than 1 minute 17 | expr: time() - max (besu_blockchain_chain_head_timestamp) by (value) > 60 18 | for: 1m 19 | labels: 20 | severity: critical -------------------------------------------------------------------------------- /values/validator.yml: -------------------------------------------------------------------------------- 1 | --- 2 | quorumFlags: 3 | privacy: false 4 | removeKeysOnDelete: false 5 | isBootnode: false # Besu only, set this to true if this node is a bootnode 6 | usesBootnodes: false # Besu only, set this to true if the network you are connecting to use a bootnode/s that are deployed in the cluster 7 | 8 | cluster: 9 | provider: local # choose from: local | aws | azure 10 | cloudNativeServices: false 11 | reclaimPolicy: Delete # set to either Retain or Delete; note that PVCs and PVs will still exist after a 'helm delete'. Setting to Retain will keep volumes even if PVCs/PVs are deleted in kubernetes. Setting to Delete will remove volumes from EC2 EBS when PVC is deleted 12 | 13 | node: 14 | besu: 15 | envBesuOpts: "" 16 | metrics: 17 | serviceMonitorEnabled: true 18 | resources: 19 | cpuLimit: 1 20 | cpuRequest: 0.5 21 | memLimit: "2G" 22 | memRequest: "1G" 23 | --------------------------------------------------------------------------------