Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:update validator list + cloudinary deployment #25

Merged
merged 6 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/validator-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Validator Request
about: Request a validator addition
title: "Add {VALIDATOR_NAME}"
labels: validator request
assignees: ""
---

- [ ] I understand that filing an issue does not guarantee addition to the Berachain default validator list.
- [ ] I will not ping the Discord about this listing request.

**Please provide the following information for your validator.**

Validator ID:
Validator Name:
Validator Logo URI:
Link to website:
35 changes: 35 additions & 0 deletions .github/workflows/cloudinary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy to Cloudinary

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

# Install Cloudinary CLI
- name: Install Cloudinary CLI
run: |
npm install -g cloudinary-cli

# Configure Cloudinary Environment Variables
- name: Configure Cloudinary Environment
run: |
echo "CLOUDINARY_URL=cloudinary://$CLOUDINARY_API_KEY:$CLOUDINARY_API_SECRET@$CLOUDINARY_CLOUD_NAME" > $GITHUB_ENV
env:
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}

# Upload to Cloudinary
- name: Upload to Cloudinary
run: |
set -e # Ensure the script fails on error
cld upload_folder ${GITHUB_WORKSPACE}/src/ --recursive true
echo "Upload to Cloudinary completed successfully."
31 changes: 31 additions & 0 deletions test/berachain-default-validators.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const packageJson = require("../package.json");
const { expect } = require("chai");
const fetch = require("node-fetch");
const defaultValidatorList = require("../src/validators/testnet/defaultValidatorList.json");

before(async function () {
this.timeout(120000);
});

describe("validator list test suite", () => {
it("contains no duplicate index", () => {
const map = {};
for (let validator of defaultValidatorList.validators) {
let index = validator.id.toString();
const key = `${validator.name}-${index}`;
expect(typeof map[key]).to.equal(
"undefined",
`duplicate symbol: ${index}`
);
map[key] = true;
}
});

it("all logo links are valid", async () => {
await defaultValidatorList.validators.map((validator) =>
fetch(validator.logoURI).then((response) => {
expect(response.status).to.equal(200);
})
);
}, 30000);
});
Loading