Skip to content

Commit

Permalink
Merge branch 'master' into api-doc-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Jan 22, 2024
2 parents 39a5cd4 + 39ecf84 commit a0f7ebb
Show file tree
Hide file tree
Showing 44 changed files with 2,097 additions and 127 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @vechain/core-protocol-reviewers
64 changes: 64 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Contributing to VechainThor

Welcome to VechainThor! We appreciate your interest in contributing. By participating in this project, you agree to
abide by our [Code of Conduct](https://github.com/vechain/thor/blob/master/CODE_OF_CONDUCT.md).

## VeChain Improvement Proposals (VIPs)

[Vechain Improvement Proposals (VIPs)](https://github.com/vechain/VIPs) documents protocol improvements to the
VechainThor blockchain. A successful VIP represents a consensus among the Vechain community and developers, and is a
standard for VechainThor implementations. The framework is designed to establish a systematic and organized approach for
introducing new features into the VechainThor protocol. We encourage community members and developers to actively
participate in shaping the future of Vechain by proposing and discussing innovative ideas.

### Before You Propose

Before submitting a new VIP, it's crucial to ensure that your idea hasn't already been proposed or implemented. Please
take the time to check the existing proposals on our GitHub repository to avoid duplication and to better understand the
current development landscape.

## How to Contribute

1. Fork the repository to your GitHub account.
2. Clone the forked repository to your local machine:
```bash
git clone https://github.com/[your-username]/thor.git
```
**Note:** Replace `[your-username]` with your actual GitHub username.
3. Create a new branch for your changes:
```bash
git checkout -b feature/your-feature-name
```
4. For a smooth review process, please ensure your branch is up-to-date with the `master` branch of the `vechain/thor`
repository, and run the tests before committing your changes:
```bash
make test
```
- **Note:**: Please refer to the [README](https://github.com/vechain/thor/blob/master/README.md) for information on how to start the node and interact with the
API.
5. Make your changes and commit them with a clear and concise commit message.
6. Push your changes to your forked repository:
```bash
git push origin feature/your-feature-name
```
7. Create a pull request to the `master` branch of the `vechain/thor` repository.
8. Ensure your PR description clearly explains your changes and the problem it solves.
- Explain the major changes you are submitting for review. Often it is useful to open a second tab in your browser
where you can look through the diff yourself to remind yourself of all the changes you have made.
9. Wait for feedback and be ready to address any requested changes.

## Code Style and Guidelines

### Code Style

- We use [gofmt](https://golang.org/cmd/gofmt/) to format our code. Please run `gofmt .` before committing your changes.

### Code Guidelines

- We follow the [Effective Go](https://golang.org/doc/effective_go) guidelines. Please make sure your code is idiomatic
and follows the guidelines.

### Code Linting

- We employ `golangci-lint` for code linting in our development process. It ensures that code adheres to established standards, and any changes that do not pass the linting checks will trigger an error during the Continuous Integration (CI) process.
- You can run it locally by installing the `golangci-lint` binary and running `make lint` in the root directory of the repository.
24 changes: 0 additions & 24 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "🐛 Bug Report"
description: Create a new ticket for a bug.
title: "🐛 [BUG] - <title>"
labels: [
"bug"
]
body:
- type: textarea
id: description
attributes:
label: "Description"
description: Please enter an explicit description of your issue
placeholder: Short and explicit description of your incident...
validations:
required: true
- type: input
id: reprod-url
attributes:
label: "Reproduction URL"
description: Please enter your GitHub URL to provide a reproduction of the issue
placeholder: ex. https://github.com/USERNAME/REPO-NAME
validations:
required: true
- type: textarea
id: reprod
attributes:
label: "Reproduction steps"
description: Please enter an explicit description of your issue
value: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
render: bash
validations:
required: true
- type: textarea
id: screenshot
attributes:
label: "Screenshots"
description: If applicable, add screenshots to help explain your problem.
value: |
![DESCRIPTION](LINK.png)
render: bash
validations:
required: false
- type: textarea
id: logs
attributes:
label: "Logs"
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: bash
validations:
required: false
- type: dropdown
id: os
attributes:
label: "OS"
description: What is the impacted environment ?
multiple: true
options:
- Windows
- Linux
- Mac
validations:
required: false
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: VeChain Improvement Proposals (VIPs)
url: https://github.com/vechain/VIPs
about: Use this repository to view existing proposals and feature requests or to submit your own.
- name: Discord
url: https://discord.gg/vechain
about: Join our Discord community to connect with other VeChain enthusiasts, ask questions, and find answers.
- name: Telegram
url: https://t.me/VeChainDevCommunity
about: Join our Telegram community to connect with other VeChain developers, ask questions, and find answers.
39 changes: 39 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [x] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [x] Test A
- [x] Test B

**Test Configuration**:
* Go Version:
* Hardware:
* Docker Version:

# Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] New and existing E2E tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules
- [x] I have not added any vulnerable dependencies to my code
24 changes: 24 additions & 0 deletions .github/workflows/close-stale-issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Close stale issues and PRs'

on:
schedule:
- cron: '30 1 * * *'

jobs:
stale:
runs-on: ubuntu-latest

permissions:
contents: write
issues: write
pull-requests: write

steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue has been marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.'
stale-pr-message: 'This pull request has been marked as stale due to inactivity. It will be closed if no further activity occurs. Thank you for your contributions.'
days-before-issue-stale: 90
days-before-pr-stale: 60
days-before-close: 7
stale-issue-label: 'stale'
31 changes: 31 additions & 0 deletions .github/workflows/lint-go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint

on:
push:
branches:
- master
pull_request:

permissions:
contents: read

jobs:
golangci:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
# use the default if on main branch, otherwise use the pull request config
args: --timeout=30m --config=${{ github.event_name == 'pull_request' && '.golangci.pull-request.yml' || '.golangci.yml' }}
only-new-issues: true
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true
20 changes: 20 additions & 0 deletions .github/workflows/qodana-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Qodana Scan

on:
push:
branches:
- master

jobs:
scan_qodana:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Qodana Scan
uses: JetBrains/[email protected]
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
with:
pr-mode: false
File renamed without changes.
31 changes: 31 additions & 0 deletions .github/workflows/test-docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Docker

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
docker_build:
runs-on: ubuntu-latest
name: Test Build

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: false
provenance: false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ package.json

.fake_gopath_suffix
coverage.out

.idea
20 changes: 20 additions & 0 deletions .golangci.pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Please refer to the official golangci-lint config documentation for more details:
# https://golangci-lint.run/usage/configuration/
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml

linters:
enable-all: true

run:
timeout: 10m
tests: false

issues:
max-issues-per-linter: 1000
exclude-rules:
- path: vm/contracts.go
text: 'SA1019: "golang.org/x/crypto/ripemd160" is deprecated: RIPEMD-160 is a legacy hash and should not be used for new applications.'
- path: vm/bn256/cloudflare/optate.go
linters:
- deadcode
- staticcheck
22 changes: 22 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Please refer to the official golangci-lint config documentation for more details:
# https://golangci-lint.run/usage/configuration/
# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml

linters:
disable:
- unused
- errcheck

run:
timeout: 10m
tests: false

issues:
max-issues-per-linter: 1000
exclude-rules:
- path: vm/contracts.go
text: 'SA1019: "golang.org/x/crypto/ripemd160" is deprecated: RIPEMD-160 is a legacy hash and should not be used for new applications.'
- path: vm/bn256/cloudflare/optate.go
linters:
- deadcode
- staticcheck
Loading

0 comments on commit a0f7ebb

Please sign in to comment.