├── .basic_services ├── .bootstrap_services ├── .dockerignore ├── .editorconfig ├── .env ├── .github ├── CODEOWNERS ├── logo.svg └── workflows │ └── dco.yml ├── .gitignore ├── .int_test.env ├── .services ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── bin ├── addCert.sh ├── config.sh ├── helper.sh ├── passwd.exp ├── resolve.sh └── tick.sh ├── docs ├── basenet.md ├── faq.md ├── http_gate.md ├── ir.md ├── macos.md ├── morph.md ├── notary.md ├── rest_gate.md ├── s3_gate.md └── storage.md ├── frostfs-adm.yml ├── frostfs_config.mk ├── help.mk ├── services ├── basenet │ ├── .env │ ├── .hosts │ ├── .int_test.env │ └── docker-compose.yml ├── http_gate │ ├── .env │ ├── .hosts │ ├── .http.env │ ├── .int_test.env │ ├── cfg │ │ └── config.yml │ ├── docker-compose.yml │ ├── node.key │ └── wallet.json ├── ir │ ├── .env │ ├── .hosts │ ├── .int_test.env │ ├── .ir.env │ ├── artifacts.mk │ ├── az.json │ ├── az.key │ ├── cfg │ │ └── config.yml │ ├── contract.json │ ├── docker-compose.yml │ ├── healthcheck.sh │ └── prepare.mk ├── morph_chain │ ├── .env │ ├── .hosts │ ├── .int_test.env │ ├── artifacts.mk │ ├── config.yml │ ├── docker-compose.yml │ ├── node-wallet.json │ └── protocol.privnet.yml ├── nats │ ├── .env │ ├── .hosts │ ├── .int_test.env │ ├── artifacts.mk │ ├── docker-compose.yml │ ├── generate_cert.sh │ └── nats.conf ├── rest_gate │ ├── .env │ ├── .hosts │ ├── .int_test.env │ ├── cfg │ │ └── config.yml │ ├── docker-compose.yml │ └── wallet.json ├── s3_gate │ ├── .env │ ├── .hosts │ ├── .int_test.env │ ├── .s3.env │ ├── cfg │ │ └── config.yml │ ├── docker-compose.yml │ ├── tls.crt │ ├── tls.key │ └── wallet.json └── storage │ ├── .env │ ├── .hosts │ ├── .int_test.env │ ├── .storage.env │ ├── artifacts.mk │ ├── cfg │ └── config.yml │ ├── cli-cfg.yml │ ├── docker-compose.yml │ ├── generate_cert.sh │ ├── healthcheck.sh │ ├── prepare.mk │ ├── wallet01.json │ ├── wallet02.json │ ├── wallet03.json │ └── wallet04.json └── wallets ├── wallet.json └── wallet.key /.basic_services: -------------------------------------------------------------------------------- 1 | # Services start/stop order 2 | # Will start from top to bottom and stop in reverse 3 | nats 4 | ir 5 | storage 6 | -------------------------------------------------------------------------------- /.bootstrap_services: -------------------------------------------------------------------------------- 1 | # Services start/stop order 2 | # Will start from top to bottom and stop in reverse 3 | basenet 4 | morph_chain 5 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .docker 2 | .github 3 | vendor 4 | tmp 5 | .secrets 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = false 8 | 9 | [Makefile] 10 | indent_style = tab 11 | 12 | [*.conf] 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.{yml,yaml}] 17 | indent_style = space 18 | indent_size = 2 19 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # Basenet settings 2 | LOCAL_DOMAIN=frostfs.devenv 3 | IPV4_PREFIX=192.168.130 4 | CA_CERTS_TRUSTED_STORE=/etc/ssl/certs 5 | 6 | # Bastion image 7 | BASTION_VERSION=10 8 | BASTION_IMAGE=debian 9 | 10 | # NeoGo privnet 11 | NEOGO_VERSION=0.99.4 12 | NEOGO_IMAGE=nspccdev/neo-go 13 | 14 | # FrostFS InnerRing nodes 15 | IR_VERSION=5ffa8268 16 | IR_IMAGE=truecloudlab/frostfs-ir 17 | 18 | # FrostFS Storage nodes 19 | NODE_VERSION=5ffa8268 20 | NODE_IMAGE=truecloudlab/frostfs-storage 21 | 22 | # NATS Server 23 | NATS_VERSION=2.7.2 24 | NATS_IMAGE=nats 25 | 26 | # HTTP Gate 27 | HTTP_GW_VERSION=6abd500b 28 | HTTP_GW_IMAGE=truecloudlab/frostfs-http-gw 29 | 30 | # REST Gate 31 | REST_GW_VERSION=c9c85e90 32 | REST_GW_IMAGE=truecloudlab/frostfs-rest-gw 33 | 34 | # S3 Gate 35 | S3_GW_VERSION=000d9ed4 36 | S3_GW_IMAGE=truecloudlab/frostfs-s3-gw 37 | 38 | # FrostFS LOCODE database 39 | LOCODE_DB_URL=https://github.com/nspcc-dev/neofs-locode-db/releases/download/v0.3.0/locode_db.gz 40 | #LOCODE_DB_PATH=/path/to/locode_db 41 | 42 | # FrostFS CLI binary 43 | FROSTFS_CLI_URL=https://http.t5.fs.neo.org/AQgse8bPCZx4zScMuAKxowJdZPbKHp8NDcp15o6VUNmk/C6BNLpYg5gWLHp3DrXozSxxGLDahBuSBCyJoYSSR1M3Q 44 | #FROSTFS_CLI_PATH=/path/to/frostfs-cli-binary 45 | 46 | # FrostFS ADM tool binary 47 | FROSTFS_ADM_VERSION=e3554425 48 | FROSTFS_ADM_URL=https://http.t5.fs.neo.org/AQgse8bPCZx4zScMuAKxowJdZPbKHp8NDcp15o6VUNmk/sXZxy9vbFyJiLhN9qTSXozXK7SN9H8ZC6dpvAt59Zaj 49 | #FROSTFS_ADM_PATH=/path/to/frostfs-adm-binary 50 | 51 | # Compiled FrostFS Smart Contracts 52 | FROSTFS_CONTRACTS_VERSION=4f3c08f5 53 | FROSTFS_CONTRACTS_URL=https://http.t5.fs.neo.org/AQgse8bPCZx4zScMuAKxowJdZPbKHp8NDcp15o6VUNmk/c1nGtturFrSeygYP3AyNHDDLNbs7HhJiH2BQkgZxEmZ 54 | #FROSTFS_CONTRACTS_PATH=/path/to/unpacked/frostfs-contracts-dir 55 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @alexvanin @fyrchik 2 | -------------------------------------------------------------------------------- /.github/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | 28 | 32 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 50 | 56 | 59 | 60 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /.github/workflows/dco.yml: -------------------------------------------------------------------------------- 1 | name: DCO check 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | commits_check_job: 10 | runs-on: ubuntu-latest 11 | name: Commits Check 12 | steps: 13 | - name: Get PR Commits 14 | id: 'get-pr-commits' 15 | uses: tim-actions/get-pr-commits@master 16 | with: 17 | token: ${{ secrets.GITHUB_TOKEN }} 18 | - name: DCO Check 19 | uses: tim-actions/dco@master 20 | with: 21 | commits: ${{ steps.get-pr-commits.outputs.commits }} 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE 2 | .idea 3 | .vscode 4 | 5 | # Vendoring 6 | vendor 7 | 8 | temp 9 | tmp 10 | 11 | .secrets 12 | sites/* 13 | !sites/.gitkeep 14 | 15 | # Runtime generation keys 16 | services/storage/*tls.crt 17 | services/storage/*tls.key 18 | services/nats/*.pem 19 | -------------------------------------------------------------------------------- /.int_test.env: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrueCloudLab/frostfs-dev-env/37507199e2909ee0ca0cd10703f9f9622e1315b0/.int_test.env -------------------------------------------------------------------------------- /.services: -------------------------------------------------------------------------------- 1 | # Services start/stop order 2 | # Will start from top to bottom and stop in reverse 3 | http_gate 4 | s3_gate 5 | rest_gate 6 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution guide 2 | 3 | First, thank you for contributing! We love and encourage pull requests from 4 | everyone. Please follow the guidelines: 5 | 6 | - Check the open [issues](https://github.com/TrueCloudLab/frostfs-dev-env/issues) and 7 | [pull requests](https://github.com/TrueCloudLab/frostfs-dev-env/pulls) for existing 8 | discussions. 9 | 10 | - Open an issue first, to discuss a new feature or enhancement. 11 | 12 | - Open a pull request, and reference the relevant issue(s). 13 | 14 | - Make sure your commits are logically separated and have good comments 15 | explaining the details of your change. 16 | 17 | - After receiving feedback, amend your commits or add new ones as 18 | appropriate. 19 | 20 | - **Have fun!** 21 | 22 | ## Development Workflow 23 | 24 | Start by forking the `frostfs-dev-env` repository, make changes in a branch and then 25 | send a pull request. We encourage pull requests to discuss code changes. Here 26 | are the steps in details: 27 | 28 | ### Set up your GitHub Repository 29 | Fork [FrostFS node upstream](https://github.com/TrueCloudLab/frostfs-dev-env/fork) source 30 | repository to your own personal repository. Copy the URL of your fork (you will 31 | need it for the `git clone` command below). 32 | 33 | ```sh 34 | $ git clone https://github.com/TrueCloudLab/frostfs-dev-env 35 | ``` 36 | 37 | ### Set up git remote as ``upstream`` 38 | ```sh 39 | $ cd frostfs-dev-env 40 | $ git remote add upstream https://github.com/TrueCloudLab/frostfs-dev-env 41 | $ git fetch upstream 42 | $ git merge upstream/master 43 | ... 44 | ``` 45 | 46 | ### Create your feature branch 47 | Before making code changes, make sure you create a separate branch for these 48 | changes. Maybe you will find it convenient to name branch in 49 | `/-` format. 50 | 51 | ``` 52 | $ git checkout -b feature/123-something_awesome 53 | ``` 54 | 55 | ### Test your changes 56 | After your code changes, make sure 57 | 58 | - To add test cases for the new code. 59 | - To run `make lint` 60 | - To squash your commits into a single commit or a series of logically separated 61 | commits run `git rebase -i`. It's okay to force update your pull request. 62 | 63 | ### Commit changes 64 | After verification, commit your changes. This is a [great 65 | post](https://chris.beams.io/posts/git-commit/) on how to write useful commit 66 | messages. Try following this template: 67 | 68 | ``` 69 | [#Issue] Summary 70 | 71 | Description 72 | 73 | 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | $ git commit -am '[#123] Add some feature' 80 | ``` 81 | 82 | ### Push to the branch 83 | Push your locally committed changes to the remote origin (your fork) 84 | ``` 85 | $ git push origin feature/123-something_awesome 86 | ``` 87 | 88 | ### Create a Pull Request 89 | Pull requests can be created via GitHub. Refer to [this 90 | document](https://help.github.com/articles/creating-a-pull-request/) for 91 | detailed steps on how to create a pull request. After a Pull Request gets peer 92 | reviewed and approved, it will be merged. 93 | 94 | ## DCO Sign off 95 | 96 | All authors to the project retain copyright to their work. However, to ensure 97 | that they are only submitting work that they have rights to, we are requiring 98 | everyone to acknowledge this by signing their work. 99 | 100 | Any copyright notices in this repository should specify the authors as "the 101 | contributors". 102 | 103 | To sign your work, just add a line like this at the end of your commit message: 104 | 105 | ``` 106 | Signed-off-by: Samii Sakisaka 107 | ``` 108 | 109 | This can easily be done with the `--signoff` option to `git commit`. 110 | 111 | By doing this you state that you can certify the following (from [The Developer 112 | Certificate of Origin](https://developercertificate.org/): 113 | 114 | ``` 115 | Developer Certificate of Origin 116 | Version 1.1 117 | 118 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 119 | 1 Letterman Drive 120 | Suite D4700 121 | San Francisco, CA, 94129 122 | 123 | Everyone is permitted to copy and distribute verbatim copies of this 124 | license document, but changing it is not allowed. 125 | 126 | 127 | Developer's Certificate of Origin 1.1 128 | 129 | By making a contribution to this project, I certify that: 130 | 131 | (a) The contribution was created in whole or in part by me and I 132 | have the right to submit it under the open source license 133 | indicated in the file; or 134 | 135 | (b) The contribution is based upon previous work that, to the best 136 | of my knowledge, is covered under an appropriate open source 137 | license and I have the right under that license to submit that 138 | work with modifications, whether created in whole or in part 139 | by me, under the same open source license (unless I am 140 | permitted to submit under a different license), as indicated 141 | in the file; or 142 | 143 | (c) The contribution was provided directly to me by some other 144 | person who certified (a), (b) or (c) and I have not modified 145 | it. 146 | 147 | (d) I understand and agree that this project and the contribution 148 | are public and that a record of the contribution (including all 149 | personal information I submit with it, including my sign-off) is 150 | maintained indefinitely and may be redistributed consistent with 151 | this project or the open source license(s) involved. 152 | ``` 153 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | SHELL = bash 3 | 4 | # Main environment configuration 5 | include .env 6 | 7 | # Optional variables with secrets 8 | -include .secrets 9 | 10 | # help target 11 | include help.mk 12 | 13 | # update FrostFS global config targets 14 | include frostfs_config.mk 15 | 16 | # Targets to get required artifacts and external resources for each service 17 | include services/*/artifacts.mk 18 | 19 | # Targets helpful to prepare service environment 20 | include services/*/prepare.mk 21 | 22 | # List of services to run 23 | START_SVCS = $(shell cat .services | grep -v '#') 24 | START_BASIC = $(shell cat .basic_services | grep -ve '#') 25 | START_BOOTSTRAP = $(shell cat .bootstrap_services | grep -v '#') 26 | STOP_SVCS = $(shell tac .services | grep -v '#') 27 | STOP_BASIC = $(shell tac .basic_services | grep -v '#') 28 | STOP_BOOTSTRAP = $(shell tac .bootstrap_services | grep -v '#') 29 | 30 | # Enabled services dirs 31 | ENABLED_SVCS_DIRS = $(shell echo "${START_BOOTSTRAP} ${START_BASIC} ${START_SVCS}" | sed 's|[^ ]* *|./services/&|g') 32 | 33 | # Services that require artifacts 34 | GET_SVCS = $(shell grep -Rl "get.*:" ./services/* | sort -u | grep artifacts.mk | xargs -I {} dirname {} | xargs basename -a) 35 | 36 | # Services that require pulling images 37 | PULL_SVCS = $(shell find ${ENABLED_SVCS_DIRS} -type f -name 'docker-compose.yml' | sort -u | xargs -I {} dirname {} | xargs basename -a) 38 | 39 | # List of hosts available in devenv 40 | HOSTS_LINES = $(shell grep -Rl IPV4_PREFIX ./services/* | grep .hosts) 41 | 42 | # Paths to protocol.privnet.yml 43 | MORPH_CHAIN_PROTOCOL = './services/morph_chain/protocol.privnet.yml' 44 | 45 | # List of grepped environment variables from *.env 46 | GREP_DOTENV = $(shell find . -name '*.env' -exec grep -rhv -e '^\#' -e '^$$' {} + | sort -u ) 47 | 48 | # Pull all required Docker images 49 | .PHONY: pull 50 | pull: 51 | $(foreach SVC, $(PULL_SVCS), $(shell cd services/$(SVC) && docker-compose pull)) 52 | @: 53 | 54 | # Get all services artifacts 55 | .PHONY: get 56 | get: $(foreach SVC, $(GET_SVCS), get.$(SVC)) 57 | @: 58 | 59 | # Start environment 60 | .PHONY: up 61 | up: up/basic 62 | @$(foreach SVC, $(START_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) 63 | @echo "Full FrostFS Developer Environment is ready" 64 | 65 | # Build up FrostFS 66 | .PHONY: up/basic 67 | up/basic: up/bootstrap 68 | @$(foreach SVC, $(START_BASIC), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) 69 | @./bin/tick.sh 70 | @./bin/config.sh string SystemDNS container 71 | @echo "Basic FrostFS Developer Environment is ready" 72 | 73 | # Start bootstrap services 74 | .PHONY: up/bootstrap 75 | up/bootstrap: get vendor/hosts 76 | @$(foreach SVC, $(START_BOOTSTRAP), $(shell docker-compose -f services/$(SVC)/docker-compose.yml up -d)) 77 | @source ./bin/helper.sh 78 | @./vendor/frostfs-adm --config frostfs-adm.yml morph init --alphabet-wallets ./services/ir --contracts vendor/contracts || die "Failed to initialize Alphabet wallets" 79 | @for f in ./services/storage/wallet*.json; do echo "Transfer GAS to wallet $${f}" && ./vendor/frostfs-adm -c frostfs-adm.yml morph refill-gas --storage-wallet $${f} --gas 10.0 --alphabet-wallets services/ir || die "Failed to transfer GAS to alphabet wallets"; done 80 | @echo "FrostFS sidechain environment is deployed" 81 | 82 | # Build up certain service 83 | .PHONY: up/% 84 | up/%: get vendor/hosts 85 | @docker-compose -f services/$*/docker-compose.yml up -d 86 | @echo "Developer Environment for $* service is ready" 87 | 88 | # Stop environment 89 | .PHONY: down 90 | down: down/add down/basic down/bootstrap 91 | @echo "Full FrostFS Developer Environment is down" 92 | 93 | .PHONY: down/add 94 | down/add: 95 | $(foreach SVC, $(STOP_SVCS), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down)) 96 | 97 | # Stop basic environment 98 | .PHONY: down/basic 99 | down/basic: 100 | $(foreach SVC, $(STOP_BASIC), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down)) 101 | 102 | # Stop bootstrap services 103 | .PHONY: down/bootstrap 104 | down/bootstrap: 105 | $(foreach SVC, $(STOP_BOOTSTRAP), $(shell docker-compose -f services/$(SVC)/docker-compose.yml down)) 106 | 107 | # Stop certain service 108 | .PHONY: down/% 109 | down/%: 110 | @docker-compose -f services/$*/docker-compose.yml down 111 | 112 | # Generate changes for /etc/hosts 113 | .PHONY: vendor/hosts 114 | .ONESHELL: 115 | vendor/hosts: 116 | @for file in $(HOSTS_LINES) 117 | do 118 | while read h 119 | do 120 | echo $${h} | \ 121 | sed 's|IPV4_PREFIX|$(IPV4_PREFIX)|g' | \ 122 | sed 's|LOCAL_DOMAIN|$(LOCAL_DOMAIN)|g' 123 | done < $${file}; 124 | done > $@ 125 | 126 | # Generate and display changes for /etc/hosts 127 | .PHONY: hosts 128 | hosts: vendor/hosts 129 | @cat vendor/hosts 130 | 131 | # Clean-up the environment 132 | .PHONY: clean 133 | .ONESHELL: 134 | clean: 135 | @rm -rf vendor/* services/storage/s04tls.* services/nats/*.pem 136 | @> .int_test.env 137 | @for svc in $(PULL_SVCS) 138 | do 139 | vols=`docker-compose -f services/$${svc}/docker-compose.yml config --volumes` 140 | if [[ ! -z "$${vols}" ]]; then 141 | for vol in $${vols}; do 142 | docker volume rm -f "$${svc}_$${vol}" 2> /dev/null 143 | done 144 | fi 145 | done 146 | 147 | # Generate environment 148 | .PHONY: env 149 | env: 150 | @$(foreach envvar,$(GREP_DOTENV),echo $(envvar);) 151 | @echo MORPH_BLOCK_TIME=$(shell grep 'SecondsPerBlock' $(MORPH_CHAIN_PROTOCOL) | awk '{print $$2}')s 152 | @echo MORPH_MAGIC=$(shell grep 'Magic' $(MORPH_CHAIN_PROTOCOL) | awk '{print $$2}') 153 | 154 | # Restart storage nodes with clean volumes 155 | .PHONY: restart.storage-clean 156 | restart.storage-clean: 157 | @docker-compose -f ./services/storage/docker-compose.yml down 158 | @$(foreach vol, \ 159 | $(shell docker-compose -f services/storage/docker-compose.yml config --volumes),\ 160 | docker volume rm storage_$(vol);) 161 | @docker-compose -f ./services/storage/docker-compose.yml up -d 162 | 163 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | FrostFS logo 3 |

