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

Migration from the drand v1.5 codebase to its own repo #2

Merged
merged 28 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
af3d370
wip
AnomalRoil Aug 13, 2023
e4af1e9
some more wip
AnomalRoil Aug 31, 2023
bd1664d
adding go.mod
AnomalRoil Aug 31, 2023
e99b8a6
Compiling at last, in a MVP kind of way
AnomalRoil Sep 4, 2023
16caf31
Only tests to fix now
AnomalRoil Sep 6, 2023
5f7d7c4
deleting unused S3 relay
AnomalRoil Sep 6, 2023
c3de612
attempt at a NewMockHTTPPublicServer
AnomalRoil Oct 16, 2023
cfc7d23
HTTP relay works as a binary locally now... Tests are still funky
AnomalRoil Oct 25, 2023
8c60941
patching some more
AnomalRoil Oct 27, 2023
7c880dd
WIP
AnomalRoil Nov 30, 2023
711c911
Patching tests for real this time
AnomalRoil Dec 5, 2023
85f8982
typo
AnomalRoil Dec 5, 2023
3859653
Using the fixmock branch for drand for now
AnomalRoil Dec 5, 2023
4d03d2c
porting https://github.com/drand/drand/pull/1293
AnomalRoil Jan 8, 2024
8249669
quick updates
AnomalRoil May 21, 2024
7c4dd7c
Applying code review comments
AnomalRoil May 21, 2024
a6e2125
updating to drand/v2
AnomalRoil May 24, 2024
fc0dd2a
adding GHA
AnomalRoil Jun 20, 2024
9984cb6
updating to drand v2.0.1
AnomalRoil Jul 4, 2024
d957ac2
fix client
AnomalRoil Jul 5, 2024
95998f3
train work
AnomalRoil Jul 12, 2024
a7ef367
some progress
AnomalRoil Jul 15, 2024
a4b0ead
Baby steps on client code
AnomalRoil Jul 22, 2024
bef8466
removing hardcoded non-executed example code from doc
AnomalRoil Jul 23, 2024
790f78b
Fixing all the last tests issues
AnomalRoil Jul 23, 2024
dd8a929
updating deps
AnomalRoil Jul 23, 2024
30890a0
Getting rid of datastore backed peerstore
AnomalRoil Jul 23, 2024
8e4c811
fixing flag issue in gossip relays
AnomalRoil Jul 24, 2024
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
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint

on:
pull_request:
branches: [ main ]

concurrency:
group: ci-${{ github.ref }}-lint
cancel-in-progress: true

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Checkout
uses: actions/checkout@v4

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.58
args: --timeout 5m
30 changes: 30 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: "Build/Tests"
on:
push:
branches:
- master
- main
pull_request:

concurrency:
group: ci-${{ github.ref }}-tests
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
continue-on-error: true
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Unit tests
env:
DRAND_TEST_LOGS: "${{ runner.debug == '1' && 'DEBUG' || 'INFO' }}"
CI: "true"
run: go test -v ./...
198 changes: 198 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
issues:
# Let us display all issues of one type at once
max-same-issues: 0
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- bodyclose
- cyclop
- errcheck
- forbidigo
- goconst
- gocyclo
- mnd
- gosec
- nilnil
- noctx
- revive
- depguard
- lll # signatures are long lines
- path: _test\.go
text: "SA1019" # we still want to test deprecated functions
- path: cmd
linters:
- forbidigo # we use Println in our UX
- path: internal/lib
linters:
- forbidigo # we use Println in our UX
- path: internal/drand-cli
linters:
- forbidigo # we use Println in our UX
- goconst # we re-use some strings in our flags
- path: client/http
text: "unexported-return"
run:
skip-dirs:
- demo
- test

linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
#- containedctx #TODO could be enabled
#- contextcheck #TODO could be enabled
#- cyclop
#- deadcode # Deprecated
- decorder
# - depguard
- dogsled
- dupl
- dupword
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
# - execinquery # deprecated
- exhaustive
# - exhaustivestruct
# - exhaustruct
- exportloopref
# - forbidigo
# - forcetypeassert #TODO could be enabled
- funlen
# - gci
# - gochecknoglobals
- gochecknoinits
# - gocognit
- goconst
- gocritic
- gocyclo
# - godot
# - godox #TODO could be enabled
# - goerr113
- gofmt
# - gofumpt
- goheader
- goimports
# - golint # Deprecated
# - gomnd # deprecated, replaced by mnd
# - gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- grouper
# - ifshort
- importas
- ineffassign
- interfacebloat
# - interfacer # Deprecated
# - ireturn
- lll
- loggercheck
- maintidx
- makezero
# - maligned #Deprecated
#- mnd
- misspell
- nakedret
# - nestif
- nilerr
- nilnil
# - nlreturn
- noctx
- nolintlint
# - nonamedreturns
# - nosnakecase
- nosprintfhostport
# - paralleltest #TODO could be enabled
- prealloc
- predeclared
# - promlinter #TODO could be enabled
- reassign
- revive
- rowserrcheck
# - scopelint # Deprecated
- sqlclosecheck
- staticcheck
# - structcheck # Deprecated
- stylecheck
# - tagliatelle
- tenv
- testableexamples
# - testpackage
# - thelper #TODO could be enabled
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
# - varcheck # Deprecated
# - varnamelen
- wastedassign
- whitespace
# - wrapcheck
# - wsl

linters-settings:
dupl:
threshold: 100
exhaustive:
default-signifies-exhaustive: false
funlen:
lines: 100
statements: 50
goconst:
min-len: 3
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- dupImport # https://github.com/go-critic/go-critic/issues/845
- ifElseChain
- octalLiteral
- whyNoLint
- wrapperFunc
gocyclo:
min-complexity: 15
goimports:
local-prefixes: github.com/drand
golint:
min-confidence: 0
mnd:
# don't include the "operation" and "assign"
checks:
- argument
- case
- condition
- return
lll:
line-length: 140
# maligned: # Deprecated
# suggest-new: true
# govet:
# check-shadowing: true #TODO could be enabled
# enable:
# - fieldalignment #TODO could be enabled
revive:
enable:
- var-naming
misspell:
locale: US
nolintlint:
allow-leading-space: true # don't require machine-readable nolint directives (i.e. with no leading space)
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
drand-relay-gossip:
go build -o drand-relay-gossip ./gossip-relay/main.go
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## New Project
## drand-cli is a set of useful binaries for the drand ecosystem

This repo contains most notably:
- a client CLI tool to fetch and verify drand beacons from the various available sources
- a gossipsub relay to relay drand beacons on gossipsub
- Go APIs to connect to drand networks through http or gossipsub relays.



---
Expand Down
Loading
Loading