Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
Merge branch 'develop' of github.com:iotaledger/iota-core into feat/m…
Browse files Browse the repository at this point in the history
…etastability-breaker
  • Loading branch information
hmoog committed Jan 18, 2024
2 parents d7ef640 + 5951157 commit dd6a662
Show file tree
Hide file tree
Showing 56 changed files with 638 additions and 343 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ on:
pull_request:
paths:
- "Dockerfile"
push:
branches:
- develop

jobs:
build:
name: Build Docker
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build Docker image
run: DOCKER_BUILDKIT=1 docker build . --file Dockerfile --tag iota-core:latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ on:
pull_request:
paths:
- 'tools/genesis-snapshot/**'
jobs:

jobs:
build:
name: Import Check
runs-on: self-hosted
steps:

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: develop

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/docker-network-health.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Docker Network and Check Health
name: Docker Network Health Check

on:
workflow_dispatch:
Expand All @@ -9,6 +9,9 @@ on:
- '!scripts/**'
- '!tools/**'
- 'tools/genesis-snapshot/**'
push:
branches:
- develop

concurrency:
group: run-and-check-group
Expand All @@ -20,7 +23,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run network, wait and check health
run: |
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/docker-network-tests-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Docker Network Tests

on:
schedule:
- cron: '0 1 * * *' # Runs every day at 1 AM
workflow_dispatch:
inputs:
testCases:
description: 'Custom test cases to run:'
required: false
default: ""

jobs:
test:
runs-on: self-hosted

steps:
- name: Check out code
uses: actions/checkout@v4

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

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: false

- name: Run all tests
run: |
cd tools/docker-network/tests &&
./run_tests.sh ${{ github.event.inputs.testCases }}
24 changes: 5 additions & 19 deletions .github/workflows/feature-network-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ on:
branches:
- develop
workflow_dispatch:
inputs:
snapshotUrl:
description: 'Custom snapshot URL:'
required: false
default: ""

concurrency:
group: feature-network-deploy-group
Expand All @@ -22,10 +17,10 @@ jobs:
DOCKER_BUILDKIT: 1
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Cache Docker layers
uses: actions/cache@v3
Expand All @@ -36,21 +31,21 @@ jobs:
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: '${{ secrets.IOTALEDGER_DOCKER_USERNAME }}'
password: '${{ secrets.IOTALEDGER_DOCKER_PASSWORD }}'

- name: Publish to Docker Hub
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
tags: iotaledger/iota-core:feature
push: true
build-args: |
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'tools/genesis-snapshot/go.mod'
cache: false
Expand All @@ -62,13 +57,6 @@ jobs:
working-directory: tools/genesis-snapshot
run: go run -tags=rocksdb . --config feature --seed 7R1itJx5hVuo9w9hjg5cwKFmek4HMSoBDgJZN8hKGxih --filename genesis-snapshot.bin

