Skip to content

Commit 3dce419

Browse files
committed
Merge branch 'main' into solana
2 parents d9a38bf + 718f50a commit 3dce419

File tree

125 files changed

+9286
-3318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+9286
-3318
lines changed

.gitallowed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
account: '\d{12}'
22
account: "\d{12}"
3-
account=\d{12}
3+
account=\d{12}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ Consult the [CONTRIBUTING](https://github.com/aws-samples/aws-blockchain-node-ru
1212
### More
1313

1414
- [ ] Yes, I have tested the PR using my local account setup (Provide any test evidence report under Additional Notes)
15-
- [ ] Mandatory for new node blueprints. Yes, I have added a example to support my blueprint PR
16-
- [ ] Mandatory for new node blueprints. Yes, I have updated the `website/docs` or `website/blog` section for this feature
17-
- [ ] Yes, I ran `pre-commit run -a` with this PR. Link for installing [pre-commit](https://pre-commit.com/) locally
15+
- [ ] Mandatory for new node blueprints. Yes, I have added usage example to the `README.md` file in my blueprint folder
16+
- [ ] Mandatory for new node blueprints. Yes, I have implemented automated tests for all stacks in my blueprint and they pass
17+
- [ ] Mandatory for new node blueprints. Yes, I have added a reference to my `README.md` file to `website/docs` section for this feature
18+
- [ ] Yes, I have set up and ran all [pre-merge quality control tools](./docs/pre-merge-tools.md) on my local machine and they don't show warnings.
1819

1920
### For Moderators
2021

21-
- [ ] E2E Test successfully complete before merge?
22+
- [ ] The tests for all current blueprints successfully complete before merge?
23+
- [ ] Mandatory for new node blueprints. All [pre-merge quality control tools](./docs/pre-merge-tools.md) and `cdk-nag` tools don't show warnings?
24+
- [ ] Mandatory for new node blueprints. The deployment test works on blank AWS account according to instructions in the `README.md` before merge?
25+
- [ ] Mandatory for new node blueprints. The website builds without errors?
2226

2327
### Additional Notes
2428

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ single-node-deploy*.json
3333
ha-nodes-deploy*.json
3434

3535
*.OLD
36-
.env
36+
.env
37+
.idea

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ repos:
1010
- id: detect-private-key
1111
- id: detect-aws-credentials
1212
args: ['--allow-missing-credentials']
13+
- id: forbid-submodules

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ To send us a pull request, please:
3232
1. Fork the repository.
3333
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3434
3. Ensure local tests pass.
35-
4. If you contribute a new CDK app, make sure you use [cdk-nag](https://aws.amazon.com/blogs/devops/manage-application-security-and-compliance-with-the-aws-cloud-development-kit-and-cdk-nag/) in your applicaiton.
36-
4. Commit to your fork using clear commit messages.
37-
5. Send us a pull request, answering any default questions in the pull request interface.
38-
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
35+
4. If you contribute a new CDK app, make sure you use [cdk-nag](https://aws.amazon.com/blogs/devops/manage-application-security-and-compliance-with-the-aws-cloud-development-kit-and-cdk-nag/) in your application.
36+
4. Set up and run [pre-merge quality control tools](./docs/pre-merge-tools.md) on your local machine.
37+
5. Commit to your fork using clear commit messages.
38+
6. Send us a pull request, answering any default questions in the pull request interface.
39+
7. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3940

4041
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4142
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1414
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1515
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1616
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17-

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# AWS Blockchain Node Runners
22

3-
This repository contains sample [AWS Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/) applications that help to set up and run self-service blockchain nodes for different protocols on AWS.
3+
This repository contains sample [AWS Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/) applications (Node Runner Blueprints) to deploy on AWS self-service blockchain nodes for various protocols. For more information see [Introducing AWS Blockchain Node Runners](https://aws-samples.github.io/aws-blockchain-node-runners/docs/intro).
44

5-
- [Setup instructions for Ethereum nodes on AWS](./lib/ethereum/README.md)
5+
### Documentation
6+
For deployment instructions see [AWS Blockchain Node Runners Blueprints](https://aws-samples.github.io/aws-blockchain-node-runners/docs/Blueprints/intro)
7+
8+
### Adding blueprints for new nodes
9+
10+
If you'd like propose a Node Runner Blueprint for your node see [Adding new Node Runner Blueprints](./docs/adding-new-nodes.md)
11+
12+
### Directory structure
13+
14+
- `docs` - General documentation applicable to all Node Runner Blueprints (CDK applications within the `./lib` directory)
15+
- `lib` - The place for all Node Runner Blueprints and shared re-usable [CDK constructs](https://docs.aws.amazon.com/cdk/v2/guide/constructs.html)
16+
- `lib/constructs` - [CDK constructs](https://docs.aws.amazon.com/cdk/v2/guide/constructs.html) used in Node Runner Blueprints
17+
- `lib/your-chain` - Node Runner Blueprint for a specific chain
18+
- `website` - Content for the project web site built with [Docusaurus](https://docusaurus.io/)
19+
- `website/docs` - Place for the new blueprint deployment instructions. (If you are adding a new blueprint, use on of the existing examples to refer to the `README.md` file within your Node Runner Blueprint directory inside `lib`).
20+
21+
### License
22+
This repository uses MIT License. See more in [LICENSE](./LICENSE)
23+
24+
### Contributing
25+
See [CONTRIBUTING](./CONTRIBUTING.md) for more information.

docs/adding-new-nodes.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Adding Node Runner Blueprints
2+
3+
First of all, THANK YOU! The easier it is to run a blockchain node on AWS the simpler it is for the ecosystem to build with it. Here are the major steps to contribute a Node Runner Blueprint:
4+
5+
1. Check with our list of [Issues](https://github.com/aws-samples/aws-blockchain-node-runners/issues) if someone is already working on the node type you are after. If yes - join the forces! If no, go to the next step.
6+
2. Create a new issue to propose a new node type to let everyone know that you are going ot work on it. Use `Feature request` template for that.
7+
3. [Fork this repository](https://help.github.com/articles/fork-a-repo/).
8+
4. Use one of the existing blueprints as a baseline. Choose the one that has architecture closest to the one you want to create.
9+
5. Once you are happy with how your blueprint works, follow our [CONTRIBUTION GUIDE](../CONTRIBUTING.md) to create a [pull request](https://help.github.com/articles/creating-a-pull-request/) for our team to review it.
10+
6. Once merged, let your community know that the new Node Runner Blueprint is ready for them to use!
11+
12+
### Recommended directory and file structure for a Node Runner Blueprint
13+
14+
- `lib/your-chain/doc/` - Documentation specific to the Node Runner Blueprint
15+
- `lib/your-chain/lib/` - Place for CDK stacks and other blueprint assets
16+
- `lib/your-chain/lib/assets/` - Place for everything that needs to be within the provisioned EC2 instance (user-data scripts, docker-compose files, etc.)
17+
- `lib/your-chain/lib/config/` - Your version of the config reader to parse values from `.env` file
18+
- `lib/your-chain/lib/constructs/` - All CDK constructs specific to this Node Runner Blueprint
19+
- `lib/your-chain/lib/*-stack.ts` - All [CDK stacks](https://docs.aws.amazon.com/cdk/v2/guide/stacks.html) for this Node Runner Blueprint
20+
- `lib/your-chain/sample-configs/` - Place for sample configurations to deploy Node Runner Blueprint to your environment
21+
- `lib/your-chain/test/` - Place for unit tests to verify the Node Runner Blueprint creates all necessary infrastructure
22+
- `lib/your-chain/.env-sample` - A sample configuration file
23+
- `lib/your-chain/app.ts` - Entry point to your AWS CDK application
24+
- `lib/your-chain/cdk.json` - Config file for [feature flags](https://docs.aws.amazon.com/cdk/v2/guide/featureflags.html) for your AWS CDK application
25+
- `lib/your-chain/jest.config.json` - [Configuration file for Jest](https://jestjs.io/docs/configuration)
26+
- `lib/your-chain/README.md` - All information and usage instructions for your Node Runner Blueprint
27+
28+
### Reusable imports and CDK constructs for stacks in Node Runner Blueprints
29+
30+
- `lib/constructs/config.interface.ts` - Interface classes to implement your own configuration module. Compatible with `ha-rpc-nodes-with-alb` and `single-node` constructs (see below).
31+
- `lib/constructs/constants.ts` - Useful constants to use in configuration files and to set up infrastructure.
32+
- `lib/constructs/ha-rpc-nodes-with-alb.ts` - Provisions up to 4 identical EC2 instances to run nodes managed by an Auto Scaling Group and behind an Application Load Balancer.
33+
- `lib/constructs/single-node.ts` - Creates a single EC2 instance to run a blockchain node.
34+
- `lib/constructs/snapshots-bucket.ts` - Creates an S3 bucket to store a copy of blockchain node state to speed up syncing process.

docs/pre-merge-tools.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Pre-merge tools
2+
3+
We need your help to achieve better code quality and make sure the blueprints stay secure. Before merging your new commit, please set up and run the following tools on your development machine.
4+
5+
1. [git-secrets](https://github.com/awslabs/git-secrets)
6+
7+
```bash
8+
# Install (Mac OS)
9+
npm run install-git-secrets-mac
10+
11+
# Install on other platforms: https://github.com/awslabs/git-secrets#installing-git-secrets
12+
13+
# Setup
14+
npm run setup-git-secrets
15+
16+
# Scan history
17+
npm run scan-history-git-secrets
18+
19+
# Scan repository
20+
npm run scan-repo-git-secrets
21+
```
22+
23+
2. [semgrep](https://github.com/semgrep/semgrep)
24+
25+
```bash
26+
# Install (Mac OS)
27+
npm run install-semgrep-mac
28+
29+
# Install on other platforms: https://github.com/semgrep/semgrep#option-2-getting-started-from-the-cli
30+
31+
# Scan
32+
npm run scan-semgrep
33+
```
34+
35+
3. [pre-commit](https://pre-commit.com)
36+
37+
```bash
38+
# Install (Mac OS)
39+
npm run install-pre-commit-mac
40+
41+
# Run
42+
npm run run-pre-commit
43+
```

docs/setup-cloud9.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ npm install -g aws-cdk
102102
cdk --version
103103
```
104104

105-
Install Session Manager plugin for AWS CLI <https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html>
105+
Install [Session Manager plugin for AWS CLI](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
106106

107107
```bash
108108
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/linux_64bit/session-manager-plugin.rpm" -o "session-manager-plugin.rpm"

0 commit comments

Comments
 (0)