4 |

5 | FrostFS local Development and Testing environment 6 |

7 | 8 | --- 9 | ## Overview 10 | 11 | Tools to set up local FrostFS network and N3 privnets. Devenv, for short. 12 | 13 | ## Prerequisites 14 | 15 | Make sure you have installed all of the following prerequisites on your machine: 16 | * docker 17 | * docker-compose 18 | * make (`3.82+`) 19 | * expect 20 | * openssl 21 | * jq 22 | * base64 (coreutils) 23 | 24 | 25 | ## Quick Start 26 | 27 | Clone repo: 28 | 29 | ``` 30 | $ git clone https://github.com/TrueCloudLab/frostfs-dev-env.git 31 | ``` 32 | 33 | Run next commands from project's root: 34 | 35 | ``` 36 | $ make get 37 | ``` 38 | 39 | This command should be executed for the first run only to execute 40 | `make hosts`. It is part of the `make up` and, if the hosts have 41 | been added already, there is no need to run it separately. 42 | 43 | ``` 44 | $ make hosts 45 | 192.168.130.10 bastion.frostfs.devenv 46 | 192.168.130.50 main-chain.frostfs.devenv 47 | 192.168.130.61 ir01.frostfs.devenv 48 | ... 49 | 192.168.130.74 s04.frostfs.devenv 50 | ``` 51 | 52 | This command shows addresses and hostnames of components. Add `make hosts` 53 | output to your local `/etc/hosts` file. 54 | 55 | Run all services with command: 56 | ``` 57 | $ make up 58 | ``` 59 | 60 | When all services are up, you need to make GAS deposit for test wallet to be 61 | able to pay for FrostFS operations. Test wallet is located in 62 | `wallets/wallet.json` with the corresponding key in `wallets/wallet.key`. The 63 | password is empty. 64 | 65 | ``` 66 | $ make prepare.ir 67 | password > 68 | fa6ba62bffb04030d303dcc95bda7413e03aa3c7e6ca9c2f999d65db9ec9b82c 69 | ``` 70 | 71 | Also, you should add self-signed node (`s04.frostfs.devenv`) certificate to trusted 72 | store (default location might be changed using `CA_CERTS_TRUSTED_STORE` 73 | variable). This step is required for client services (frostfs-http-gw, 74 | frostfs-s3-gw) to interact with the node: 75 | 76 | ``` 77 | $ sudo make prepare.storage 78 | ``` 79 | 80 | Change FrostFS global configuration values with `make update.*` commands. The 81 | password of inner ring wallet is `one`. See examples in `make help`. 82 | 83 | ``` 84 | $ make update.epoch_duration val=30 85 | Changing EpochDuration configration value to 30 86 | Enter account NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF password > 87 | Sent invocation transaction dbb8c1145b6d10f150135630e13bb0dc282023163f5956c6945a60db0cb45cb0 88 | Updating FrostFS epoch to 2 89 | Enter account NNudMSGzEoktFzdYGYoNb3bzHzbmM1genF password > 90 | Sent invocation transaction 0e6eb5e190f36332e5e5f4e866c7e100826e285fd949e11c085e15224f343ba6 91 | ``` 92 | 93 | For instructions on how to set up DevEnv on macOS, please refer [the 94 | guide](docs/macOS.md) in `docs` directory. 95 | 96 | ## How it's organized 97 | 98 | ``` 99 | . 100 | ├── Makefile # Commands to manage devenv 101 | ├── .services # List of services to work with 102 | ├── services # Services definitions and files 103 | │   ├── basenet 104 | │   ├── chain 105 | │   ├── ir 106 | │   ├── morph_chain 107 | │   └── storage 108 | ├── vendor # Temporary files and artifacts 109 | └── wallets # Wallet files to manage GAS assets 110 | ``` 111 | 112 | Main commands and targets to manage devenv's services are in `Makefile`. 113 | 114 | Each service is defined in it's own directory under `services/` with all 115 | required files to run and scripts to get external artifacts or dependencies. 116 | 117 | The list of services and the starting order is defined in `.services` file. You 118 | can comment out services you don't want to start or add your own new services. 119 | 120 | You can find more information on each service in `docs` directory. 121 | 122 | Maybe you will find the answer for your question in [F.A.Q.](docs/faq.md) 123 | 124 | ## Using FrostFS Admin Tool in `dev-env` 125 | 126 | Devenv supports FrostFS network management via [frostfs-adm](https://github.com/TrueCloudLab/frostfs-node/tree/master/cmd/frostfs-adm). 127 | `services/ir` contains the Alphabet wallet in a proper format, specify it 128 | with `--alphabet-wallets` flag. 129 | 130 | ## Notable make targets 131 | 132 | `make help` will print the brief description of available targets. Here we 133 | describe some of them in a more detailed way. 134 | 135 | ### up 136 | 137 | Start all Devenv services. 138 | 139 | This target call `pull` to get container images, `get` to download required 140 | artifacts, `vendor/hosts` to generate hosts file and then starts all services in 141 | the order defined in `.services` file. 142 | 143 | ### down 144 | 145 | Shutdowns all services. This will destroy all containers and networks. All 146 | changes made inside containers will be lost. 147 | 148 | ### hosts 149 | 150 | Display addresses and host names for each running service, if available. 151 | 152 | ### clean 153 | 154 | Clean up `vendor` directory. 155 | 156 | ## Contributing 157 | 158 | Feel free to contribute to this project after reading the [contributing 159 | guidelines](CONTRIBUTING.md). 160 | 161 | Before starting to work on a certain topic, create an new issue first, 162 | describing the feature/topic you are going to implement. 163 | 164 | # License 165 | 166 | - [GNU General Public License v3.0](LICENSE) 167 | -------------------------------------------------------------------------------- /bin/addCert.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Source env settings 4 | . .env 5 | 6 | ln -sf "$(pwd)/services/storage/s04tls.crt" "${CA_CERTS_TRUSTED_STORE}/s04.${LOCAL_DOMAIN}.tls.crt" 7 | -------------------------------------------------------------------------------- /bin/config.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Running bin/config.sh" 4 | 5 | # Source env settings 6 | . .env 7 | . services/ir/.ir.env 8 | source bin/helper.sh 9 | 10 | # NeoGo binary path. 11 | NEOGO="${NEOGO:-docker exec morph_chain neo-go}" 12 | 13 | # Wallet files to change config value 14 | WALLET="${WALLET:-services/morph_chain/node-wallet.json}" 15 | CONFIG_IMG="${CONFIG_IMG:-/wallets/config.yml}" 16 | 17 | NETMAP_ADDR=$(bin/resolve.sh netmap.frostfs) || die "Failed to resolve 'netmap.frostfs' domain name" 18 | 19 | # FrostFS configuration record: variable type [string|int|etc], 20 | # key is a string and value is a constant of given type 21 | TYPE=${1} 22 | KEY=${2} 23 | VALUE="${3}" 24 | 25 | [ -z "$TYPE" ] && echo "Empty config value type" && exit 1 26 | [ -z "$KEY" ] && echo "Empty config key" && exit 1 27 | [ -z "$VALUE" ] && echo "Empty config value" && exit 1 28 | 29 | # Internal variables 30 | if [[ -z "${FROSTFS_NOTARY_DISABLED}" ]]; then 31 | ADDR=$(jq -r .accounts[2].address < "${WALLET}" || die "Cannot get address from ${WALLET}") 32 | else 33 | ADDR=$(jq -r .accounts[0].address < "${WALLET}" || die "Cannot get address from ${WALLET}") 34 | fi 35 | 36 | # Change config value in side chain 37 | echo "Changing ${KEY} configration value to ${VALUE}" 38 | 39 | # shellcheck disable=SC2086 40 | ${NEOGO} contract invokefunction \ 41 | --wallet-config ${CONFIG_IMG} \ 42 | -a ${ADDR} --force \ 43 | -r http://morph-chain.${LOCAL_DOMAIN}:30333 \ 44 | ${NETMAP_ADDR} \ 45 | setConfig bytes:beefcafe \ 46 | string:${KEY} \ 47 | ${TYPE}:${VALUE} -- ${ADDR} || exit 1 48 | 49 | # Update epoch to apply new configuration value 50 | ./bin/tick.sh 51 | -------------------------------------------------------------------------------- /bin/helper.sh: -------------------------------------------------------------------------------- 1 | set -eo pipefail 2 | 3 | die() { 4 | echo "$(caller 0):" "$*" >&2 5 | exit 1 6 | } 7 | -------------------------------------------------------------------------------- /bin/passwd.exp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/expect 2 | 3 | set passwd [lindex $argv 0] 4 | set args [lrange $argv 1 end] 5 | 6 | spawn -noecho {*}$args 7 | expect -re {^.*assword.*$} 8 | 9 | if { $passwd == "-"} { 10 | send -- "\r" 11 | } else { 12 | send -- "$passwd\r" 13 | } 14 | 15 | expect { 16 | "Relay transaction" { 17 | send "y\r" 18 | exp_continue 19 | } 20 | EOF 21 | } 22 | lassign [wait] pid spawnid os_error_flag value 23 | exit $value 24 | -------------------------------------------------------------------------------- /bin/resolve.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Source env settings 4 | . .env 5 | source bin/helper.sh 6 | 7 | # NeoGo binary path. 8 | NEOGO="${NEOGO:-docker exec morph_chain neo-go}" 9 | # NNS contract script hash 10 | output=$(curl -s --data '{ "id": 1, "jsonrpc": "2.0", "method": "getcontractstate", "params": [1] }' \ 11 | "http://morph-chain.${LOCAL_DOMAIN}:30333/") \ 12 | || die "Cannot fetch NNS contract state" 13 | 14 | NNS_ADDR=$(jq -r '.result.hash' <<< "$output") \ 15 | || die "Cannot parse NNS contract hash: $NNS_ADDR" 16 | 17 | ${NEOGO} contract testinvokefunction \ 18 | -r "http://morph-chain.${LOCAL_DOMAIN}:30333" \ 19 | "${NNS_ADDR}" resolve string:"${1}" int:16 \ 20 | | jq -r '.stack[0].value | if type=="array" then .[0].value else . end' \ 21 | | base64 -d \ 22 | || die "Cannot invoke 'NNS.resolve' $output" 23 | -------------------------------------------------------------------------------- /bin/tick.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Running bin/tick.sh" 4 | 5 | # Source env settings 6 | . .env 7 | . services/ir/.ir.env 8 | source bin/helper.sh 9 | 10 | # NeoGo binary path. 11 | NEOGO="${NEOGO:-docker exec morph_chain neo-go}" 12 | 13 | # Wallet files to change config value 14 | WALLET="${WALLET:-services/morph_chain/node-wallet.json}" 15 | CONFIG_IMG="${CONFIG_IMG:-/wallets/config.yml}" 16 | 17 | # Internal variables 18 | if [[ -z "${FROSTFS_NOTARY_DISABLED}" ]]; then 19 | ADDR=$(jq -r .accounts[2].address < "${WALLET}" || die "Cannot get address from ${WALLET}") 20 | else 21 | ADDR=$(jq -r .accounts[0].address < "${WALLET}" || die "Cannot get address from ${WALLET}") 22 | fi 23 | 24 | # Grep Morph block time 25 | SIDECHAIN_PROTO="${SIDECHAIN_PROTO:-services/morph_chain/protocol.privnet.yml}" 26 | BLOCK_DURATION=$(grep SecondsPerBlock < "$SIDECHAIN_PROTO" | awk '{print $2}') \ 27 | || die "Cannot fetch block duration" 28 | NETMAP_ADDR=$(bin/resolve.sh netmap.frostfs) || die "Cannot resolve netmap.frostfs" 29 | 30 | # Fetch current epoch value 31 | EPOCH=$(${NEOGO} contract testinvokefunction \ 32 | -r "http://morph-chain.${LOCAL_DOMAIN}:30333" "${NETMAP_ADDR}" epoch \ 33 | | grep 'value' | awk -F'"' '{ print $4 }') \ 34 | || die "Cannot fetch epoch from netmap contract" 35 | 36 | echo "Updating FrostFS epoch to $((EPOCH+1))" 37 | 38 | # shellcheck disable=SC2086 39 | ${NEOGO} contract invokefunction \ 40 | --wallet-config ${CONFIG_IMG} \ 41 | -a ${ADDR} --force \ 42 | -r http://morph-chain.${LOCAL_DOMAIN}:30333 \ 43 | ${NETMAP_ADDR} \ 44 | newEpoch int:$((EPOCH+1)) -- ${ADDR}:Global \ 45 | || die "Cannot increment an epoch" 46 | 47 | # Wait one Morph block to ensure the transaction broadcasted 48 | # shellcheck disable=SC2086 49 | sleep $BLOCK_DURATION 50 | -------------------------------------------------------------------------------- /docs/basenet.md: -------------------------------------------------------------------------------- 1 | # basenet service 2 | 3 | The `basenet` service defines the common network to use as "Internet" to let 4 | services communicate to external world. It's a bridge network connected to the 5 | host machine, so all programs running on host can connect to services exposed to 6 | `basenet_internet` from devenv containers. 7 | 8 | ## .env settings 9 | 10 | ### LOCAL_DOMAIN=frostfs.devenv 11 | 12 | Domain to use for all containers exposed to `basenet_internet`. 13 | 14 | ### IPV4_PREFIX=192.168.130 15 | 16 | IPv4 /24 subnet to use for all containers exposed to `basenet_internet`. Last 17 | octet will be defined in `docker-compose.yml` file for each container inside 18 | service. For simplicity, each service reserves ten host addresses. 19 | 20 | ### CA_CERTS_TRUSTED_STORE=/usr/local/share/ca-certificates 21 | Trusted store location to add node self-signed tls certificates. 22 | 23 | ## bastion container 24 | 25 | There is a `bastion` container with debian 10 userspace to simplify access to 26 | devenv services. 27 | 28 | Run shell in bastion: 29 | 30 | ``` 31 | frostfs-dev-env$ docker exec -ti bastion /bin/bash 32 | root@bastion:/# ip a sh 33 | 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 34 | link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 35 | inet 127.0.0.1/8 scope host lo 36 | valid_lft forever preferred_lft forever 37 | 1569: eth0@if1570: mtu 1500 qdisc noqueue state UP group default 38 | link/ether 02:42:c0:a8:82:0a brd ff:ff:ff:ff:ff:ff link-netnsid 0 39 | inet 192.168.130.10/24 brd 192.168.130.255 scope global eth0 40 | valid_lft forever preferred_lft forever 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/faq.md: -------------------------------------------------------------------------------- 1 | # F.A.Q, tips and tricks 2 | 3 | 4 | ### How to export private key from Neo wallet for FrostFS use? 5 | 6 | Private key for usage with FrostFS tools can be extracted from Neo wallet in three 7 | simple steps. 8 | 9 | 1. Get the key in WIF format 10 | 11 | ``` 12 | $ docker exec -it main_chain neo-go wallet export -w wallets/wallet.json -d NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM 13 | Enter password > 14 | KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr 15 | ``` 16 | 17 | 2. Convert form WIF to HEX 18 | 19 | ``` 20 | $ frostfs-cli util keyer KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr 21 | PrivateKey 1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb 22 | PublicKey 031a6c6fbbdf02ca351745fa86b9ba5a9452d785ac4f7fc2b7548ca2a46c4fcf4a 23 | WIF KxDgvEKzgSBPPfuVfw67oPQBSjidEiqTHURKSDL1R7yGaGYAeYnr 24 | Wallet3.0 NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM 25 | ScriptHash3.0 5ea4d57ff4b09098a37db8138686ae2ef6a5b9aa 26 | ScriptHash3.0BE aab9a5f62eae868613b87da39890b0f47fd5a45e 27 | ``` 28 | 29 | 3. Dump into file in binary format 30 | 31 | ``` 32 | $ echo '1dd37fba80fec4e6a6f13fd708d8dcb3b29def768017052f6c930fa1c5d90bbb' | xxd -r -p > wallets/wallet.key 33 | $ xxd wallets/wallet.key 34 | 00000000: 1dd3 7fba 80fe c4e6 a6f1 3fd7 08d8 dcb3 ..........?..... 35 | 00000010: b29d ef76 8017 052f 6c93 0fa1 c5d9 0bbb ...v.../l....... 36 | ``` 37 | 38 | Later you will be able to provide wallet file in frostfs-node config. 39 | 40 | ### How to create Neo wallet JSON file using a FrostFS key file? 41 | 42 | You will need `neo-go` and `frostfs-cli`. 43 | 44 | 1. Get the WIF format of the private key 45 | 46 | ``` 47 | $ frostfs-cli util keyer -key ./services/ir/01.key | grep WIF | awk '{print $NF}' > temp_WIF 48 | ``` 49 | 50 | 2. Init a new empty Neo wallet 51 | 52 | ``` 53 | $ neo-go wallet init -w my_new_wallet.json 54 | ``` 55 | 56 | 3. Import WIF to the new wallet 57 | 58 | ``` 59 | $ neo-go wallet import -w my_new_wallet.json --wif $(cat temp_WIF) && rm temp_WIF 60 | Enter the name of the account > 61 | Enter passphrase > 62 | Confirm passphrase > 63 | ``` 64 | 65 | ### How to see what's inside running container if there's no shell? 66 | 67 | You can run any program in container's namespace using `nsenter` utility. 68 | 69 | ``` 70 | $ docker inspect -f '{{.State.Pid}}' fs.neo.org 71 | 27242 72 | 73 | $ sudo nsenter -t 27242 -n netstat -antp 74 | Active Internet connections (servers and established) 75 | Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name 76 | tcp 0 0 127.0.0.11:43783 0.0.0.0:* LISTEN 1376/dockerd 77 | tcp6 0 0 :::443 :::* LISTEN 27242/nginx: master 78 | tcp6 0 0 :::80 :::* LISTEN 27242/nginx: master 79 | ``` 80 | -------------------------------------------------------------------------------- /docs/http_gate.md: -------------------------------------------------------------------------------- 1 | # HTTP Protocol gateway 2 | 3 | Protocol Gateway to access data in FrostFS using HTTP protocol. 4 | 5 | Source code and more information can be found in [project's GitHub repository](https://github.com/TrueCloudLab/frostfs-http-gate) 6 | 7 | ## .env settings 8 | 9 | ### HTTP_GW_VERSION=0.15.1 10 | 11 | Image version label to use for containers. 12 | 13 | If you want to use locally built image, just set its label here. Instead of 14 | pulling from DockerHub, the local image will be used. 15 | 16 | ### HTTP_GW_IMAGE=truecloudlab/frostfs-http-gw 17 | 18 | Image label prefix to use for containers. 19 | 20 | ## Usage example 21 | 22 | - Create a new container 23 | ``` 24 | $ frostfs-cli --rpc-endpoint s01.frostfs.devenv:8080 \ 25 | --key wallets/wallet.key \ 26 | container create --basic-acl readonly --await \ 27 | --policy "REP 1 SELECT 1 FROM *" 28 | container ID: 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP 29 | awaiting... 30 | container has been persisted on sidechain 31 | 32 | ``` 33 | - Put an object into the newly created container 34 | ``` 35 | $ frostfs-cli --rpc-endpoint s01.frostfs.devenv:8080 \ 36 | --key wallets/wallet.key \ 37 | object put --file /tmp/backup.jpeg \ 38 | --cid 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP 39 | [/tmp/backup.jpeg] Object successfully stored 40 | ID: 6EPpYqSFMGWrNLvYE9mNnut1CPKuPBKyi1ixHakzqsSB 41 | CID: 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP 42 | ``` 43 | - Call `curl -sSI -XGET http://http.frostfs.devenv/get//` 44 | ``` 45 | $ curl -sSI -XGET http://http.frostfs.devenv/get/4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP/6EPpYqSFMGWrNLvYE9mNnut1CPKuPBKyi1ixHakzqsSB 46 | HTTP/1.1 200 OK 47 | Date: Thu, 03 Dec 2020 10:34:26 GMT 48 | Content-Type: image/jpeg 49 | Content-Length: 144017 50 | x-object-id: 6EPpYqSFMGWrNLvYE9mNnut1CPKuPBKyi1ixHakzqsSB 51 | x-owner-id: NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx 52 | x-container-id: 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP 53 | x-FileName: backup.jpeg 54 | x-Timestamp: 1606983284 55 | Last-Modified: Thu, 03 Dec 2020 08:14:44 UTC 56 | Content-Disposition: inline; filename=backup.jpeg 57 | ``` 58 | -------------------------------------------------------------------------------- /docs/ir.md: -------------------------------------------------------------------------------- 1 | # FrostFS Inner Ring 2 | 3 | FrostFS Inner Ring (Alphabet) node. According to governance scheme, Inner Ring 4 | should contain Alphabet nodes that share key with one of side chain consensus 5 | nodes. In basic setup there is a single consensus node and single Inner Ring 6 | (Alphabet) node. 7 | 8 | ## .env settings 9 | 10 | ### IR_VERSION 11 | 12 | Image version label to use for Inner Ring docker containers. 13 | 14 | If you want to use locally built image, just set it's label here. Instead of 15 | pulling from DockerHub, the local image will be used. 16 | 17 | ### IR_IMAGE=truecloudlab/frostfs-ir 18 | 19 | Image label prefix to use for Inner Ring docker containers. 20 | -------------------------------------------------------------------------------- /docs/macos.md: -------------------------------------------------------------------------------- 1 | # Setting up DevEnv on macOS 2 | 3 | ## The Problem 4 | 5 | Currently Docker for macOS has no support for network routing into the Host 6 | Virtual Machine that is created using hyperkit. The reason for this is due to 7 | the fact that the network interface options used to create the instance does not 8 | create a bridge interface between the Physical Machine and the Host Virtual 9 | Machine. To make matters worse, the arguments used to create the Host Virtual 10 | Machine is hardcoded into the Docker for macOS binary with no means to configure 11 | it. 12 | 13 | ## How to setup DevEnv on macOS 14 | 15 | - Clone https://github.com/AlmirKadric-Published/docker-tuntap-osx 16 | ```sh 17 | $ git clone git@github.com:AlmirKadric-Published/docker-tuntap-osx.git 18 | ``` 19 | 20 | - Install tuntap for macOS 21 | ``` 22 | $ brew tap caskroom/cask 23 | $ brew cask install tuntap 24 | ``` 25 | 26 | - Restart macOS and allow tuntap kext in settings before 27 | 28 | - Docker for macOS should be run before 29 | 30 | - Install docker-tuntap. This will automatically check if the currently 31 | installed shim is the correct version and make a backup if necessary 32 | 33 | ``` 34 | $ ./sbin/docker_tap_install.sh 35 | ``` 36 | 37 | - After this you will need to bring up the network interfaces every time the 38 | docker Host Virtual Machine is restarted 39 | 40 | ``` 41 | $ ./sbin/docker_tap_up.sh 42 | ``` 43 | 44 | - Bootup devenv 45 | 46 | - See IPV4_PREFIX, for example, now it's 47 | ``` 48 | IPV4_PREFIX=192.168.130 49 | ``` 50 | 51 | - Add route to devenv (.0, for example IPV4_PREFIX=192.168.130) 52 | ``` 53 | $ sudo route add -net 192.168.130.0 -netmask 255.255.255.0 10.0.75.2 54 | ``` 55 | 56 | ## How to uninstall 57 | 58 | The uninstall script will simply revert the installer. Restoring the original 59 | and removing the shim: 60 | 61 | ``` 62 | $ ./sbin/docker_tap_uninstall.sh 63 | ``` 64 | 65 | Remove route to devenv (.0, for example IPV4_PREFIX=192.168.130) 66 | ``` 67 | $ sudo route delete -net 192.168.130.0 -netmask 255.255.255.0 10.0.75.2 68 | ``` 69 | 70 | ## Restart macOS or upgrade Docker for macoS 71 | 72 | When you restart macOS or install new version of Docker, you should do next 73 | steps: 74 | - reinstall docker-tuntap forced 75 | ``` 76 | $ ./sbin/docker_tap_install.sh -f 77 | ``` 78 | 79 | - wait until docker will be restarted 80 | 81 | - up tuntap interface 82 | ``` 83 | $ ./sbin/docker_tap_up.sh 84 | ``` 85 | 86 | - bootup devenv 87 | 88 | - Add route to devenv (.0, for example IPV4_PREFIX=192.168.130) 89 | ``` 90 | $ sudo route add -net 192.168.130.0 -netmask 255.255.255.0 10.0.75.2 91 | ``` 92 | 93 | ## How it works 94 | 95 | This installer (`docker_tap_install.sh`) will move the original hyperkit binary 96 | (`hyperkit.original`) inside the Docker for macOS application and places our shim 97 | (`./sbin/docker.hyperkit.tuntap.sh`) in it's stead. This shim will then inject 98 | the additional arguments required to attach a 99 | [TunTap](http://tuntaposx.sourceforge.net/) interface into the Host Virtual 100 | Machine, creating a bridge interface between the guest and the host (this is 101 | essentially what hvint0 is on Docker for Windows). 102 | 103 | From there the `up` script (`docker_tap_up.sh`) is used to bring the network 104 | interface up on both the Physical Machine and the Host Virtual Machine. Unlike 105 | the install script, which only needs to be run once, this `up` script must be 106 | run for every restart of the Host Virtual Machine. 107 | 108 | Once done, the IP address `10.0.75.2` can be used as a network routing gateway 109 | to reach any containers within the Host Virtual Machine: 110 | 111 | ``` 112 | $ route add -net -netmask 10.0.75.2 113 | ``` 114 | 115 | **Note:** Although as of docker-for-mac version `17.12.0` you do not need the 116 | following, for prior versions you will need to setup IP Forwarding in the 117 | iptables defintion on the Host Virtual Machine: 118 | 119 | (This is not done by the helpers as this is not a OSX or tuntap specific issue. 120 | You would need to do the same for Docker for Windows, as such it should be 121 | handled outside the scope of this project.) 122 | 123 | ``` 124 | $ docker run --rm --privileged --pid=host debian nsenter -t 1 -m -u -n -i iptables -A FORWARD -i eth1 -j ACCEPT 125 | ``` 126 | 127 | **Note:** Although not required for docker-for-mac versions greater than 128 | `17.12.0`, the above command can be replaced with the following if ever needed 129 | and is tested to be working on Docker for Windwos as an alternative. This is in 130 | case Docker for macOS changes something in future and this command ends up being a 131 | necessity once again. 132 | 133 | ``` 134 | $ docker run --rm --privileged --pid=host docker4w/nsenter-dockerd /bin/sh -c 'iptables -A FORWARD -i eth1 -j ACCEPT' 135 | ``` 136 | 137 | ## Dependencies 138 | - [Docker for Mac](https://www.docker.com/docker-mac) 139 | - [TunTap](http://tuntaposx.sourceforge.net/) 140 | - [Docker TunTap](https://github.com/AlmirKadric-Published/docker-tuntap-osx) 141 | -------------------------------------------------------------------------------- /docs/morph.md: -------------------------------------------------------------------------------- 1 | # N3 FrostFS side chain privnet service 2 | A single-node N3 privnet deployment, running on 3 | [neo-go](https://github.com/nspcc-dev/neo-go). Represents N3 FrostFS SideChain. 4 | 5 | Contracts deployed: 6 | - Alphabet (AZ) [contract](https://github.com/TrueCloudLab/frostfs-contract/tree/master/alphabet) 7 | - Audit [contract](https://github.com/TrueCloudLab/frostfs-contract/tree/master/audit) 8 | - Balance [contract](https://github.com/TrueCloudLab/frostfs-contract/tree/master/balance) 9 | - Container [contract](https://github.com/TrueCloudLab/frostfs-contract/tree/master/container) 10 | - Netmap [contract](https://github.com/TrueCloudLab/frostfs-contract/tree/master/netmap) 11 | - NeoFSID [contract](https://github.com/TrueCloudLab/frostfs-contract/tree/master/neofsid) 12 | - Proxy [contract](https://github.com/TrueCloudLab/frostfs-contract/tree/master/proxy) 13 | - Reputation [contract](https://github.com/TrueCloudLab/frostfs-contract/tree/master/reputation) 14 | 15 | RPC available at `http://morph-chain.frostfs.devenv:30333`. 16 | 17 | ## .env settings 18 | 19 | ### MORPH_CHAIN_URL 20 | 21 | URL to get side chain dump. Used on artifact get stage. 22 | 23 | ### MORPH_CHAIN_PATH 24 | 25 | Path to get side chain dump. If set, overrides `CHAIN_URL`. 26 | 27 | ### NEOGO_VERSION 28 | 29 | Version of neo-go docker container for side chain deployment. 30 | 31 | ## Side chain wallets 32 | 33 | There is a wallet with GAS that used for contract deployment: 34 | `wallets/wallet.json`. This wallet has one account with **empty password**. 35 | 36 | ``` 37 | $ neo-go wallet nep17 balance \ 38 | -w wallets/wallet.json \ 39 | -r http://morph-chain.frostfs.devenv:30333 40 | 41 | Account NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM 42 | GAS: GasToken (d2a4cff31913016155e38e474a2c06d08be276cf) 43 | Amount : 189826.0515316 44 | Updated: 3909 45 | FROSTFS: FrostFS Balance (69550190e740b93f92dbd5dea52246f550391057) 46 | Amount : 50 47 | Updated: 3909 48 | ``` 49 | 50 | This way you can also monitor FrostFS internal balance of your account. 51 | 52 | ## FrostFS global config 53 | 54 | FrostFS uses global configuration to store epoch duration, maximum object size, 55 | container fee and other network parameters. Global configuration is stored in 56 | netmap contract and managed by Inner Ring (Alphabet) nodes. 57 | 58 | To change these parameters use `make update.*` commands. Command down below 59 | changes epoch duration from 300 blocks (about 300 seconds with 1bps) to 30. 60 | Script enters passwords automatically with `expect` utility. 61 | 62 | ``` 63 | $ make update.epoch_duration val=30 64 | Changing EpochDuration configration value to 30 65 | Enter account NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP password > 66 | Sent invocation transaction bdc0fa88cd6719ef6df2b9c82de423ddec6141ca24255c2d0072688083b1de9d 67 | Updating FrostFS epoch to 20 68 | Enter account NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP password > 69 | Sent invocation transaction 12296e1ce24dd6c04edb9c56d0a1d0e26d3226adefb0333c74a28788f44a8d0f 70 | ``` 71 | 72 | Read more about available configuration in Makefile help. 73 | 74 | ``` 75 | $ make help 76 | ... 77 | Targets: 78 | ... 79 | update.audit_fee Update audit fee per result in fixed 12 (make update.audit_fee val=100) 80 | update.basic_income_rate Update basic income rate in fixed 12 (make update.basic_income_rate val=1000) 81 | update.container_fee Update container fee per alphabet node in fixed 12 (make update.container_fee val=500) 82 | update.eigen_trust_iterations Update amount of EigenTrust iterations (make update.eigen_trust_iterations val=2) 83 | update.epoch_duration Update epoch duration in side chain blocks (make update.epoch_duration val=30) 84 | update.max_object_size Update max object size in bytes (make update.max_object_size val=1000) 85 | ``` 86 | -------------------------------------------------------------------------------- /docs/notary.md: -------------------------------------------------------------------------------- 1 | # Notary service in chains 2 | 3 | [Notary service](https://github.com/neo-project/neo/issues/1573#issuecomment-704874472) 4 | is a service that provides on-chain network assistance to form multisignature 5 | transactions. Inner Ring (Alphabet) nodes use multisignature transactions to 6 | create containers, approve balance changes, update network map, tick epochs, 7 | etc. With notary service, it takes up to seven times fewer transactions 8 | to do these operations. Notary service calculates the exact amount of GAS 9 | to execute transaction, therefore operations are cheaper (withdraw fee **with** 10 | notary is less than 0.5 GAS; withdraw fee **without** notary is up to 7.0 GAS). 11 | 12 | By default, main chain service is running without notary service, and side chain 13 | running with notary service. However, you can change that in configuration. 14 | 15 | # Disable notary service in side chain 16 | 17 | To disable notary service in side chain do these steps. 18 | 19 | 1. Update `.env` and choose notary disabled chain dump for side chain. 20 | 21 | ``` 22 | MORPH_CHAIN_URL="https://github.com/nspcc-dev/neofs-contract/releases/download/v0.9.0/devenv_sidechain_notary_disabled.gz" 23 | ``` 24 | 25 | Make sure to update chain dump files with `make get` target. 26 | 27 | 2. Update `service/morph_chain/protocol.privnet.yml` and disable notary settings 28 | and state root in header. 29 | 30 | ```yaml 31 | ProtocolConfiguration: 32 | StateRootInHeader: false 33 | P2PSigExtensions: false 34 | ApplicationConfiguration: 35 | P2PNotary: 36 | Enabled: false 37 | ``` 38 | 39 | Chain dump without notary service does not have predefined network map. 40 | Therefore, you need to wait about 5 minutes until new epoch tick with updated 41 | network map. 42 | 43 | 44 | 3. Enable helper commands 45 | 46 | To enable helper commands such as `make tick.epoch` or `make update.epoch_duration` 47 | make sure to export non-empty `FROSTFS_NOTARY_DISABLED` environment variable. 48 | ``` 49 | $ export FROSTFS_NOTARY_DISABLED=1 50 | ``` 51 | 52 | Use `unset` command to return it back. 53 | ``` 54 | $ unset FROSTFS_NOTARY_DISABLED 55 | ``` 56 | 57 | # Enable notary service in main chain 58 | 59 | To enable notary service in main chain do these steps. 60 | 61 | 1. Update `.env` and choose notary enabled chain dump for main chain. 62 | 63 | ``` 64 | CHAIN_URL="https://github.com/nspcc-dev/neofs-contract/releases/download/v0.9.0/devenv_mainchain.gz" 65 | ``` 66 | 67 | Make sure to update chain dump files with `make get` target. 68 | 69 | 2. Update `service/chain/protocol.privnet.yml` and enable notary settings. 70 | 71 | ```yaml 72 | ProtocolConfiguration: 73 | P2PSigExtensions: true 74 | ApplicationConfiguration: 75 | P2PNotary: 76 | Enabled: true 77 | ``` 78 | 79 | Main chain generates a block once per 15 seconds, so Inner Ring takes about 80 | 15-30 seconds to make a notary deposit in main chain after startup. Then 81 | frostfs-dev-env is ready to work. 82 | -------------------------------------------------------------------------------- /docs/rest_gate.md: -------------------------------------------------------------------------------- 1 | # REST Gateway 2 | 3 | REST Gateway to access data in FrostFS using REST. 4 | 5 | Source code and more information can be found in [project's GitHub repository](https://github.com/TrueCloudLab/frostfs-rest-gw) 6 | 7 | ## .env settings 8 | 9 | ### REST_GW_VERSION=0.4.0 10 | 11 | Image version label to use for containers. 12 | 13 | If you want to use locally built image, just set its label here. 14 | Instead of pulling from DockerHub, the local image will be used. 15 | 16 | ### REST_GW_IMAGE=truecloudlab/frostfs-rest-gw 17 | 18 | Image label prefix to use for containers. 19 | 20 | ## Usage example 21 | 22 | - List container for specific owner: 23 | 24 | ```shell 25 | $ curl http://rest.frostfs.devenv:8090/v1/containers?ownerId=NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM | jq 26 | { 27 | "containers": [ 28 | { 29 | "attributes": [ 30 | { 31 | "key": "Timestamp", 32 | "value": "1663755230" 33 | } 34 | ], 35 | "basicAcl": "fbfbfff", 36 | "cannedAcl": "eacl-public-read-write", 37 | "containerId": "BKcAvz8awKKy9NGsGKi1Hoxxu9AjTGvjKMNMQamvdLmX", 38 | "containerName": "", 39 | "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", 40 | "placementPolicy": "REP 1 IN X\nCBF 1\nSELECT 1 FROM * AS X", 41 | "version": "v2.13" 42 | } 43 | ], 44 | "size": 1 45 | } 46 | ``` 47 | 48 | 49 | - Get container info: 50 | 51 | ```shell 52 | $ curl http://rest.frostfs.devenv:8090/v1/containers/BKcAvz8awKKy9NGsGKi1Hoxxu9AjTGvjKMNMQamvdLmX | jq 53 | { 54 | "attributes": [ 55 | { 56 | "key": "Timestamp", 57 | "value": "1663755230" 58 | } 59 | ], 60 | "basicAcl": "fbfbfff", 61 | "cannedAcl": "eacl-public-read-write", 62 | "containerId": "BKcAvz8awKKy9NGsGKi1Hoxxu9AjTGvjKMNMQamvdLmX", 63 | "containerName": "", 64 | "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", 65 | "placementPolicy": "REP 1 IN X\nCBF 1\nSELECT 1 FROM * AS X", 66 | "version": "v2.13" 67 | } 68 | ``` 69 | 70 | See all available routes http://rest.frostfs.devenv:8090/v1/docs 71 | -------------------------------------------------------------------------------- /docs/s3_gate.md: -------------------------------------------------------------------------------- 1 | # S3 Protocol gateway 2 | 3 | Protocol Gateway to access data in FrostFS using AWS S3 protocol 4 | 5 | Source code and more information can be found in [project's GitHub repository](https://github.com/TrueCloudLab/frostfs-s3-gw) 6 | 7 | ## .env settings 8 | 9 | ### S3_GW_VERSION=0.12.0 10 | 11 | Image version label to use for containers. 12 | 13 | If you want to use locally built image, just set its label here. Instead of 14 | pulling from DockerHub, the local image will be used. 15 | 16 | ### S3_GW_IMAGE=truecloudlab/frostfs-s3-gw 17 | 18 | Image label prefix to use for containers. 19 | -------------------------------------------------------------------------------- /docs/storage.md: -------------------------------------------------------------------------------- 1 | # Storage service 2 | 3 | ## .env settings 4 | 5 | ### NODE_VERSION 6 | 7 | Image version label to use for Storage docker containers. 8 | 9 | If you want to use locally built image, just set its label here. Instead of 10 | pulling from DockerHub, the local image will be used. 11 | 12 | ### NODE_IMAGE=truecloudlab/frostfs-ir 13 | 14 | Image label prefix to use for Storage docker containers. 15 | -------------------------------------------------------------------------------- /frostfs-adm.yml: -------------------------------------------------------------------------------- 1 | rpc-endpoint: http://morph-chain.frostfs.devenv:30333 2 | network: 3 | max_object_size: 67108864 4 | epoch_duration: 240 5 | basic_income_rate: 100000000 6 | homomorphic_hash_disabled: false 7 | fee: 8 | audit: 10000 9 | candidate: 10000000000 10 | container: 0 11 | container_alias: 0 12 | withdraw: 100000000 13 | credentials: 14 | az: "one" 15 | contract: "one" 16 | -------------------------------------------------------------------------------- /frostfs_config.mk: -------------------------------------------------------------------------------- 1 | # Update epoch duration in side chain blocks (make update.epoch_duration val=30) 2 | update.epoch_duration: 3 | @./bin/config.sh int EpochDuration $(val) 4 | 5 | # Update max object size in bytes (make update.max_object_size val=1000) 6 | update.max_object_size: 7 | @./bin/config.sh int MaxObjectSize $(val) 8 | 9 | # Update audit fee per result in fixed 12 (make update.audit_fee val=100) 10 | update.audit_fee: 11 | @./bin/config.sh int AuditFee $(val) 12 | 13 | # Update container fee per alphabet node in fixed 12 (make update.container_fee val=500) 14 | update.container_fee: 15 | @./bin/config.sh int ContainerFee $(val) 16 | 17 | # Update container alias fee per alphabet node in fixed 12 (make update.container_alias_fee val=100) 18 | update.container_alias_fee: 19 | @./bin/config.sh int ContainerAliasFee $(val) 20 | 21 | # Update amount of EigenTrust iterations (make update.eigen_trust_iterations val=2) 22 | update.eigen_trust_iterations: 23 | @./bin/config.sh int EigenTrustIterations $(val) 24 | 25 | 26 | # Update system dns to resolve container names (make update.system_dns val=container) 27 | update.system_dns: 28 | @./bin/config.sh string SystemDNS $(val) 29 | 30 | # Update alpha parameter of EigenTrust algorithm in 0 <= f <= 1.0 (make update.eigen_trust_alpha val=0.2) 31 | update.eigen_trust_alpha: 32 | @./bin/config.sh string EigenTrustAlpha $(val) 33 | 34 | # Update basic income rate in fixed 12 (make update.basic_income_rate val=1000) 35 | update.basic_income_rate: 36 | @./bin/config.sh int BasicIncomeRate $(val) 37 | 38 | # Update homomorphic hashing disabled flag (make update.homomorphic_hashing_disable val=true) 39 | update.homomorphic_hashing_disable: 40 | @./bin/config.sh bool HomomorphicHashingDisabled $(val) 41 | 42 | # Tick new epoch in side chain 43 | tick.epoch: 44 | @./bin/tick.sh 45 | -------------------------------------------------------------------------------- /help.mk: -------------------------------------------------------------------------------- 1 | .PHONY: help 2 | 3 | HELP_MAKEFILE_LIST=$(filter-out %/artifacts.mk, $(MAKEFILE_LIST)) 4 | 5 | # Show this help prompt 6 | help: 7 | @echo ' Usage:' 8 | @echo '' 9 | @echo ' make ' 10 | @echo '' 11 | @echo ' Targets:' 12 | @echo '' 13 | @awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9._/-]+ ?:/{ print " ", $$1, comment }' $(HELP_MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort -u 14 | -------------------------------------------------------------------------------- /services/basenet/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /services/basenet/.hosts: -------------------------------------------------------------------------------- 1 | IPV4_PREFIX.10 bastion.LOCAL_DOMAIN 2 | -------------------------------------------------------------------------------- /services/basenet/.int_test.env: -------------------------------------------------------------------------------- 1 | ../../.int_test.env -------------------------------------------------------------------------------- /services/basenet/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: "2.4" 4 | services: 5 | 6 | basenet: 7 | container_name: bastion 8 | image: ${BASTION_IMAGE}:${BASTION_VERSION} 9 | domainname: ${LOCAL_DOMAIN} 10 | hostname: bastion 11 | command: ["/bin/sleep", "infinity"] 12 | restart: always 13 | stop_signal: SIGKILL 14 | env_file: [ ".int_test.env" ] 15 | environment: 16 | - TZ=Etc/UTC 17 | networks: 18 | internet: 19 | ipv4_address: ${IPV4_PREFIX}.10 20 | volumes: 21 | - ./../../vendor/hosts:/etc/hosts 22 | networks: 23 | internet: 24 | driver: bridge 25 | ipam: 26 | driver: default 27 | config: 28 | - subnet: ${IPV4_PREFIX}.0/24 29 | -------------------------------------------------------------------------------- /services/http_gate/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /services/http_gate/.hosts: -------------------------------------------------------------------------------- 1 | IPV4_PREFIX.81 http.LOCAL_DOMAIN 2 | -------------------------------------------------------------------------------- /services/http_gate/.http.env: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrueCloudLab/frostfs-dev-env/37507199e2909ee0ca0cd10703f9f9622e1315b0/services/http_gate/.http.env -------------------------------------------------------------------------------- /services/http_gate/.int_test.env: -------------------------------------------------------------------------------- 1 | ../../.int_test.env -------------------------------------------------------------------------------- /services/http_gate/cfg/config.yml: -------------------------------------------------------------------------------- 1 | logger: 2 | level: debug 3 | 4 | rebalance_timer: 5m # Interval to check nodes health 5 | 6 | connect_timeout: 60s # Timeout to dial node 7 | 8 | request_timeout: 300s # Timeout to check node health during rebalance 9 | 10 | # The order in which resolvers are used to find an container id by name 11 | resolve_order: 12 | - nns 13 | 14 | server: 15 | - address: 0.0.0.0:80 16 | 17 | # Wallet settings 18 | wallet: 19 | path: /wallet.json # Path to wallet 20 | passphrase: one # Passphrase to decrypt wallet 21 | -------------------------------------------------------------------------------- /services/http_gate/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: "2.4" 4 | services: 5 | http_gate: 6 | image: ${HTTP_GW_IMAGE}:${HTTP_GW_VERSION} 7 | domainname: ${LOCAL_DOMAIN} 8 | hostname: http_gate 9 | container_name: http_gate 10 | restart: on-failure 11 | networks: 12 | http_gate_int: 13 | internet: 14 | ipv4_address: ${IPV4_PREFIX}.81 15 | volumes: 16 | - ./wallet.json:/wallet.json 17 | - ./../../vendor/hosts:/etc/hosts 18 | - ./cfg:/etc/frostfs/http 19 | stop_signal: SIGKILL 20 | env_file: [ ".env", ".http.env", ".int_test.env" ] 21 | command: [ "frostfs-http-gw", "--config", "/etc/frostfs/http/config.yml" ] 22 | environment: 23 | - HTTP_GW_RPC_ENDPOINT=http://morph-chain.${LOCAL_DOMAIN}:30333 24 | - HTTP_GW_PEERS_0_ADDRESS=s01.${LOCAL_DOMAIN}:8080 25 | - HTTP_GW_PEERS_0_WEIGHT=0.2 26 | - HTTP_GW_PEERS_1_ADDRESS=s02.${LOCAL_DOMAIN}:8080 27 | - HTTP_GW_PEERS_1_WEIGHT=0.2 28 | - HTTP_GW_PEERS_2_ADDRESS=s03.${LOCAL_DOMAIN}:8080 29 | - HTTP_GW_PEERS_2_WEIGHT=0.2 30 | - HTTP_GW_PEERS_3_ADDRESS=s04.${LOCAL_DOMAIN}:8080 31 | - HTTP_GW_PEERS_3_WEIGHT=0.2 32 | 33 | networks: 34 | http_gate_int: 35 | internet: 36 | external: true 37 | name: basenet_internet 38 | -------------------------------------------------------------------------------- /services/http_gate/node.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrueCloudLab/frostfs-dev-env/37507199e2909ee0ca0cd10703f9f9622e1315b0/services/http_gate/node.key -------------------------------------------------------------------------------- /services/http_gate/wallet.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.0", 3 | "accounts": [ 4 | { 5 | "address": "NXCvzXiodftxHHNQBzvQ6EwG8xfn5kmnbj", 6 | "key": "6PYXfN6BwDsQ8YnUBh32NX9J4241c1cits3wDWJoCMSqpJ7J9TxARcfQYv", 7 | "label": "http-gw", 8 | "contract": { 9 | "script": "DCEDGmD8vsOtF5JojjPiUv5LTDuo0nlvrCwR/iHdm9IpLhtBVuezJw==", 10 | "parameters": [ 11 | { 12 | "name": "parameter0", 13 | "type": "Signature" 14 | } 15 | ], 16 | "deployed": false 17 | }, 18 | "lock": false, 19 | "isDefault": false 20 | } 21 | ], 22 | "scrypt": { 23 | "n": 16384, 24 | "r": 8, 25 | "p": 8 26 | }, 27 | "extra": { 28 | "Tokens": null 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /services/ir/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /services/ir/.hosts: -------------------------------------------------------------------------------- 1 | IPV4_PREFIX.61 ir01.LOCAL_DOMAIN 2 | -------------------------------------------------------------------------------- /services/ir/.int_test.env: -------------------------------------------------------------------------------- 1 | ../../.int_test.env -------------------------------------------------------------------------------- /services/ir/.ir.env: -------------------------------------------------------------------------------- 1 | FROSTFS_IR_CONTRACTS_FROSTFSID=1943e9bb78a0fe2fe0c95fd2677eec2da6aa4aa5 2 | 3 | FROSTFS_IR_CONTROL_GRPC_ENDPOINT=127.0.0.1:16512 4 | -------------------------------------------------------------------------------- /services/ir/artifacts.mk: -------------------------------------------------------------------------------- 1 | # Get FrostFS IR artifacts (LOCODE database and FrostFS CLI) 2 | 3 | LOCODE_DB_ARCHIVE_PATH=./vendor 4 | LOCODE_DB_ARCHIVE_FILE=locode_db.gz 5 | 6 | get.ir: get.locode get.cli 7 | 8 | # Get FrostFS LOCODE database 9 | get.locode: LOCODE_DB_PATH?= 10 | get.locode: 11 | @mkdir -p ${LOCODE_DB_ARCHIVE_PATH} 12 | 13 | ifeq (${LOCODE_DB_PATH},) 14 | @echo "⇒ Download FrostFS LOCODE database from ${LOCODE_DB_URL}" 15 | @curl \ 16 | -sSL "${LOCODE_DB_URL}" \ 17 | -o ${LOCODE_DB_ARCHIVE_PATH}/${LOCODE_DB_ARCHIVE_FILE} 18 | else 19 | @echo "⇒ Copy local archive of FrostFS LOCODE database from ${LOCODE_DB_PATH}" 20 | @cp ${LOCODE_DB_PATH} ${LOCODE_DB_ARCHIVE_PATH}/${LOCODE_DB_ARCHIVE_FILE} 21 | endif 22 | 23 | gzip -dfk ${LOCODE_DB_ARCHIVE_PATH}/${LOCODE_DB_ARCHIVE_FILE} 24 | 25 | # Download FrostFS CLI 26 | .ONESHELL: 27 | get.cli: FROSTFS_CLI_FILE=./vendor/frostfs-cli 28 | get.cli: FROSTFS_CLI_ARCHIVE_FILE=${FROSTFS_CLI_FILE}.tar.gz 29 | get.cli: FROSTFS_CLI_PATH?= 30 | get.cli: 31 | @mkdir -p ./vendor 32 | 33 | ifeq (${FROSTFS_CLI_PATH},) 34 | @echo "⇒ Download FrostFS CLI binary from ${FROSTFS_CLI_URL}" 35 | @curl \ 36 | -ksSL "${FROSTFS_CLI_URL}" \ 37 | -o ${FROSTFS_CLI_ARCHIVE_FILE} 38 | @tar -xvf ${FROSTFS_CLI_ARCHIVE_FILE} -C ./vendor | xargs -I {} \ 39 | mv ./vendor/{} ${FROSTFS_CLI_FILE} 40 | @rm ${FROSTFS_CLI_ARCHIVE_FILE} 41 | else 42 | @echo "⇒ Copy local binary from ${FROSTFS_CLI_PATH}" 43 | @cp ${FROSTFS_CLI_PATH} ${FROSTFS_CLI_FILE} 44 | endif 45 | -------------------------------------------------------------------------------- /services/ir/az.json: -------------------------------------------------------------------------------- 1 | ../morph_chain/node-wallet.json -------------------------------------------------------------------------------- /services/ir/az.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrueCloudLab/frostfs-dev-env/37507199e2909ee0ca0cd10703f9f9622e1315b0/services/ir/az.key -------------------------------------------------------------------------------- /services/ir/cfg/config.yml: -------------------------------------------------------------------------------- 1 | # Logger section 2 | logger: 3 | level: debug # Minimum enabled logging level 4 | 5 | # Wallet settings 6 | wallet: 7 | path: /wallet.json # Path to NEP-6 NEO wallet file 8 | address: Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn # Account address in the wallet; ignore to use default address 9 | password: one # Account password in the wallet 10 | 11 | # Profiler section 12 | pprof: 13 | enabled: true 14 | address: :6060 # Endpoint for application pprof profiling; disabled by default 15 | shutdown_timeout: 30s # Timeout for profiling HTTP server graceful shutdown 16 | 17 | # Application metrics section 18 | prometheus: 19 | enabled: true 20 | address: :9090 # Endpoint for application prometheus metrics; disabled by default 21 | shutdown_timeout: 30s # Timeout for metrics HTTP server graceful shutdown 22 | 23 | # Toggling the sidechain-only mode 24 | without_mainnet: true 25 | 26 | # Neo main chain RPC settings 27 | mainnet: 28 | endpoint: 29 | client: # List of websocket RPC endpoints in mainchain; ignore if mainchain is disabled 30 | - address: ws://main-chain:30333/ws 31 | 32 | # Neo side chain RPC settings 33 | morph: 34 | endpoint: 35 | client: # List of websocket RPC endpoints in sidechain 36 | - address: ws://morph-chain:30333/ws 37 | validators: # List of hex-encoded 33-byte public keys of sidechain validators to vote for at application startup 38 | - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 39 | 40 | # Network time settings 41 | timers: 42 | emit: 50 # Number of sidechain blocks between GAS emission cycles; disabled by default 43 | stop_estimation: 44 | mul: 1 # Multiplier in x/y relation of when to stop basic income estimation within the epoch 45 | div: 4 # Divider in x/y relation of when to stop basic income estimation within the epoch 46 | collect_basic_income: 47 | mul: 1 # Multiplier in x/y relation of when to start basic income asset collection within the epoch 48 | div: 2 # Divider in x/y relation of when to start basic income asset collecting within the epoch 49 | distribute_basic_income: 50 | mul: 3 # Multiplier in x/y relation of when to start basic income asset distribution within the epoch 51 | div: 4 # Divider in x/y relation of when to start basic income asset distribution within the epoch 52 | 53 | # Storage node GAS emission settings 54 | emit: 55 | storage: 56 | amount: 1000000000 # Fixed8 value of sidechain GAS emitted to all storage nodes once per GAS emission cycle; disabled by default 57 | 58 | # Storage node removal settings 59 | netmap_cleaner: 60 | enabled: true # Enable voting for removing stale storage nodes from network map 61 | threshold: 3 # Number of FrostFS epoch without bootstrap request from storage node before it considered stale 62 | 63 | # Audit settings 64 | audit: 65 | pdp: 66 | max_sleep_interval: 100ms # Maximum timeout between object.RangeHash requests to the storage node 67 | 68 | # Settlement settings 69 | settlement: 70 | basic_income_rate: 100000000 # Optional: override basic income rate value from network config; applied only in debug mode 71 | audit_fee: 100000 # Optional: override audit fee value from network config; applied only in debug mode 72 | 73 | # LOCODE database 74 | locode: 75 | db: 76 | path: /locode/db # Path to UN/LOCODE database file 77 | -------------------------------------------------------------------------------- /services/ir/contract.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.0", 3 | "accounts": [ 4 | { 5 | "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", 6 | "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", 7 | "label": "", 8 | "contract": { 9 | "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==", 10 | "parameters": [ 11 | { 12 | "name": "parameter0", 13 | "type": "Signature" 14 | } 15 | ], 16 | "deployed": false 17 | }, 18 | "lock": false, 19 | "isDefault": false 20 | } 21 | ], 22 | "scrypt": { 23 | "n": 16384, 24 | "r": 8, 25 | "p": 8 26 | }, 27 | "extra": { 28 | "Tokens": null 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /services/ir/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: "2.4" 4 | services: 5 | 6 | ir01: 7 | image: ${IR_IMAGE}:${IR_VERSION} 8 | domainname: ${LOCAL_DOMAIN} 9 | hostname: ir01 10 | container_name: ir01 11 | restart: on-failure 12 | networks: 13 | ir_int: 14 | internet: 15 | ipv4_address: ${IPV4_PREFIX}.61 16 | stop_signal: SIGKILL 17 | volumes: 18 | - ./az.json:/wallet.json 19 | - ./az.key:/wallet01.key 20 | - ./../../vendor/hosts:/etc/hosts 21 | - ./../../vendor/locode_db:/locode/db 22 | - ./../../vendor/frostfs-cli:/frostfs-cli 23 | - ./healthcheck.sh:/healthcheck.sh 24 | - ./cfg:/etc/frostfs/ir 25 | env_file: [ ".env", ".ir.env", ".int_test.env" ] 26 | command: [ "frostfs-ir", "--config", "/etc/frostfs/ir/config.yml" ] 27 | healthcheck: 28 | test: ["CMD-SHELL", "/healthcheck.sh"] 29 | interval: 2s 30 | timeout: 1s 31 | retries: 5 32 | start_period: 20s 33 | 34 | ir-healthcheck: 35 | container_name: ir-healthcheck 36 | image: debian:10 37 | depends_on: 38 | ir01: 39 | condition: service_healthy 40 | 41 | networks: 42 | ir_int: 43 | internet: 44 | external: true 45 | name: basenet_internet 46 | -------------------------------------------------------------------------------- /services/ir/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /frostfs-cli control healthcheck \ 4 | --endpoint "$FROSTFS_IR_CONTROL_GRPC_ENDPOINT" \ 5 | --wallet /wallet01.key --ir | 6 | grep "Health status: READY" 7 | -------------------------------------------------------------------------------- /services/ir/prepare.mk: -------------------------------------------------------------------------------- 1 | # Deposit GAS from default wallet to FrostFS privnet contract 2 | prepare.ir: 3 | @./bin/config.sh int ContainerFee 0 4 | @./bin/config.sh int ContainerAliasFee 0 5 | -------------------------------------------------------------------------------- /services/morph_chain/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /services/morph_chain/.hosts: -------------------------------------------------------------------------------- 1 | IPV4_PREFIX.90 morph-chain.LOCAL_DOMAIN 2 | -------------------------------------------------------------------------------- /services/morph_chain/.int_test.env: -------------------------------------------------------------------------------- 1 | ../../.int_test.env -------------------------------------------------------------------------------- /services/morph_chain/artifacts.mk: -------------------------------------------------------------------------------- 1 | # Download FrostFS Contracts and Adm tool to deploy environment 2 | 3 | get.morph_chain: get.contracts get.adm 4 | 5 | # Download FrostFS Contracts 6 | get.contracts: FROSTFS_CONTRACTS_DEST=./vendor/contracts 7 | get.contracts: FROSTFS_CONTRACTS_ARCHIVE=frostfs-contracts.tar.gz 8 | get.contracts: 9 | @mkdir -p ${FROSTFS_CONTRACTS_DEST} 10 | 11 | ifeq (${FROSTFS_CONTRACTS_PATH},) 12 | @echo "⇒ Download compiled FrostFS contracts from ${FROSTFS_CONTRACTS_URL}" 13 | @curl -ksSL ${FROSTFS_CONTRACTS_URL} -o ${FROSTFS_CONTRACTS_ARCHIVE} 14 | @tar -xf ${FROSTFS_CONTRACTS_ARCHIVE} -C ${FROSTFS_CONTRACTS_DEST} --strip-components 1 15 | @rm ${FROSTFS_CONTRACTS_ARCHIVE} 16 | else 17 | @echo "⇒ Copy compiled contracts from ${FROSTFS_CONTRACTS_PATH}" 18 | @cp -r ${FROSTFS_CONTRACTS_PATH}/* ${FROSTFS_CONTRACTS_DEST} 19 | endif 20 | 21 | # Download FrostFS ADM tool 22 | get.adm: FROSTFS_ADM_DEST=./vendor/frostfs-adm 23 | get.adm: FROSTFS_ADM_ARCHIVE=frostfs-adm.tar.gz 24 | get.adm: 25 | 26 | ifeq (${FROSTFS_ADM_PATH},) 27 | @echo "⇒ Download FrostFS ADM binary from ${FROSTFS_ADM_URL}" 28 | @curl -skSL ${FROSTFS_ADM_URL} -o ${FROSTFS_ADM_ARCHIVE} 29 | @tar -xvf ${FROSTFS_ADM_ARCHIVE} -C ./vendor | xargs -I {} \ 30 | mv ./vendor/{} ${FROSTFS_ADM_DEST} 31 | @rm ${FROSTFS_ADM_ARCHIVE} 32 | else 33 | @echo "⇒ Copy frostfs-adm binary from ${FROSTFS_ADM_PATH}" 34 | @cp ${FROSTFS_ADM_PATH} ${FROSTFS_ADM_DEST} 35 | endif 36 | -------------------------------------------------------------------------------- /services/morph_chain/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | Path: "/wallets/node-wallet.json" 4 | Password: "one" 5 | -------------------------------------------------------------------------------- /services/morph_chain/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: "2.4" 4 | services: 5 | frostfs_morph_chain: 6 | image: ${NEOGO_IMAGE}:${NEOGO_VERSION} 7 | container_name: morph_chain 8 | command: ["node", "--config-path", "/config", "--privnet", "--debug"] 9 | domainname: ${LOCAL_DOMAIN} 10 | hostname: morph-chain 11 | networks: 12 | chain_int: 13 | internet: 14 | ipv4_address: ${IPV4_PREFIX}.90 15 | stop_signal: SIGKILL 16 | env_file: [ ".int_test.env" ] 17 | volumes: 18 | - ./protocol.privnet.yml:/config/protocol.privnet.yml 19 | - ./node-wallet.json:/wallets/node-wallet.json 20 | - ./config.yml:/wallets/config.yml 21 | - ./../../vendor/hosts:/etc/hosts 22 | - ./../../wallets/wallet.json:/wallets/wallet.json 23 | 24 | networks: 25 | chain_int: 26 | internet: 27 | external: true 28 | name: basenet_internet 29 | -------------------------------------------------------------------------------- /services/morph_chain/node-wallet.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.0", 3 | "name":null, 4 | "accounts": [ 5 | { 6 | "address": "Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn", 7 | "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", 8 | "label": "single", 9 | "contract": { 10 | "script": "DCECs2Ir9AF73+MXxYrtX0x1PyBrfbiWBG+n13S7xL9/jcJBVuezJw==", 11 | "parameters": [ 12 | { 13 | "name": "parameter0", 14 | "type": "Signature" 15 | } 16 | ], 17 | "deployed": false 18 | }, 19 | "lock": false, 20 | "extra":null, 21 | "isDefault": false 22 | }, 23 | { 24 | "address": "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP", 25 | "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", 26 | "label": "consensus", 27 | "contract": { 28 | "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6", 29 | "parameters": [ 30 | { 31 | "name": "parameter0", 32 | "type": "Signature" 33 | } 34 | ], 35 | "deployed": false 36 | }, 37 | "lock": false, 38 | "extra":null, 39 | "isDefault": false 40 | }, 41 | { 42 | "address": "NfgHwwTi3wHAS8aFAN243C5vGbkYDpqLHP", 43 | "key": "6PYM8VdX2BSm7BSXKzV4Fz6S3R9cDLLWNrD9nMjxW352jEv3fsC8N3wNLY", 44 | "label": "committee", 45 | "contract": { 46 | "script": "EQwhArNiK/QBe9/jF8WK7V9MdT8ga324lgRvp9d0u8S/f43CEUGe0Nw6", 47 | "parameters": [ 48 | { 49 | "name": "parameter0", 50 | "type": "Signature" 51 | } 52 | ], 53 | "deployed": false 54 | }, 55 | "lock": false, 56 | "extra":null, 57 | "isDefault": true 58 | } 59 | ], 60 | "scrypt": { 61 | "n": 16384, 62 | "r": 8, 63 | "p": 8 64 | }, 65 | "extra": { 66 | "Tokens": null 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /services/morph_chain/protocol.privnet.yml: -------------------------------------------------------------------------------- 1 | ProtocolConfiguration: 2 | Magic: 15405 3 | MaxTraceableBlocks: 200000 4 | SecondsPerBlock: 1 5 | MemPoolSize: 50000 6 | StandbyCommittee: 7 | - 02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2 8 | ValidatorsCount: 1 9 | SeedList: 10 | - 172.200.0.1:20333 11 | VerifyBlocks: true 12 | VerifyTransactions: true 13 | StateRootInHeader: true 14 | P2PSigExtensions: true 15 | 16 | ApplicationConfiguration: 17 | DBConfiguration: 18 | Type: "boltdb" 19 | BoltDBOptions: 20 | FilePath: "./db/morph.bolt" 21 | NodePort: 20333 22 | Relay: true 23 | DialTimeout: 3 24 | ProtoTickInterval: 2 25 | PingInterval: 30 26 | PingTimeout: 90 27 | MaxPeers: 10 28 | AttemptConnPeers: 5 29 | MinPeers: 0 30 | RPC: 31 | Address: 192.168.130.90 32 | Enabled: true 33 | SessionEnabled: true 34 | EnableCORSWorkaround: false 35 | MaxGasInvoke: 100 36 | Port: 30333 37 | P2PNotary: 38 | Enabled: true 39 | UnlockWallet: 40 | Path: "./wallets/node-wallet.json" 41 | Password: "one" 42 | Prometheus: 43 | Enabled: true 44 | Port: 20001 45 | Pprof: 46 | Enabled: true 47 | Port: 20011 48 | UnlockWallet: 49 | Path: "./wallets/node-wallet.json" 50 | Password: "one" 51 | -------------------------------------------------------------------------------- /services/nats/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /services/nats/.hosts: -------------------------------------------------------------------------------- 1 | IPV4_PREFIX.101 nats.LOCAL_DOMAIN 2 | -------------------------------------------------------------------------------- /services/nats/.int_test.env: -------------------------------------------------------------------------------- 1 | ../../.int_test.env -------------------------------------------------------------------------------- /services/nats/artifacts.mk: -------------------------------------------------------------------------------- 1 | # Create new TLS certs for NATS server and clients 2 | 3 | NATS_DIR=$(abspath services/nats) 4 | 5 | get.nats: 6 | @echo "⇒ Creating certs for NATS server and clients" 7 | ${NATS_DIR}/generate_cert.sh ${LOCAL_DOMAIN} > /dev/null 8 | -------------------------------------------------------------------------------- /services/nats/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: "2.4" 4 | services: 5 | nats: 6 | image: ${NATS_IMAGE}:${NATS_VERSION} 7 | domainname: ${LOCAL_DOMAIN} 8 | hostname: nats 9 | container_name: nats 10 | restart: on-failure 11 | dns: 12 | - ${IPV4_PREFIX}.101 13 | networks: 14 | nats_int: 15 | internet: 16 | ipv4_address: ${IPV4_PREFIX}.101 17 | volumes: 18 | - ./../../vendor/hosts:/etc/hosts 19 | - ./nats.conf:/etc/nats/frostfs-nats-server.conf 20 | - ./server-cert.pem:/certs/server-cert.pem 21 | - ./server-key.pem:/certs/server-key.pem 22 | - ./ca-cert.pem:/certs/ca-cert.pem 23 | stop_signal: SIGKILL 24 | env_file: [ ".env", ".int_test.env" ] 25 | command: ["-c", "/etc/nats/frostfs-nats-server.conf"] 26 | 27 | networks: 28 | nats_int: 29 | internet: 30 | external: true 31 | name: basenet_internet 32 | -------------------------------------------------------------------------------- /services/nats/generate_cert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source bin/helper.sh 4 | 5 | WORKDIR=$(dirname "$0") 6 | LOCAL_DOMAIN=$1 7 | 8 | CA_KEY=$WORKDIR/ca-key.pem 9 | CA_CRT=$WORKDIR/ca-cert.pem 10 | 11 | SRV_KEY=$WORKDIR/server-key.pem 12 | SRV_REQ=$WORKDIR/server-req.csr 13 | SRV_CRT=$WORKDIR/server-cert.pem 14 | 15 | CLI_KEY=$WORKDIR/client-key.pem 16 | CLI_REQ=$WORKDIR/client-req.csr 17 | CLI_CRT=$WORKDIR/client-cert.pem 18 | 19 | SUBJ="/O=NSPCC" 20 | 21 | if [[ ! -f $CA_KEY || ! -f $CA_CRT ]]; then 22 | openssl req -newkey rsa:4096 -x509 -days 365 -nodes -keyout $CA_KEY -out $CA_CRT -subj $SUBJ 2>&1 || 23 | die "CA certificate was not created" 24 | fi 25 | 26 | if [[ ! -f $SRV_KEY || ! -f $SRV_CRT ]]; then 27 | openssl req -newkey rsa:4096 -nodes -keyout $SRV_KEY -out $SRV_REQ -subj $SUBJ 2>&1 || 28 | die "Server certificate was not created" 29 | 30 | openssl x509 -req -days 365 -set_serial 01 -in $SRV_REQ -out $SRV_CRT -CA $CA_CRT -CAkey $CA_KEY \ 31 | -extensions san -extfile <(printf "[san]\nsubjectAltName=DNS:nats.$LOCAL_DOMAIN") 2>&1 || { 32 | rm $SRV_REQ 33 | die "Server certificate was not signed by CA" 34 | } 35 | 36 | rm $SRV_REQ 37 | fi 38 | 39 | if [[ ! -f $CLI_KEY || ! -f $CLI_CRT ]]; then 40 | openssl req -newkey rsa:4096 -nodes -keyout $CLI_KEY -out $CLI_REQ -subj $SUBJ 2>&1 || 41 | die "Client certificate was not created" 42 | 43 | openssl x509 -req -days 365 -set_serial 01 -in $CLI_REQ -out $CLI_CRT -CA $CA_CRT -CAkey $CA_KEY 2>&1 || { 44 | rm $CLI_REQ 45 | die "Client certificate was not signed by CA" 46 | } 47 | 48 | rm $CLI_REQ 49 | fi 50 | -------------------------------------------------------------------------------- /services/nats/nats.conf: -------------------------------------------------------------------------------- 1 | port: 4222 2 | monitor_port: 8222 3 | 4 | jetstream { 5 | store_dir=nats 6 | max_memory_store: 1GB 7 | max_file_store: 2GB 8 | } 9 | 10 | tls { 11 | cert_file: /certs/server-cert.pem 12 | key_file: /certs/server-key.pem 13 | ca_file: /certs/ca-cert.pem 14 | verify: true 15 | } 16 | -------------------------------------------------------------------------------- /services/rest_gate/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /services/rest_gate/.hosts: -------------------------------------------------------------------------------- 1 | IPV4_PREFIX.83 rest.LOCAL_DOMAIN 2 | -------------------------------------------------------------------------------- /services/rest_gate/.int_test.env: -------------------------------------------------------------------------------- 1 | ../../.int_test.env -------------------------------------------------------------------------------- /services/rest_gate/cfg/config.yml: -------------------------------------------------------------------------------- 1 | server: 2 | # The IP and port to listen on. 3 | listen-address: 0.0.0.0:8090 4 | 5 | # Wallet settings 6 | wallet: 7 | path: /wallet.json # Path to wallet 8 | passphrase: one # Password to decrypt wallet 9 | -------------------------------------------------------------------------------- /services/rest_gate/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: "2.4" 4 | services: 5 | rest_gate: 6 | image: ${REST_GW_IMAGE}:${REST_GW_VERSION} 7 | domainname: ${LOCAL_DOMAIN} 8 | hostname: rest 9 | container_name: rest_gate 10 | restart: on-failure 11 | networks: 12 | rest_gate_int: 13 | internet: 14 | ipv4_address: ${IPV4_PREFIX}.83 15 | volumes: 16 | - ./wallet.json:/wallet.json 17 | - ./../../vendor/hosts:/etc/hosts 18 | - ./cfg:/etc/frostfs/rest 19 | stop_signal: SIGKILL 20 | env_file: [ ".env", ".int_test.env" ] 21 | command: [ "frostfs-rest-gw", "--config", "/etc/frostfs/rest/config.yml" ] 22 | environment: 23 | - REST_GW_POOL_PEERS_0_ADDRESS=s01.${LOCAL_DOMAIN}:8080 24 | - REST_GW_POOL_PEERS_1_ADDRESS=s02.${LOCAL_DOMAIN}:8080 25 | - REST_GW_POOL_PEERS_2_ADDRESS=s03.${LOCAL_DOMAIN}:8080 26 | - REST_GW_POOL_PEERS_3_ADDRESS=s04.${LOCAL_DOMAIN}:8080 27 | 28 | networks: 29 | rest_gate_int: 30 | internet: 31 | external: true 32 | name: basenet_internet 33 | -------------------------------------------------------------------------------- /services/rest_gate/wallet.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.0", 3 | "accounts": [ 4 | { 5 | "address": "NPFCqWHfi9ixCJRu7DABRbVfXRbkSEr9Vo", 6 | "key": "6PYTAGjdaeicUDPqGv9mmgwb9kTwimWJJmmfNqJSDGH9qM79zSRcL9oHiB", 7 | "label": "REST Gateway", 8 | "contract": { 9 | "script": "DCECcuPzZCZ2VyDsm2jKEOMnU6xEWO2bF1dvOvBWTDFYB1ZBVuezJw==", 10 | "parameters": [ 11 | { 12 | "name": "parameter0", 13 | "type": "Signature" 14 | } 15 | ], 16 | "deployed": false 17 | }, 18 | "lock": false, 19 | "isDefault": false 20 | } 21 | ], 22 | "scrypt": { 23 | "n": 16384, 24 | "r": 8, 25 | "p": 8 26 | }, 27 | "extra": { 28 | "Tokens": null 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /services/s3_gate/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /services/s3_gate/.hosts: -------------------------------------------------------------------------------- 1 | IPV4_PREFIX.82 s3.LOCAL_DOMAIN 2 | IPV4_PREFIX.82 *.s3.LOCAL_DOMAIN 3 | -------------------------------------------------------------------------------- /services/s3_gate/.int_test.env: -------------------------------------------------------------------------------- 1 | ../../.int_test.env -------------------------------------------------------------------------------- /services/s3_gate/.s3.env: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrueCloudLab/frostfs-dev-env/37507199e2909ee0ca0cd10703f9f9622e1315b0/services/s3_gate/.s3.env -------------------------------------------------------------------------------- /services/s3_gate/cfg/config.yml: -------------------------------------------------------------------------------- 1 | logger: 2 | level: debug 3 | 4 | # Interval to check node health 5 | rebalance_interval: 30s 6 | 7 | # Timeout to check node health during rebalance 8 | healthcheck_timeout: 15s 9 | 10 | # Timeout to connect to a node 11 | connect_timeout: 10s 12 | 13 | # Limits for processing of clients' requests 14 | max_clients_count: 100 15 | 16 | # Deadline after which the gate sends error `RequestTimeout` to a client 17 | max_clients_deadline: 30s 18 | 19 | resolve_order: 20 | - nns 21 | 22 | server: 23 | - tls: 24 | enabled: true 25 | cert_file: /tls.crt 26 | key_file: /tls.key 27 | 28 | # Wallet configuration 29 | wallet: 30 | path: /wallet.json # Path to wallet 31 | passphrase: "s3" # Passphrase to decrypt wallet 32 | -------------------------------------------------------------------------------- /services/s3_gate/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: "2.4" 4 | services: 5 | s3_gate: 6 | image: ${S3_GW_IMAGE}:${S3_GW_VERSION} 7 | domainname: ${LOCAL_DOMAIN} 8 | hostname: s3_gate 9 | container_name: s3_gate 10 | restart: on-failure 11 | networks: 12 | s3_gate_int: 13 | internet: 14 | ipv4_address: ${IPV4_PREFIX}.82 15 | volumes: 16 | - ./wallet.json:/wallet.json 17 | - ./tls.key:/tls.key 18 | - ./tls.crt:/tls.crt 19 | - ./../../vendor/hosts:/etc/hosts 20 | - ./cfg:/etc/frostfs/s3 21 | stop_signal: SIGKILL 22 | env_file: [ ".env", ".s3.env", ".int_test.env" ] 23 | command: [ "frostfs-s3-gw", "--config", "/etc/frostfs/s3/config.yml" ] 24 | environment: 25 | - S3_GW_RPC_ENDPOINT=http://morph-chain.${LOCAL_DOMAIN}:30333 26 | - S3_GW_SERVER_0_ADDRESS=s3.${LOCAL_DOMAIN}:8080 27 | - S3_GW_LISTEN_DOMAINS=s3.${LOCAL_DOMAIN} 28 | - S3_GW_TREE_SERVICE=s01.${LOCAL_DOMAIN}:8080 29 | - S3_GW_PEERS_0_ADDRESS=s01.${LOCAL_DOMAIN}:8080 30 | - S3_GW_PEERS_0_WEIGHT=0.2 31 | - S3_GW_PEERS_1_ADDRESS=s02.${LOCAL_DOMAIN}:8080 32 | - S3_GW_PEERS_1_WEIGHT=0.2 33 | - S3_GW_PEERS_2_ADDRESS=s03.${LOCAL_DOMAIN}:8080 34 | - S3_GW_PEERS_2_WEIGHT=0.2 35 | - S3_GW_PEERS_3_ADDRESS=s04.${LOCAL_DOMAIN}:8080 36 | - S3_GW_PEERS_3_WEIGHT=0.2 37 | 38 | networks: 39 | s3_gate_int: 40 | internet: 41 | external: true 42 | name: basenet_internet 43 | -------------------------------------------------------------------------------- /services/s3_gate/tls.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDpDCCAowCCQDXZEH0aQRqFzANBgkqhkiG9w0BAQsFADCBkzELMAkGA1UEBhMC 3 | UlUxFjAUBgNVBAgMDVN0LlBldGVyc2J1cmcxGTAXBgNVBAcMEFNhaW50IFBldGVy 4 | c2J1cmcxDjAMBgNVBAoMBU5TUENDMREwDwYDVQQLDAhOZW8gU1BDQzERMA8GA1UE 5 | AwwIbnNwY2MucnUxGzAZBgkqhkiG9w0BCQEWDG9wc0Buc3BjYy5ydTAeFw0yMDA3 6 | MTMxNTQyMzZaFw0zMDA3MTExNTQyMzZaMIGTMQswCQYDVQQGEwJSVTEWMBQGA1UE 7 | CAwNU3QuUGV0ZXJzYnVyZzEZMBcGA1UEBwwQU2FpbnQgUGV0ZXJzYnVyZzEOMAwG 8 | A1UECgwFTlNQQ0MxETAPBgNVBAsMCE5lbyBTUENDMREwDwYDVQQDDAhuc3BjYy5y 9 | dTEbMBkGCSqGSIb3DQEJARYMb3BzQG5zcGNjLnJ1MIIBIjANBgkqhkiG9w0BAQEF 10 | AAOCAQ8AMIIBCgKCAQEAwqo2l4fS0U6wZCLh7VjQn1LXN8pZlVaA62C+g1SwoWV2 11 | Q5qM8FDihWj3UBO3F+6vUVJl8N5S0JroxxU6L48Wmshei145SLSl/F28tsk7Bbuz 12 | NOchonlelW77Xr6l7cDJBWUWGkDoq6a/S6w6jjCGhZq+X0gyS5nZ4HTouVNv2oFK 13 | eeJGtueLsS4zoVovrHdLSYdZH9/yC+E1WVCzQB+vdUF/vJLTuULgqncLV0sELmRl 14 | +xsnnAV/REJswtCmKgrmAv9pMebBw5EEgROTGazdToWdD5X44xTlHjUb1bMuF9tL 15 | YtUMdLxXceXZFhYhiTBO7ev9awKaNYslbxh+goJo1wIDAQABMA0GCSqGSIb3DQEB 16 | CwUAA4IBAQBDEGhAyOtfsNwbZ0oZIw06e0JXCmri+8jsn5Ly/yHU0+ecHgMA5AAQ 17 | AG2QRpZZtZCtD/Cj4i6nSTWbRhS0FgqY998p5Lnh/AXTZHBx0t3LKJupN59CIjCK 18 | 1eMEfQChoAZg66oO/obAFkq72gj8gpagMY9vFNVcszmse3FWrvlKmO1TwTEh+CzM 19 | 7wbmiL/ujm0lIf44pp0U4qYFcSimSDqbwOfeDPif9lMinzylDxMfaAKBHBHPj5Vt 20 | fX8dgf6MIqyz51u/2G0gHfXMDxXec8huYKt2EtPyavh6kFxxGvcA15m6seJTcu+h 21 | 6WzeQFa2NBg7Z3ai4DiPXirNtcHWeqxK 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /services/s3_gate/tls.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAwqo2l4fS0U6wZCLh7VjQn1LXN8pZlVaA62C+g1SwoWV2Q5qM 3 | 8FDihWj3UBO3F+6vUVJl8N5S0JroxxU6L48Wmshei145SLSl/F28tsk7BbuzNOch 4 | onlelW77Xr6l7cDJBWUWGkDoq6a/S6w6jjCGhZq+X0gyS5nZ4HTouVNv2oFKeeJG 5 | tueLsS4zoVovrHdLSYdZH9/yC+E1WVCzQB+vdUF/vJLTuULgqncLV0sELmRl+xsn 6 | nAV/REJswtCmKgrmAv9pMebBw5EEgROTGazdToWdD5X44xTlHjUb1bMuF9tLYtUM 7 | dLxXceXZFhYhiTBO7ev9awKaNYslbxh+goJo1wIDAQABAoIBAEIp3mJEjPgNOdDf 8 | NlEYpdfxLStOQIKMo0bdXAOBToOc28SAjDTGGSflFGIIQWwF+Vq3meRzfExgyouY 9 | AG3XwYQcZF4USX4XwG71YUXzQXdiY7ewc3Mos2gxD4kVXYpgwzJtOET2GN72zwAm 10 | asSXY7GXdesmu8mMYkxzEAKlhFgMj+bGE/4QQUBKG9ylGIdo07zmU6rAsVhnwQTb 11 | LE3cf+AxCeTVA7OsJCUUR4S9qsgXUN1WeaV8LNg0lYx8UTu1xlbrpSjx7B4eYy6J 12 | FGJWuT9b3X+cBLcGk3BzheUAfqBG2UFDxUCt0grqmmTBkB850MtCDhffhPjxxrD7 13 | KrwAcpECgYEA6HApn2VtWI/tDYCbNix6yxeqq73fO3ng6yFry1u7EYvl8hJXBgR4 14 | b6kAVc3y/9pZO/5D23dHl1PQtnU5401/j6dQrb8A2TMqZ1vA8XIdIMjOiVjZtYMF 15 | nXzmf78PEbw9jWlDVARJdAwkJeuDI4/HVvgiDAh3zxx5F8uDVP16/r8CgYEA1mXS 16 | 9owfLIPtPSxyMJoGU0jP7OP+HVwlKkXpvg7uBtINKSDW4UU4rnpIGW5MohR3ACWO 17 | ReFliOnGA5FXBp9GzkbJ+wIYovPIsGuBdxSsBlPY1S0yPlo30hr7E6cK3B3EuxDg 18 | SkbJcWp2EwXYEIyEcopbVUTTlBO3wmBFgm/Ps+kCgYA/+Kar9OlMR4hRgAS3uzQs 19 | cx4I2F/46YlKjU8yj9ODd8JYhk2nHVHcQWITO3RWkEyg41DftQtiDbJSlR7SfUDP 20 | U5gzyW69WISiH7GRgfucS0f0qxx4BVBlULvLitTl5631HnRmSivBIZpNSW01O1v8 21 | hpwwPaBjww1czCkgGgdg1wKBgQCkaSdTW/bX+z9lpvzWWnc5TN/uSJRpTW1Osphh 22 | 4C8WWeQvwvglfiDOZAWAQv5PWKQ9H4+v9P4Y9TSdLcpv0JrKuqxPabcc1xfyei6o 23 | 89hLbecc6vDZsfOWkowx8Oo6DDX+Qh3Nt+TorXxocBXV8vvqnkEV7ZbWuhwz2gHT 24 | 2gyMaQKBgEE7rNzm8Q03IqQ08eYaRw8gWz8EpLeVebrGqtoH9AR5cd4OeTeZAEqc 25 | iPehXctke2pUgS47XgG98G7Yg3E9UuOYM+H2nzQCoT7jrM0dZrVGZ0ty7z1a8QGe 26 | UrjaAC/cyIGdszhf0Rf3qA7450nit9Txh+ilLiumgnUezl+eJXyI 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /services/s3_gate/wallet.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.0", 3 | "name":null, 4 | "accounts": [ 5 | { 6 | "address": "NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt", 7 | "key": "6PYSPET41jKtqie2cfkqgy7q9ueeucH8bX9Gotm2HwdNEDptj6aBe8dDg8", 8 | "label": "FrostFS S3 Gate", 9 | "contract": { 10 | "script": "DCEDE7GsOoB24VWn55eyTwtlDMytWUHqWdfP1RoCSosqBr9BVuezJw==", 11 | "parameters": [ 12 | { 13 | "name": "parameter0", 14 | "type": "Signature" 15 | } 16 | ], 17 | "deployed": false 18 | }, 19 | "lock": false, 20 | "extra":null, 21 | "isDefault": false 22 | } 23 | ], 24 | "scrypt": { 25 | "n": 16384, 26 | "r": 8, 27 | "p": 8 28 | }, 29 | "extra": { 30 | "Tokens": null 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /services/storage/.env: -------------------------------------------------------------------------------- 1 | ../../.env -------------------------------------------------------------------------------- /services/storage/.hosts: -------------------------------------------------------------------------------- 1 | IPV4_PREFIX.71 s01.LOCAL_DOMAIN 2 | IPV4_PREFIX.72 s02.LOCAL_DOMAIN 3 | IPV4_PREFIX.73 s03.LOCAL_DOMAIN 4 | IPV4_PREFIX.74 s04.LOCAL_DOMAIN 5 | -------------------------------------------------------------------------------- /services/storage/.int_test.env: -------------------------------------------------------------------------------- 1 | ../../.int_test.env -------------------------------------------------------------------------------- /services/storage/.storage.env: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrueCloudLab/frostfs-dev-env/37507199e2909ee0ca0cd10703f9f9622e1315b0/services/storage/.storage.env -------------------------------------------------------------------------------- /services/storage/artifacts.mk: -------------------------------------------------------------------------------- 1 | # Create new TLS certs to FrostFS node 2 | 3 | STORAGE_DIR=$(abspath services/storage) 4 | 5 | get.storage: 6 | @echo "⇒ Creating TLS certs to FrostFS node" 7 | ${STORAGE_DIR}/generate_cert.sh ${LOCAL_DOMAIN} > /dev/null 8 | -------------------------------------------------------------------------------- /services/storage/cfg/config.yml: -------------------------------------------------------------------------------- 1 | # Logger section 2 | logger: 3 | level: debug # Minimum enabled logging level 4 | 5 | # Profiler section 6 | pprof: 7 | enabled: true 8 | address: :6060 # Server address 9 | shutdown_timeout: 15s # Timeout for profiling HTTP server graceful shutdown 10 | 11 | # Application metrics section 12 | prometheus: 13 | enabled: true 14 | address: :9090 # Server address 15 | shutdown_timeout: 15s # Timeout for metrics HTTP server graceful shutdown 16 | 17 | # Morph section 18 | morph: 19 | dial_timeout: 30s # Timeout for side chain NEO RPC client connection 20 | rpc_endpoint: # Side chain NEO RPC endpoints 21 | - address: ws://morph-chain:30333/ws 22 | priority: 1 23 | 24 | # Common storage node settings 25 | node: 26 | attribute_0: "User-Agent:FrostFS/0.34" 27 | notification: 28 | enabled: true # Turn on object notification service 29 | endpoint: "tls://nats.frostfs.devenv:4222" # Notification server endpoint 30 | timeout: "6s" # Timeout for object notification client connection 31 | default_topic: "test" # Default topic for object notifications if not found in object's meta 32 | certificate: "/etc/frostfs-node/nats.tls.cert" # Path to TLS certificate 33 | key: "/etc/frostfs-node/nats.tls.key" # Path to TLS key 34 | ca: "/etc/frostfs-node/nats.ca.crt" # Path to optional CA certificate 35 | 36 | # Tree section 37 | tree: 38 | enabled: true 39 | 40 | # Storage engine configuration 41 | storage: 42 | shard: 43 | 0: 44 | writecache: 45 | enabled: false 46 | path: /storage/wc0 # Write-cache root directory 47 | 48 | metabase: 49 | path: /storage/meta0 # Path to the metabase 50 | 51 | blobstor: 52 | - type: blobovnicza 53 | path: /storage/blobovnicza0 # Blobovnicza root directory 54 | depth: 2 55 | width: 4 56 | - type: fstree 57 | path: /storage/fstree0 # FSTree root directory 58 | depth: 2 59 | 60 | pilorama: 61 | path: /storage/pilorama0 # Path to the pilorama database 62 | 63 | 1: 64 | writecache: 65 | enabled: false 66 | path: /storage/wc1 # Write-cache root directory 67 | 68 | metabase: 69 | path: /storage/meta1 # Path to the metabase 70 | 71 | blobstor: 72 | - type: blobovnicza 73 | path: /storage/blobovnicza1 # Blobovnicza root directory 74 | depth: 2 75 | width: 4 76 | - type: fstree 77 | path: /storage/fstree1 # FSTree root directory 78 | depth: 2 79 | 80 | pilorama: 81 | path: /storage/pilorama1 # Path to the pilorama database 82 | -------------------------------------------------------------------------------- /services/storage/cli-cfg.yml: -------------------------------------------------------------------------------- 1 | wallet: /wallet.json 2 | password: "" 3 | -------------------------------------------------------------------------------- /services/storage/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | version: "2.4" 4 | services: 5 | storage01: 6 | image: ${NODE_IMAGE}:${NODE_VERSION} 7 | domainname: ${LOCAL_DOMAIN} 8 | hostname: s01 9 | container_name: s01 10 | restart: on-failure 11 | networks: 12 | storage_int: 13 | internet: 14 | ipv4_address: ${IPV4_PREFIX}.71 15 | volumes: 16 | - ./wallet01.json:/wallet.json 17 | - ./../../vendor/hosts:/etc/hosts 18 | - storage_s01:/storage 19 | - ./../../vendor/frostfs-cli:/frostfs-cli 20 | - ./cli-cfg.yml:/cli-cfg.yml 21 | - ./healthcheck.sh:/healthcheck.sh 22 | - ./s04tls.crt:/etc/ssl/certs/s04tls.crt 23 | - ../nats/client-cert.pem:/etc/frostfs-node/nats.tls.cert 24 | - ../nats/client-key.pem:/etc/frostfs-node/nats.tls.key 25 | - ../nats/ca-cert.pem:/etc/frostfs-node/nats.ca.crt 26 | - ./cfg:/etc/frostfs/storage 27 | stop_signal: SIGKILL 28 | env_file: [ ".env", ".storage.env", ".int_test.env" ] 29 | command: [ "frostfs-node", "--config", "/etc/frostfs/storage/config.yml" ] 30 | environment: 31 | - FROSTFS_NODE_WALLET_PATH=./wallet.json 32 | - FROSTFS_NODE_WALLET_PASSWORD= 33 | - FROSTFS_NODE_ADDRESSES=s01.${LOCAL_DOMAIN}:8080 34 | - FROSTFS_GRPC_0_ENDPOINT=s01.${LOCAL_DOMAIN}:8080 35 | - FROSTFS_CONTROL_GRPC_ENDPOINT=s01.${LOCAL_DOMAIN}:8081 36 | - FROSTFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU MOW 37 | - FROSTFS_NODE_ATTRIBUTE_2=Price:22 38 | healthcheck: 39 | test: ["CMD-SHELL", "/healthcheck.sh"] 40 | interval: 2s 41 | timeout: 1s 42 | retries: 5 43 | start_period: 10s 44 | 45 | storage02: 46 | image: ${NODE_IMAGE}:${NODE_VERSION} 47 | domainname: ${LOCAL_DOMAIN} 48 | hostname: s02 49 | container_name: s02 50 | restart: on-failure 51 | networks: 52 | storage_int: 53 | internet: 54 | ipv4_address: ${IPV4_PREFIX}.72 55 | volumes: 56 | - ./wallet02.json:/wallet.json 57 | - ./../../vendor/hosts:/etc/hosts 58 | - storage_s02:/storage 59 | - ./../../vendor/frostfs-cli:/frostfs-cli 60 | - ./cli-cfg.yml:/cli-cfg.yml 61 | - ./healthcheck.sh:/healthcheck.sh 62 | - ./s04tls.crt:/etc/ssl/certs/s04tls.crt 63 | - ../nats/client-cert.pem:/etc/frostfs-node/nats.tls.cert 64 | - ../nats/client-key.pem:/etc/frostfs-node/nats.tls.key 65 | - ../nats/ca-cert.pem:/etc/frostfs-node/nats.ca.crt 66 | - ./cfg:/etc/frostfs/storage 67 | stop_signal: SIGKILL 68 | env_file: [ ".env", ".storage.env", ".int_test.env" ] 69 | command: [ "frostfs-node", "--config", "/etc/frostfs/storage/config.yml" ] 70 | environment: 71 | - FROSTFS_NODE_WALLET_PATH=./wallet.json 72 | - FROSTFS_NODE_WALLET_PASSWORD= 73 | - FROSTFS_NODE_ADDRESSES=s02.${LOCAL_DOMAIN}:8080 74 | - FROSTFS_GRPC_0_ENDPOINT=s02.${LOCAL_DOMAIN}:8080 75 | - FROSTFS_CONTROL_GRPC_ENDPOINT=s02.${LOCAL_DOMAIN}:8081 76 | - FROSTFS_NODE_ATTRIBUTE_1=UN-LOCODE:RU LED 77 | - FROSTFS_NODE_ATTRIBUTE_2=Price:33 78 | healthcheck: 79 | test: ["CMD-SHELL", "/healthcheck.sh"] 80 | interval: 2s 81 | timeout: 1s 82 | retries: 5 83 | start_period: 10s 84 | 85 | storage03: 86 | image: ${NODE_IMAGE}:${NODE_VERSION} 87 | domainname: ${LOCAL_DOMAIN} 88 | hostname: s03 89 | container_name: s03 90 | restart: on-failure 91 | networks: 92 | storage_int: 93 | internet: 94 | ipv4_address: ${IPV4_PREFIX}.73 95 | volumes: 96 | - ./wallet03.json:/wallet.json 97 | - ./../../vendor/hosts:/etc/hosts 98 | - storage_s03:/storage 99 | - ./../../vendor/frostfs-cli:/frostfs-cli 100 | - ./cli-cfg.yml:/cli-cfg.yml 101 | - ./healthcheck.sh:/healthcheck.sh 102 | - ./s04tls.crt:/etc/ssl/certs/s04tls.crt 103 | - ../nats/client-cert.pem:/etc/frostfs-node/nats.tls.cert 104 | - ../nats/client-key.pem:/etc/frostfs-node/nats.tls.key 105 | - ../nats/ca-cert.pem:/etc/frostfs-node/nats.ca.crt 106 | - ./cfg:/etc/frostfs/storage 107 | stop_signal: SIGKILL 108 | env_file: [ ".env", ".storage.env", ".int_test.env" ] 109 | command: [ "frostfs-node", "--config", "/etc/frostfs/storage/config.yml" ] 110 | environment: 111 | - FROSTFS_NODE_WALLET_PATH=./wallet.json 112 | - FROSTFS_NODE_WALLET_PASSWORD= 113 | - FROSTFS_NODE_ADDRESSES=s03.${LOCAL_DOMAIN}:8080 114 | - FROSTFS_GRPC_0_ENDPOINT=s03.${LOCAL_DOMAIN}:8080 115 | - FROSTFS_CONTROL_GRPC_ENDPOINT=s03.${LOCAL_DOMAIN}:8081 116 | - FROSTFS_NODE_ATTRIBUTE_1=UN-LOCODE:SE STO 117 | - FROSTFS_NODE_ATTRIBUTE_2=Price:11 118 | healthcheck: 119 | test: ["CMD-SHELL", "/healthcheck.sh"] 120 | interval: 2s 121 | timeout: 1s 122 | retries: 5 123 | start_period: 10s 124 | 125 | storage04: 126 | image: ${NODE_IMAGE}:${NODE_VERSION} 127 | domainname: ${LOCAL_DOMAIN} 128 | hostname: s04 129 | container_name: s04 130 | restart: on-failure 131 | networks: 132 | storage_int: 133 | internet: 134 | ipv4_address: ${IPV4_PREFIX}.74 135 | volumes: 136 | - ./wallet04.json:/wallet.json 137 | - ./../../vendor/hosts:/etc/hosts 138 | - storage_s04:/storage 139 | - ./../../vendor/frostfs-cli:/frostfs-cli 140 | - ./cli-cfg.yml:/cli-cfg.yml 141 | - ./healthcheck.sh:/healthcheck.sh 142 | - ./s04tls.crt:/tls.crt 143 | - ./s04tls.key:/tls.key 144 | - ../nats/client-cert.pem:/etc/frostfs-node/nats.tls.cert 145 | - ../nats/client-key.pem:/etc/frostfs-node/nats.tls.key 146 | - ../nats/ca-cert.pem:/etc/frostfs-node/nats.ca.crt 147 | - ./cfg:/etc/frostfs/storage 148 | stop_signal: SIGKILL 149 | env_file: [ ".env", ".storage.env", ".int_test.env" ] 150 | command: [ "frostfs-node", "--config", "/etc/frostfs/storage/config.yml" ] 151 | environment: 152 | - FROSTFS_NODE_WALLET_PATH=./wallet.json 153 | - FROSTFS_NODE_WALLET_PASSWORD= 154 | - FROSTFS_NODE_ADDRESSES=s04.${LOCAL_DOMAIN}:8080 grpcs://s04.${LOCAL_DOMAIN}:8082 155 | - FROSTFS_CONTROL_GRPC_ENDPOINT=s04.${LOCAL_DOMAIN}:8081 156 | - FROSTFS_GRPC_NUM=2 157 | - FROSTFS_GRPC_0_ENDPOINT=s04.${LOCAL_DOMAIN}:8080 158 | - FROSTFS_GRPC_1_ENDPOINT=s04.${LOCAL_DOMAIN}:8082 159 | - FROSTFS_GRPC_1_TLS_ENABLED=true 160 | - FROSTFS_GRPC_1_TLS_CERTIFICATE=/tls.crt 161 | - FROSTFS_GRPC_1_TLS_KEY=/tls.key 162 | - FROSTFS_NODE_ATTRIBUTE_1=UN-LOCODE:FI HEL 163 | - FROSTFS_NODE_ATTRIBUTE_2=Price:44 164 | healthcheck: 165 | test: ["CMD-SHELL", "/healthcheck.sh"] 166 | interval: 2s 167 | timeout: 1s 168 | retries: 5 169 | start_period: 10s 170 | 171 | sn-healthcheck: 172 | container_name: sn-healthcheck 173 | image: debian:10 174 | depends_on: 175 | storage01: 176 | condition: service_healthy 177 | storage02: 178 | condition: service_healthy 179 | storage03: 180 | condition: service_healthy 181 | storage04: 182 | condition: service_healthy 183 | 184 | volumes: 185 | storage_s01: 186 | storage_s02: 187 | storage_s03: 188 | storage_s04: 189 | 190 | networks: 191 | storage_int: 192 | internet: 193 | external: true 194 | name: basenet_internet 195 | -------------------------------------------------------------------------------- /services/storage/generate_cert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source bin/helper.sh 4 | 5 | WORKDIR=$(dirname "$0") 6 | LOCAL_DOMAIN=$1 7 | SSL_CONFIG=$(mktemp) 8 | CERT="${WORKDIR}/s04tls.crt" 9 | KEY="${WORKDIR}/s04tls.key" 10 | 11 | 12 | if [[ ! -f ${CERT} ]]; then 13 | ( 14 | echo "[req]"; \ 15 | echo "distinguished_name=req"; \ 16 | echo "req_extensions=san"; \ 17 | echo "[san]"; \ 18 | echo "subjectAltName=DNS:s04.${LOCAL_DOMAIN}" 19 | ) > ${SSL_CONFIG} 20 | 21 | openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes \ 22 | -subj "/C=RU/ST=SPB/L=St.Petersburg/O=NSPCC/OU=NSPCC/CN=s04.${LOCAL_DOMAIN}" \ 23 | -keyout "${KEY}" -out "${CERT}" -extensions san -config "${SSL_CONFIG}" &> /dev/null || { 24 | die "Failed to generate SSL certificate for s04" 25 | } 26 | fi 27 | -------------------------------------------------------------------------------- /services/storage/healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /frostfs-cli control healthcheck -c /cli-cfg.yml \ 4 | --endpoint "$FROSTFS_CONTROL_GRPC_ENDPOINT" | 5 | grep "Health status: READY" 6 | -------------------------------------------------------------------------------- /services/storage/prepare.mk: -------------------------------------------------------------------------------- 1 | # Add self-signed node TLS certificate to trusted store 2 | 3 | prepare.storage: 4 | @echo "Adding self-signed TLS certs to trusted store" 5 | @./bin/addCert.sh 6 | -------------------------------------------------------------------------------- /services/storage/wallet01.json: -------------------------------------------------------------------------------- 1 | { 2 | "version":"3.0", 3 | "accounts":[ 4 | { 5 | "address":"NejLbQpojKJWec4NQRMBhzsrmCyhXfGJJe", 6 | "key":"6PYSS8ccmBcttfcw2YJh8VcNSoeQbQLuJLQ7HoKeYF5roRmGs9LUvmKcWz", 7 | "label":"", 8 | "contract":{ 9 | "script":"DCECK7QEHFDWB/+HHex+TNd3g4jg6mhJ2EzL2aqPMuFqgTFBVuezJw==", 10 | "parameters":[ 11 | { 12 | "name":"parameter0", 13 | "type":"Signature" 14 | } 15 | ], 16 | "deployed":false 17 | }, 18 | "lock":false, 19 | "extra":null, 20 | "isDefault":true 21 | } 22 | ], 23 | "name":null, 24 | "scrypt":{ 25 | "n":16384, 26 | "r":8, 27 | "p":8 28 | }, 29 | "extra":{ 30 | "Tokens":null 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /services/storage/wallet02.json: -------------------------------------------------------------------------------- 1 | { 2 | "version":"3.0", 3 | "accounts":[ 4 | { 5 | "address":"NVXXy3hNTvwVEZa2dAibALyJB3Q86aiHvL", 6 | "key":"6PYXd9hxMYfaCkgeZp3q1RoMB921RQFkRxYftcacTJ2S7MUwnivrxi6Yk5", 7 | "label":"", 8 | "contract":{ 9 | "script":"DCED/2W2rnkTSk3OnQ0504Uem6tO6Xq/hugeHFu8UM0oJq5BVuezJw==", 10 | "parameters":[ 11 | { 12 | "name":"parameter0", 13 | "type":"Signature" 14 | } 15 | ], 16 | "deployed":false 17 | }, 18 | "lock":false, 19 | "isDefault":false 20 | } 21 | ], 22 | "scrypt":{ 23 | "n":16384, 24 | "r":8, 25 | "p":8 26 | }, 27 | "extra":{ 28 | "Tokens":null 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /services/storage/wallet03.json: -------------------------------------------------------------------------------- 1 | { 2 | "version":"3.0", 3 | "accounts":[ 4 | { 5 | "address":"NPTmih9X14Y7xLvmD6RVtDHdH1Y9qJwoTe", 6 | "key":"6PYXNeQzge9fWztVnWYRbr5Mh9q1y4npKVARHYGb484Hct1iNd3vXGR1kk", 7 | "label":"", 8 | "contract":{ 9 | "script":"DCECrJIM198LYbKJBy5rlG4tpOGjG5qxxiG7R14w+kqxAsNBVuezJw==", 10 | "parameters":[ 11 | { 12 | "name":"parameter0", 13 | "type":"Signature" 14 | } 15 | ], 16 | "deployed":false 17 | }, 18 | "lock":false, 19 | "isDefault":false 20 | } 21 | ], 22 | "scrypt":{ 23 | "n":16384, 24 | "r":8, 25 | "p":8 26 | }, 27 | "extra":{ 28 | "Tokens":null 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /services/storage/wallet04.json: -------------------------------------------------------------------------------- 1 | { 2 | "version":"3.0", 3 | "accounts":[ 4 | { 5 | "address":"Ne2DAQbWvP1s7TbtFc7BStKMnjKJdBaVRm", 6 | "key":"6PYWCsGWx8uSVYK94tvK7Ccit8x8Z3f3dHADTFTgLhT9NBXTBqBECL8AyC", 7 | "label":"", 8 | "contract":{ 9 | "script":"DCEDjIYpWeVrQ+IPeRh8T+ngvHyMZsFgPmzw7H+Hq2sI3DVBVuezJw==", 10 | "parameters":[ 11 | { 12 | "name":"parameter0", 13 | "type":"Signature" 14 | } 15 | ], 16 | "deployed":false 17 | }, 18 | "lock":false, 19 | "isDefault":false 20 | } 21 | ], 22 | "scrypt":{ 23 | "n":16384, 24 | "r":8, 25 | "p":8 26 | }, 27 | "extra":{ 28 | "Tokens":null 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /wallets/wallet.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "3.0", 3 | "accounts": [ 4 | { 5 | "address": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", 6 | "key": "6PYP7YrwGnLuu4WYQbEe3WJiC44aKmqwqawLsp7H3oh5vocS9xTv2ZfTp3", 7 | "label": "", 8 | "contract": { 9 | "script": "DCEDGmxvu98CyjUXRfqGubpalFLXhaxPf8K3VIyipGxPz0pBVuezJw==", 10 | "parameters": [ 11 | { 12 | "name": "parameter0", 13 | "type": "Signature" 14 | } 15 | ], 16 | "deployed": false 17 | }, 18 | "lock": false, 19 | "isdefault": false 20 | } 21 | ], 22 | "scrypt": { 23 | "n": 16384, 24 | "r": 8, 25 | "p": 8 26 | }, 27 | "extra": { 28 | "Tokens": null 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /wallets/wallet.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrueCloudLab/frostfs-dev-env/37507199e2909ee0ca0cd10703f9f9622e1315b0/wallets/wallet.key --------------------------------------------------------------------------------