Skip to content
Open
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
125 changes: 125 additions & 0 deletions examples/aizelvm/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Copyright (C) 2024, Ava Labs, Inc. All rights reserved.
# See the file LICENSE for licensing terms.

version: "2"
run:
timeout: 10m
linters:
default: none
enable:
- asciicheck
- bodyclose
- copyloopvar
- depguard
- errcheck
- errorlint
- goconst
- gocritic
- goprintffuncname
- gosec
- govet
- ineffassign
- misspell
- nakedret
- noctx
- nolintlint
- prealloc
- revive
- staticcheck
- unconvert
- unparam
- unused
- whitespace
settings:
depguard:
rules:
packages:
deny:
- pkg: github.com/stretchr/testify/assert
desc: github.com/stretchr/testify/require should be used instead.
- pkg: io/ioutil
desc: io/ioutil is deprecated. Use package io or os instead.
- pkg: github.com/ava-labs/hypersdk/internal
desc: internal packages should not be used in example VMs.
errorlint:
# Check for plain type assertions and type switches.
asserts: false
# Check for plain error comparisons.
comparison: false
gosec:
excludes:
- G107 # https://securego.io/docs/rules/g107.html
- G115 # TODO Enable this ruleset in a follow-up PR
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr
- name: bool-literal-in-expr
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return
- name: early-return
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines
- name: empty-lines
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag
- name: struct-tag
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-naming
- name: unexported-naming
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error
- name: unhandled-error
arguments:
- fmt.Fprint
- fmt.Fprintf
- fmt.Print
- fmt.Printf
- fmt.Println
- rand.Read
- sb.WriteString
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter
- name: unused-parameter
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver
- name: unused-receiver
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break
- name: useless-break
disabled: false
staticcheck:
# https://staticcheck.io/docs/options#checks
checks:
- all
- -SA1019 # deprecated packages e.g., golang.org/x/crypto/ripemd160
- -SA6002 # argument should be pointer-like to avoid allocation, for sync.Pool
- -QF1008 # omit embedded fields from selector expression
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- .*\.pb\.go$
- .*mock.*
- third_party$
- builtin$
- examples$
issues:
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
formatters:
enable:
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- .*\.pb\.go$
- .*mock.*
- third_party$
- builtin$
- examples$
75 changes: 75 additions & 0 deletions examples/aizelvm/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Copyright (C) 2023, Ava Labs, Inc. All rights reserved.
# See the file LICENSE for licensing terms.

# ref. https://goreleaser.com/customization/build/
builds:
- id: aizel-cli
main: ./cmd/aizel-cli
binary: aizel-cli
flags:
- -v
goos:
- linux
- darwin
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=1
- CGO_CFLAGS=-O -D__BLST_PORTABLE__ # Set the CGO flags to use the portable version of BLST
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc
- goos: darwin
goarch: arm64
env:
- CC=oa64-clang
- goos: darwin
goarch: amd64
goamd64: v1
env:
- CC=o64-clang
- id: aizelvm
main: ./cmd/aizelvm
binary: aizelvm
flags:
- -v
goos:
- linux
- darwin
goarch:
- amd64
- arm64
env:
- CGO_ENABLED=1
- CGO_CFLAGS=-O -D__BLST_PORTABLE__ # Set the CGO flags to use the portable version of BLST
overrides:
- goos: linux
goarch: arm64
env:
- CC=aarch64-linux-gnu-gcc
- goos: darwin
goarch: arm64
env:
- CC=oa64-clang
- goos: darwin
goarch: amd64
goamd64: v1
env:
- CC=o64-clang

checksum:
name_template: "aizelvm_checksums.txt"

archives:
- id: default
name_template: 'aizelvm_{{ .Version }}_{{ .Os }}_{{ .Arch }}'

release:
make_latest: false # Should be done manually
mode: 'keep-existing' # Should not override releases
github:
owner: ava-labs
name: hypersdk
66 changes: 66 additions & 0 deletions examples/aizelvm/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Copyright (C) 2023, Ava Labs, Inc. All rights reserved.

Ecosystem License
Version: 1.1

Subject to the terms herein, Ava Labs, Inc. (**"Ava Labs"**) hereby grants you
a limited, royalty-free, worldwide, non-sublicensable, non-transferable,
non-exclusive license to use, copy, modify, create derivative works based on,
and redistribute the Software, in source code, binary, or any other form,
including any modifications or derivative works of the Software (collectively,
**"Licensed Software"**), in each case subject to this Ecosystem License
(**"License"**).

This License applies to all copies, modifications, derivative works, and any
other form or usage of the Licensed Software. You will include and display
this License, without modification, with all uses of the Licensed Software,
regardless of form.

You will use the Licensed Software solely (i) in connection with the Avalanche
Public Blockchain platform, having a NetworkID of 1 (Mainnet) or 5 (Fuji), and
associated blockchains, comprised exclusively of the Avalanche X-Chain,
C-Chain, P-Chain and any subnets linked to the P-Chain ("Avalanche Authorized
Platform") or (ii) for non-production, testing or research purposes within the
Avalanche ecosystem, in each case, without any commercial application
("Non-Commercial Use"); provided that this License does not permit use of the
Licensed Software in connection with (a) any forks of the Avalanche Authorized
Platform or (b) in any manner not operationally connected to the Avalanche
Authorized Platform other than, for the avoidance of doubt, the limited
exception for Non-Commercial Use. Ava Labs may publicly announce changes or
additions to the Avalanche Authorized Platform, which may expand or modify
usage of the Licensed Software. Upon such announcement, the Avalanche
Authorized Platform will be deemed to be the then-current iteration of such
platform.

You hereby acknowledge and agree to the terms set forth at
www.avalabs.org/important-notice.

If you use the Licensed Software in violation of this License, this License
will automatically terminate and Ava Labs reserves all rights to seek any
remedy for such violation.

Except for uses explicitly permitted in this License, Ava Labs retains all
rights in the Licensed Software, including without limitation the ability to
modify it.

Except as required or explicitly permitted by this License, you will not use
any Ava Labs names, logos, or trademarks without Ava Labs’ prior written
consent.

You may use this License for software other than the "Licensed Software"
specified above, as long as the only change to this License is the definition
of the term "Licensed Software."

The Licensed Software may reference third party components. You acknowledge
and agree that these third party components may be governed by a separate
license or terms and that you will comply with them.

**TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE LICENSED SOFTWARE IS PROVIDED
ON AN "AS IS" BASIS, AND AVA LABS EXPRESSLY DISCLAIMS AND EXCLUDES ALL
REPRESENTATIONS, WARRANTIES AND OTHER TERMS AND CONDITIONS, WHETHER EXPRESS OR
IMPLIED, INCLUDING WITHOUT LIMITATION BY OPERATION OF LAW OR BY CUSTOM,
STATUTE OR OTHERWISE, AND INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTY,
TERM, OR CONDITION OF NON-INFRINGEMENT, MERCHANTABILITY, TITLE, OR FITNESS FOR
PARTICULAR PURPOSE. YOU USE THE LICENSED SOFTWARE AT YOUR OWN RISK. AVA LABS
EXPRESSLY DISCLAIMS ALL LIABILITY (INCLUDING FOR ALL DIRECT, CONSEQUENTIAL OR
OTHER DAMAGES OR LOSSES) RELATED TO ANY USE OF THE LICENSED SOFTWARE.**
Loading