-
Notifications
You must be signed in to change notification settings - Fork 574
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3711 from iron-fish/staging
STAGING -> MASTER
- Loading branch information
Showing
43 changed files
with
1,656 additions
and
418 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: Deploy Node Docker Image | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
github_tag_mainnet: | ||
description: 'GitHub:mainnet' | ||
type: boolean | ||
default: false | ||
github_tag_testnet: | ||
description: 'GitHub:testnet' | ||
type: boolean | ||
default: false | ||
aws_tag_mainnet: | ||
description: 'AWS:mainnet' | ||
type: boolean | ||
default: false | ||
aws_tag_testnet: | ||
description: 'AWS:testnet' | ||
type: boolean | ||
default: false | ||
aws_tag_git_sha: | ||
description: 'AWS:{GIT_SHA}' | ||
type: boolean | ||
default: false | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
Deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Login to GitHub Registry | ||
run: echo ${GITHUB_TOKEN} | docker login -u ${GITHUB_USER} --password-stdin ghcr.io | ||
env: | ||
GITHUB_USER: ${{ secrets.BREW_GITHUB_USERNAME }} | ||
GITHUB_TOKEN: ${{ secrets.BREW_GITHUB_TOKEN }} | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Login to AWS Registry | ||
run: aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $AWS_REGISTRY_URL | ||
env: | ||
AWS_REGISTRY_URL: ${{ secrets.AWS_NODE_REGISTRY_URL }} | ||
|
||
- name: Build Node Image | ||
run: ./ironfish-cli/scripts/build-docker.sh | ||
|
||
- name: Deploy Node Image to GitHub:mainnet | ||
if: ${{ inputs.github_tag_mainnet }} | ||
run: | | ||
docker tag ironfish ghcr.io/iron-fish/ironfish:mainnet | ||
docker push ghcr.io/iron-fish/ironfish:mainnet | ||
# If we are deploying a new public release to mainnet | ||
# also update the docker registry :latest tag for hygiene | ||
- name: Deploy Node Image to GitHub:latest | ||
if: ${{ inputs.github_tag_mainnet }} | ||
run: | | ||
docker tag ironfish ghcr.io/iron-fish/ironfish:latest | ||
docker push ghcr.io/iron-fish/ironfish:latest | ||
# Used if we are deploying a new version (e.g. v1.1) | ||
# This is only executed when deploying a new release to mainnet | ||
- name: Deploy Node Image to GitHub:${{ github.ref_name }} | ||
if: ${{ inputs.github_tag_mainnet && github.event.ref_type == 'tag'}} | ||
run: | | ||
docker tag ironfish ghcr.io/iron-fish/ironfish:${{ github.ref_name }} | ||
docker push ghcr.io/iron-fish/ironfish:${{ github.ref_name }} | ||
- name: Deploy Node Image to GitHub:testnet | ||
if: ${{ inputs.github_tag_testnet }} | ||
run: | | ||
docker tag ironfish ghcr.io/iron-fish/ironfish:testnet | ||
docker push ghcr.io/iron-fish/ironfish:testnet | ||
- name: Deploy Node Image to AWS:mainnet | ||
if: ${{ inputs.aws_tag_mainnet }} | ||
run: | | ||
docker tag ironfish ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:mainnet | ||
docker push ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:mainnet | ||
# If we are deploying a new public release to mainnet | ||
# also update the docker registry :latest tag for hygiene | ||
- name: Deploy Node Image to AWS:latest | ||
if: ${{ inputs.aws_tag_mainnet }} | ||
run: | | ||
docker tag ironfish ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:latest | ||
docker push ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:latest | ||
# Used if we are deploying a new version (e.g. v1.1) | ||
# This is only executed when deploying a new release to mainnet | ||
- name: Deploy Node Image to AWS:${{ github.ref_name }} | ||
if: ${{ inputs.aws_tag_mainnet && github.event.ref_type == 'tag'}} | ||
run: | | ||
docker tag ironfish ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:${{ github.ref_name }} | ||
docker push ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:${{ github.ref_name }} | ||
- name: Deploy Node Image to AWS:testnet | ||
if: ${{ inputs.aws_tag_testnet }} | ||
run: | | ||
docker tag ironfish ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:testnet | ||
docker push ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:testnet | ||
- name: Deploy Node Image to AWS:${{ github.sha }} | ||
if: ${{ inputs.aws_tag_git_sha }} | ||
run: | | ||
docker tag ironfish ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:${{ github.sha }} | ||
docker push ${{ secrets.AWS_NODE_REGISTRY_URL }}/ironfish:${{ github.sha }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ironfish", | ||
"version": "0.1.73", | ||
"version": "0.1.74", | ||
"description": "CLI for running and interacting with an Iron Fish node", | ||
"author": "Iron Fish <[email protected]> (https://ironfish.network)", | ||
"main": "build/src/index.js", | ||
|
@@ -60,7 +60,7 @@ | |
"@aws-sdk/client-secrets-manager": "3.276.0", | ||
"@aws-sdk/s3-request-presigner": "3.127.0", | ||
"@ironfish/rust-nodejs": "0.1.29", | ||
"@ironfish/sdk": "0.0.50", | ||
"@ironfish/sdk": "0.0.51", | ||
"@oclif/core": "1.23.1", | ||
"@oclif/plugin-help": "5.1.12", | ||
"@oclif/plugin-not-found": "2.3.1", | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
import { S3Client } from '@aws-sdk/client-s3' | ||
import { Flags } from '@oclif/core' | ||
import { IronfishCommand } from '../../command' | ||
import { S3Utils } from '../../utils' | ||
|
||
export default class CeremonyContributions extends IronfishCommand { | ||
static description = 'List all the current contributions with names' | ||
|
||
static flags = { | ||
start: Flags.integer({ | ||
required: false, | ||
}), | ||
end: Flags.integer({ | ||
required: false, | ||
}), | ||
} | ||
|
||
async start(): Promise<void> { | ||
const { flags } = await this.parse(CeremonyContributions) | ||
|
||
const r2Credentials = await S3Utils.getR2Credentials() | ||
|
||
if (r2Credentials === undefined) { | ||
this.logger.log('Failed getting R2 credentials from AWS') | ||
this.exit(0) | ||
return | ||
} | ||
|
||
const r2Client = S3Utils.getR2S3Client(r2Credentials) | ||
|
||
const latestParamName = await this.getLatestParamName(r2Client, 'ironfish-contributions') | ||
const latestParamNumber = parseInt(latestParamName.split('_')[1]) | ||
const keys: string[] = [...new Array<number>(latestParamNumber + 1)] | ||
.map((_, i) => i) | ||
.filter((i) => (!flags.start || i >= flags.start) && (!flags.end || i <= flags.end)) | ||
.map((i) => { | ||
return 'params_' + i.toString().padStart(5, '0') | ||
}) | ||
|
||
for (const key of keys) { | ||
const { Metadata } = await S3Utils.getObjectMetadata( | ||
r2Client, | ||
'ironfish-contributions', | ||
key, | ||
) | ||
this.log( | ||
`Contribution: ${key.split('_')[1]}, Name: ${Metadata?.contributorName || '-'}, IP: ${ | ||
Metadata?.remoteaddress || '-' | ||
}`, | ||
) | ||
} | ||
} | ||
|
||
async getLatestParamName(client: S3Client, bucket: string): Promise<string> { | ||
const paramFileNames = await S3Utils.getBucketObjects(client, bucket) | ||
const validParams = paramFileNames | ||
.slice(0) | ||
.filter((fileName) => /^params_\d{5}$/.test(fileName)) | ||
validParams.sort() | ||
return validParams[validParams.length - 1] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.