- name: Upload snapshot
id: upload-snapshot
run: |
SNAPSHOT_URL=$(curl -T ./tools/genesis-snapshot/genesis-snapshot.bin https://transfer.sh)
echo "Snapshot URL: $SNAPSHOT_URL"
echo "snapshot_url=$SNAPSHOT_URL" >> $GITHUB_OUTPUT
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
Expand All @@ -92,8 +80,6 @@ jobs:
- name: Ansible deploy
env:
CUSTOM_SNAPSHOT_URL: '${{ github.event.inputs.snapshotUrl }}'
DEFAULT_SNAPSHOT_URL: '${{ steps.upload-snapshot.outputs.snapshot_url }}'
NETWORK_ENVIRONMENT: '${{ secrets.NETWORK_ENVIRONMENT }}'
IOTA_CORE_DOCKER_IMAGE_REPO: 'iotaledger/iota-core'
IOTA_CORE_DOCKER_IMAGE_TAG: 'feature'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gendoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: 'tools/gendoc/go.mod'
cache: false
Expand All @@ -26,7 +26,7 @@ jobs:
run: go mod tidy && go run main.go

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "chore(gendoc): update docs"
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@ on:
- 'documentation/**'
- 'scripts/**'
- 'tools/**'

jobs:
golangci-lint:
name: GolangCI-Lint
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Checkout custom linter
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: karimodm/typegroupingcheck
path: typegroupingcheck

- name: Setup go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version-file: './typegroupingcheck/go.mod'

Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ on:
pull_request:
paths-ignore:
- 'documentation/**'
push:
branches:
- develop

jobs:
unit-tests:
name: Unit tests
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: false
Expand All @@ -24,15 +27,14 @@ jobs:
- name: Run Tests
run: go test ./... -tags rocksdb -count=1 -timeout 20m


unit-tests-race:
name: Unit tests -race
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: false
Expand Down
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# IOTA-Core - The IOTA 2.0 node

IOTA-Core is the node software for the upcoming IOTA 2.0 protocol.

---
![GitHub Release (latest by date)](https://img.shields.io/github/v/release/iotaledger/iota-core)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/iotaledger/iota-core?branch=develop)
![GitHub License](https://img.shields.io/github/license/iotaledger/iota-core?branch=develop)
---
[![unit-test](https://github.com/iotaledger/iota-core/actions/workflows/unit-test.yml/badge.svg?branch=develop)](https://github.com/iotaledger/iota-core/actions/workflows/unit-test.yml)
[![build_docker](https://github.com/iotaledger/iota-core/actions/workflows/build_docker.yml/badge.svg?branch=develop)](https://github.com/iotaledger/iota-core/actions/workflows/build_docker.yml)
[![docker-network-health](https://github.com/iotaledger/iota-core/actions/workflows/docker-network-health.yml/badge.svg?branch=develop)](https://github.com/iotaledger/iota-core/actions/workflows/docker-network-health.yml)
[![docker-network-tests-nightly](https://github.com/iotaledger/iota-core/actions/workflows/docker-network-tests-nightly.yml/badge.svg?branch=develop)](https://github.com/iotaledger/iota-core/actions/workflows/docker-network-tests-nightly.yml)

In this repository you will find the following branches:

- `production`: this branch contains the latest released code targeted for the [IOTA mainnet](https://iota.org)
- `staging`: this branch contains the latest released code targeted for the [Shimmer network](https://shimmer.network)
- `develop`: default branch where all development will get merged to. This represents the next iteration of the node.

## Notes

- **Please open a [new issue](https://github.com/iotaledger/iota-core/issues/new) if you detect an error or crash (or submit a PR if you have already fixed it).**

## Configuration

An overview over all configuration parameters can be found [here.](documentation/configuration.md)

## Setup
We recommend not using this repo directly but using our pre-built [Docker images](https://hub.docker.com/r/iotaledger/iota-core).
6 changes: 3 additions & 3 deletions components/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
dashboardmetrics "github.com/iotaledger/iota-core/components/dashboard_metrics"
"github.com/iotaledger/iota-core/components/debugapi"
"github.com/iotaledger/iota-core/components/inx"
"github.com/iotaledger/iota-core/components/metrics"
"github.com/iotaledger/iota-core/components/metricstracker"
"github.com/iotaledger/iota-core/components/p2p"
"github.com/iotaledger/iota-core/components/prometheus"
"github.com/iotaledger/iota-core/components/protocol"
"github.com/iotaledger/iota-core/components/restapi"
coreapi "github.com/iotaledger/iota-core/components/restapi/core"
Expand All @@ -25,7 +25,7 @@ var (
Name = "iota-core"

// Version of the app.
Version = "1.0.0-alpha.1"
Version = "1.0.0-alpha.2"
)

func App() *app.App {
Expand All @@ -49,7 +49,7 @@ Command line flags:
protocol.Component,
dashboardmetrics.Component,
dashboard.Component,
metrics.Component,
prometheus.Component,
inx.Component,
),
)
Expand Down
8 changes: 4 additions & 4 deletions components/debugapi/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ func configure() error {
blocksPerSlot = shrinkingmap.New[iotago.SlotIndex, []*blocks.Block]()
blocksPrunableStorage = prunable.NewBucketManager(database.Config{
Engine: hivedb.EngineRocksDB,
Directory: ParamsDebugAPI.Path,
Directory: ParamsDebugAPI.Database.Path,

Version: 1,
PrefixHealth: []byte{debugPrefixHealth},
}, func(err error) {
Component.LogWarnf(">> DebugAPI Error: %s\n", err)
}, prunable.WithMaxOpenDBs(ParamsDebugAPI.MaxOpenDBs),
}, prunable.WithMaxOpenDBs(ParamsDebugAPI.Database.MaxOpenDBs),
)

routeGroup := deps.RestRouteManager.AddRoute("debug/v2")
Expand All @@ -98,7 +98,7 @@ func configure() error {

deps.Protocol.Events.Engine.SlotGadget.SlotFinalized.Hook(func(index iotago.SlotIndex) {
epoch := deps.Protocol.APIForSlot(index).TimeProvider().EpochFromSlot(index)
if epoch < iotago.EpochIndex(ParamsDebugAPI.PruningThreshold) {
if epoch < iotago.EpochIndex(ParamsDebugAPI.Database.Pruning.Threshold) {
return
}

Expand All @@ -107,7 +107,7 @@ func configure() error {
lastPruned++
}

for i := lastPruned; i < epoch-iotago.EpochIndex(ParamsDebugAPI.PruningThreshold); i++ {
for i := lastPruned; i < epoch-iotago.EpochIndex(ParamsDebugAPI.Database.Pruning.Threshold); i++ {
if err := blocksPrunableStorage.Prune(i); err != nil {
Component.LogWarnf(">> DebugAPI Error: %s\n", err)
}
Expand Down
12 changes: 8 additions & 4 deletions components/debugapi/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ type ParametersDebugAPI struct {
// Enabled whether the DebugAPI component is enabled.
Enabled bool `default:"true" usage:"whether the DebugAPI component is enabled"`

Path string `default:"testnet/debug" usage:"the path to the database folder"`
MaxOpenDBs int `default:"2" usage:"maximum number of open database instances"`
PruningThreshold uint64 `default:"1" usage:"how many epochs should be retained"`
DBGranularity int64 `default:"100" usage:"how many slots should be contained in a single DB instance"`
Database struct {
Path string `default:"testnet/debug" usage:"the path to the database folder"`
MaxOpenDBs int `default:"2" usage:"maximum number of open database instances"`
Granularity int64 `default:"100" usage:"how many slots should be contained in a single DB instance"`
Pruning struct {
Threshold uint64 `default:"1" usage:"how many epochs should be retained"`
}
} `name:"db"`
}

// ParamsDebugAPI is the default configuration parameters for the DebugAPI component.
Expand Down
2 changes: 1 addition & 1 deletion components/p2p/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
// ParametersP2P contains the definition of configuration parameters used by the p2p plugin.
type ParametersP2P struct {
// BindAddress defines on which multi addresses the p2p service should listen on.
BindMultiAddresses []string `default:"/ip4/0.0.0.0/tcp/14666,/ip6/::/tcp/14666" usage:"the bind multi addresses for p2p connections"`
BindMultiAddresses []string `default:"/ip4/0.0.0.0/tcp/15600,/ip6/::/tcp/15600" usage:"the bind multi addresses for p2p connections"`

ConnectionManager struct {
// Defines the high watermark to use within the connection manager.
Expand Down
Loading

0 comments on commit dd6a662

Please sign in to comment.