Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemadero authored Aug 31, 2023
0 parents commit a03fdac
Show file tree
Hide file tree
Showing 41 changed files with 31,012 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use a base image that includes both Go and Node.js, such as the official Go image
FROM golang:latest


ENV GOPATH=/go
ENV PATH=$PATH:$GOPATH/bin
ENV AVALANCHEGO_EXEC_PATH=$GOPATH/src/github.com/ava-labs/avalanchego/build/avalanchego
ENV AVALANCHEGO_PLUGIN_PATH=$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins

# Install Node.js and npm using the official Node.js image
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs

# Clone the avalanchego repository
RUN git clone -b v1.10.5 https://github.com/ava-labs/avalanchego.git $GOPATH/src/github.com/ava-labs/avalanchego

# Set the working directory to the cloned repository
WORKDIR $GOPATH/src/github.com/ava-labs/avalanchego

# Build the avalanchego project using the sh script
RUN ./scripts/build.sh

RUN curl -sSfL https://raw.githubusercontent.com/ava-labs/avalanche-network-runner/main/scripts/install.sh | sh -s

ENV PATH ~/bin:$PATH
52 changes: 52 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Avalanche-DevContainer",

"build": {
"dockerfile": "Dockerfile"
},
"runArgs": ["--network=host"],

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8080,
8081,
9650,
9652,
9654,
9656,
9658
],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash scripts/build.sh",

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"

"workspaceMount": "source=${localWorkspaceFolder},target=/go/src/github.com/ava-labs/precompile-evm,type=bind",
"workspaceFolder": "/go/src/github.com/ava-labs/precompile-evm",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {
"solidity.telemetry": false,
"git.autofetch": true
},
"extensions": [
"golang.go",
"nomicfoundation.hardhat-solidity",
"rangav.vscode-thunder-client"
]
}
}
}
42 changes: 42 additions & 0 deletions .devcontainer/genesis-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"config": {
"chainId": 99999,
"homesteadBlock": 0,
"eip150Block": 0,
"eip150Hash": "0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0",
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"muirGlacierBlock": 0,
"subnetEVMTimestamp": 0,
"feeConfig": {
"gasLimit": 15000000,
"minBaseFee": 25000000000,
"targetGas": 15000000,
"baseFeeChangeDenominator": 36,
"minBlockGasCost": 0,
"maxBlockGasCost": 1000000,
"targetBlockRate": 2,
"blockGasCostStep": 200000
},
"allowFeeRecipients": false
},
"alloc": {
"8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC": {
"balance": "0x295BE96E64066972000000"
}
},
"nonce": "0x0",
"timestamp": "0x0",
"extraData": "0x00",
"gasLimit": "0xe4e1c0",
"difficulty": "0x0",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Release Checklist
about: Create a ticket to track a release
title: ""
labels: release
assignees: ""
---

**Release**
The release version and a description of the planned changes to be included in the release.

**Issues**
Link the major issues planned to be included in the release.

**Documentation**
Link the relevant documentation PRs for this release.

**Checklist**

- [ ] Update version in scripts/versions.sh and plugin/main.go
- [ ] Bump AvalancheGo dependency for RPCChainVM Compatibility
- [ ] Add new entry in compatibility.json for RPCChainVM Compatibility
- [ ] Update AvalancheGo compatibility in README
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
80 changes: 80 additions & 0 deletions .github/workflows/lint-tests-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build + test + release

on:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:

jobs:
lint_test:
name: Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '~1.19.12'
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51
working-directory: .
args: --timeout 10m

unit_test:
name: Golang Unit Tests
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '~1.19.12'
check-latest: true
- run: go mod download
shell: bash
- run: ./scripts/build.sh ./build/precompile-evm
shell: bash
- run: ./scripts/build_test.sh -race
shell: bash
- run: ./scripts/coverage.sh
shell: bash

e2e_test:
name: e2e tests
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '~1.19.12'
check-latest: true
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: NPM Clean Install
run: npm ci
working-directory: ./contracts
- name: Hardhat Clean
run: npx hardhat clean
working-directory: ./contracts
- name: Hardhat Compile
run: npx hardhat compile
working-directory: ./contracts
- name: Install AvalancheGo Release
shell: bash
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
- name: Build Subnet-EVM Plugin Binary
shell: bash
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
- name: Run E2E Tests
shell: bash
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
*.log
*~
.DS_Store

awscpu

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
*.profile

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# ignore GoLand metafiles directory
.idea/

*logs/

.vscode*

*.pb*

*cpu[0-9]*
*mem[0-9]*
*lock[0-9]*
*.profile
*.swp
*.aux
*.fdb*
*.fls
*.gz
*.pdf

.coverage

bin/
build/

# goreleaser
dist/
Loading

0 comments on commit a03fdac

Please sign in to comment.