Skip to content

Commit

Permalink
Release: Yggdrasil 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
neilalexander committed Oct 28, 2023
2 parents 14f1cd4 + 01c1498 commit b332664
Show file tree
Hide file tree
Showing 70 changed files with 2,825 additions and 1,925 deletions.
36 changes: 31 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
strategy:
fail-fast: false
matrix:
goversion: ["1.17", "1.18", "1.19"]
goversion: ["1.20", "1.21"]

name: Build & Test (Linux, Go ${{ matrix.goversion }})
needs: [lint]
Expand All @@ -75,7 +75,7 @@ jobs:
strategy:
fail-fast: false
matrix:
goversion: ["1.17", "1.18", "1.19"]
goversion: ["1.20", "1.21"]

name: Build & Test (Windows, Go ${{ matrix.goversion }})
needs: [lint]
Expand All @@ -99,7 +99,7 @@ jobs:
strategy:
fail-fast: false
matrix:
goversion: ["1.17", "1.18", "1.19"]
goversion: ["1.20", "1.21"]

name: Build & Test (macOS, Go ${{ matrix.goversion }})
needs: [lint]
Expand All @@ -119,6 +119,32 @@ jobs:
- name: Unit tests
run: go test -v ./...

build-freebsd:
strategy:
fail-fast: false
matrix:
goversion: ["1.20", "1.21"]
goos:
- freebsd
- openbsd

name: Build (Cross ${{ matrix.goos }}, Go ${{ matrix.goversion }})
needs: [lint]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.goversion }}

- name: Build Yggdrasil
run: go build -v ./...
env:
GOOS: ${{ matrix.goos }}

tests-ok:
name: All tests passed
needs: [lint, codeql, build-linux, build-windows, build-macos]
Expand All @@ -128,4 +154,4 @@ jobs:
- name: Check all tests passed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
jobs: ${{ toJSON(needs) }}
12 changes: 6 additions & 6 deletions .github/workflows/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

name: Package (Debian, ${{ matrix.pkgarch }})

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"

- name: Build package
env:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"

- name: Build package
env:
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"

- name: Build package
run: sh contrib/msi/build-msi.sh ${{ matrix.pkgarch }}
Expand All @@ -107,7 +107,7 @@ jobs:

name: Package (Router, ${{ matrix.pkgarch }})

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -122,7 +122,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"

- name: Build package
env:
Expand Down
753 changes: 393 additions & 360 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PKGSRC=${PKGSRC:-github.com/yggdrasil-network/yggdrasil-go/src/version}
PKGNAME=${PKGNAME:-$(sh contrib/semver/name.sh)}
PKGVER=${PKGVER:-$(sh contrib/semver/version.sh --bare)}

LDFLAGS="-X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER"
LDFLAGS="${LDFLAGS} -X $PKGSRC.buildName=$PKGNAME -X $PKGSRC.buildVersion=$PKGVER"
ARGS="-v"

while getopts "utc:l:dro:p" option
Expand Down
7 changes: 4 additions & 3 deletions cmd/genkeys/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
This file generates crypto keys.
It prints out a new set of keys each time if finds a "better" one.
By default, "better" means a higher NodeID (-> higher IP address).
Expand All @@ -8,7 +7,6 @@ This is because the IP address format can compress leading 1s in the address, to
If run with the "-sig" flag, it generates signing keys instead.
A "better" signing key means one with a higher TreeID.
This only matters if it's high enough to make you the root of the tree.
*/
package main

Expand All @@ -18,6 +16,7 @@ import (
"fmt"
"net"
"runtime"
"time"

"github.com/yggdrasil-network/yggdrasil-go/src/address"
)
Expand All @@ -29,6 +28,8 @@ type keySet struct {

func main() {
threads := runtime.GOMAXPROCS(0)
fmt.Println("Threads:", threads)
start := time.Now()
var currentBest ed25519.PublicKey
newKeys := make(chan keySet, threads)
for i := 0; i < threads; i++ {
Expand All @@ -38,7 +39,7 @@ func main() {
newKey := <-newKeys
if isBetter(currentBest, newKey.pub) || len(currentBest) == 0 {
currentBest = newKey.pub
fmt.Println("-----")
fmt.Println("-----", time.Since(start))
fmt.Println("Priv:", hex.EncodeToString(newKey.priv))
fmt.Println("Pub:", hex.EncodeToString(newKey.pub))
addr := address.AddrForKey(newKey.pub)
Expand Down
Loading

0 comments on commit b332664

Please sign in to comment.