From e27f512c72afd942189e319b31f58da2db8e77c6 Mon Sep 17 00:00:00 2001 From: Alexander Sporn Date: Wed, 28 Apr 2021 17:40:33 +0200 Subject: [PATCH] Feat prepare release (#1054) * - Remove default values for networkId and public keys since these can change with network upgrades * - Disable windows binary release until we get a rocksdb build going * - Version 1.0.0 * - Using proper chrysalis networkId * adds config for IOTA AS * - Added config_as.json to Dockerfile and binary releases Co-authored-by: Luca Moser --- .goreleaser.yml | 19 +--- CHANGELOG.md | 2 +- config.json | 2 +- config_as.json | 210 ++++++++++++++++++++++++++++++++++++++++++ core/app/app.go | 2 +- core/protocfg/core.go | 11 +-- docker/Dockerfile | 1 + nfpm/rpm_files/postrm | 3 +- 8 files changed, 222 insertions(+), 28 deletions(-) create mode 100644 config_as.json diff --git a/.goreleaser.yml b/.goreleaser.yml index 7442b7a6b..85c08458d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -37,20 +37,6 @@ builds: - linux goarch: - arm64 - # Windows AMD64 - - id: hornet-windows-amd64 - binary: hornet - env: - - CGO_ENABLED=1 - - CC=x86_64-w64-mingw32-gcc - - CXX=x86_64-w64-mingw32-g++ - ldflags: - - -s -w -X github.com/gohornet/hornet/core/cli.AppVersion={{.Version}} - main: main.go - goos: - - windows - goarch: - - amd64 # Archives archives: @@ -70,6 +56,7 @@ archives: - README.md - LICENSE - config.json + - config_as.json - peering.json - profiles.json @@ -95,6 +82,10 @@ nfpms: dst: "/var/lib/hornet/config.json" type: config + - src: "config_as.json" + dst: "/var/lib/hornet/config_as.json" + type: config + - src: "peering.json" dst: "/var/lib/hornet/peering.json" type: config diff --git a/CHANGELOG.md b/CHANGELOG.md index 990c2aaec..c33f49abb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## [1.0.0-rc1] - 27.04.2021 +## [1.0.0] - 28.04.2021 ### Changed diff --git a/config.json b/config.json index d4440338e..19d2f48f9 100644 --- a/config.json +++ b/config.json @@ -70,7 +70,7 @@ "pruneReceipts": false }, "protocol": { - "networkID": "c2-mainnet", + "networkID": "chrysalis-mainnet", "bech32HRP": "iota", "minPoWScore": 4000, "milestonePublicKeyCount": 2, diff --git a/config_as.json b/config_as.json new file mode 100644 index 000000000..a534d0b5d --- /dev/null +++ b/config_as.json @@ -0,0 +1,210 @@ +{ + "restAPI": { + "jwtAuth": { + "enabled": false, + "salt": "HORNET" + }, + "excludeHealthCheckFromAuth": false, + "permittedRoutes": [ + "/health", + "/mqtt", + "/api/v1/info", + "/api/v1/tips", + "/api/v1/messages/:messageID", + "/api/v1/messages/:messageID/metadata", + "/api/v1/messages/:messageID/raw", + "/api/v1/messages/:messageID/children", + "/api/v1/messages", + "/api/v1/transactions/:transactionID/included-message", + "/api/v1/milestones/:milestoneIndex", + "/api/v1/milestones/:milestoneIndex/utxo-changes", + "/api/v1/outputs/:outputID", + "/api/v1/addresses/:address", + "/api/v1/addresses/:address/outputs", + "/api/v1/addresses/ed25519/:address", + "/api/v1/addresses/ed25519/:address/outputs", + "/api/v1/treasury" + ], + "whitelistedAddresses": [ + "127.0.0.1", + "::1" + ], + "bindAddress": "0.0.0.0:14265", + "powEnabled": true, + "powWorkerCount": 1, + "limits": { + "bodyLength": "1M", + "maxResults": 1000 + } + }, + "dashboard": { + "bindAddress": "localhost:8081", + "auth": { + "sessionTimeout": "72h", + "username": "admin", + "passwordHash": "0000000000000000000000000000000000000000000000000000000000000000", + "passwordSalt": "0000000000000000000000000000000000000000000000000000000000000000" + } + }, + "db": { + "engine": "rocksdb", + "path": "mainnetdb", + "autoRevalidation": false + }, + "snapshots": { + "depth": 50, + "interval": 200, + "fullPath": "snapshots/mainnet/full_snapshot.bin", + "deltaPath": "snapshots/mainnet/delta_snapshot.bin", + "deltaSizeThresholdPercentage": 50.0, + "downloadURLs": [ + { + "full": "https://s3.eu-central-1.amazonaws.com/dbfiles.as-network.iota-as.net/snapshots/hornet/latest-full_snapshot.bin", + "delta": "https://s3.eu-central-1.amazonaws.com/dbfiles.as-network.iota-as.net/snapshots/hornet/latest-delta_snapshot.bin" + } + ] + }, + "pruning": { + "enabled": true, + "delay": 60480, + "pruneReceipts": false + }, + "protocol": { + "networkID": "as-chrysalis", + "bech32HRP": "asit", + "minPoWScore": 4000, + "milestonePublicKeyCount": 2, + "publicKeyRanges": [ + { + "key": "3d98f288146c2dedd44daf97bebcb5ab38589ea2cb035ca77b96d94d618aeec8", + "start": 0, + "end": 3110400 + }, + { + "key": "0a8c945ad7712c1c31c0d5d33c5860ca62ff20fed4553b927f296a8b717ce433", + "start": 0, + "end": 3110400 + } + ] + }, + "pow": { + "refreshTipsInterval": "5s" + }, + "requests": { + "discardOlderThan": "15s", + "pendingReEnqueueInterval": "5s" + }, + "receipts": { + "backup": { + "enabled": false, + "folder": "receipts" + }, + "validator": { + "validate": false, + "api": { + "address": "http://localhost:14266", + "timeout": "5s" + }, + "coordinator": { + "address": "UDYXTZBE9GZGPM9SSQV9LTZNDLJIZMPUVVXYXFYVBLIEUHLSEWFTKZZLXYRHHWVQV9MNNX9KZC9D9UZWZ", + "merkleTreeDepth": 24 + } + } + }, + "tangle": { + "milestoneTimeout": "30s" + }, + "tipsel": { + "maxDeltaMsgYoungestConeRootIndexToCMI": 8, + "maxDeltaMsgOldestConeRootIndexToCMI": 13, + "belowMaxDepth": 15, + "nonLazy": { + "retentionRulesTipsLimit": 100, + "maxReferencedTipAge": "3s", + "maxChildren": 30, + "spammerTipsThreshold": 0 + }, + "semiLazy": { + "retentionRulesTipsLimit": 20, + "maxReferencedTipAge": "3s", + "maxChildren": 2, + "spammerTipsThreshold": 30 + } + }, + "node": { + "alias": "HORNET node", + "profile": "auto", + "disablePlugins": [], + "enablePlugins": [ + "Spammer" + ] + }, + "p2p": { + "bindMultiAddresses": [ + "/ip4/0.0.0.0/tcp/15600" + ], + "connectionManager": { + "highWatermark": 10, + "lowWatermark": 5 + }, + "gossipUnknownPeersLimit": 4, + "identityPrivateKey": "", + "peerStore": { + "path": "./p2pstore" + }, + "reconnectInterval": "30s" + }, + "p2pdisc": { + "advertiseInterval": "30s", + "maxDiscoveredPeerConns": 4, + "rendezvousPoint": "between-two-vertices", + "routingTableRefreshPeriod": "60s" + }, + "logger": { + "level": "info", + "disableCaller": true, + "encoding": "console", + "outputPaths": [ + "stdout" + ] + }, + "warpsync": { + "advancementRange": 150 + }, + "spammer": { + "message": "IOTA - A new dawn", + "index": "HORNET Spammer", + "indexSemiLazy": "HORNET Spammer Semi-Lazy", + "cpuMaxUsage": 0.8, + "mpsRateLimit": 5.0, + "workers": 0, + "autostart": false + }, + "mqtt": { + "bindAddress": "localhost:1883", + "wsPort": 1888, + "workerCount": 100 + }, + "profiling": { + "bindAddress": "localhost:6060" + }, + "prometheus": { + "bindAddress": "localhost:9311", + "fileServiceDiscovery": { + "enabled": false, + "path": "target.json", + "target": "localhost:9311" + }, + "databaseMetrics": true, + "nodeMetrics": true, + "gossipMetrics": true, + "cachesMetrics": true, + "restAPIMetrics": true, + "migrationMetrics": true, + "coordinatorMetrics": true, + "debugMetrics": false, + "goMetrics": false, + "processMetrics": false, + "promhttpMetrics": false + } +} diff --git a/core/app/app.go b/core/app/app.go index 4d054dab6..989a1cfed 100644 --- a/core/app/app.go +++ b/core/app/app.go @@ -20,7 +20,7 @@ var ( Name = "HORNET" // Version of the app. - Version = "1.0.0-alpha" + Version = "1.0.0" ) var ( diff --git a/core/protocfg/core.go b/core/protocfg/core.go index 824f73d9a..396e8c204 100644 --- a/core/protocfg/core.go +++ b/core/protocfg/core.go @@ -39,7 +39,7 @@ func init() { fs := flag.NewFlagSet("", flag.ContinueOnError) fs.Float64(CfgProtocolMinPoWScore, 4000, "the minimum PoW score required by the network.") fs.Int(CfgProtocolMilestonePublicKeyCount, 2, "the amount of public keys in a milestone") - fs.String(CfgProtocolNetworkIDName, "c2-mainnet", "the network ID on which this node operates on.") + fs.String(CfgProtocolNetworkIDName, "iota", "the network ID on which this node operates on.") fs.String(CfgProtocolBech32HRP, string(iotago.PrefixMainnet), "the HRP which should be used for Bech32 addresses.") return fs }(), @@ -80,13 +80,6 @@ func provide(c *dig.Container) { MinPoWScore: deps.NodeConfig.Float64(CfgProtocolMinPoWScore), } - if err := deps.NodeConfig.SetDefault(CfgProtocolPublicKeyRanges, &coordinator.PublicKeyRanges{ - &coordinator.PublicKeyRange{Key: "a9b46fe743df783dedd00c954612428b34241f5913cf249d75bed3aafd65e4cd", StartIndex: 0, EndIndex: 777600}, - &coordinator.PublicKeyRange{Key: "365fb85e7568b9b32f7359d6cbafa9814472ad0ecbad32d77beaf5dd9e84c6ba", StartIndex: 0, EndIndex: 1555200}, - }); err != nil { - panic(err) - } - if *cooPubKeyRangesFlag != "" { // load from special CLI flag if err := json.Unmarshal([]byte(*cooPubKeyRangesFlag), &res.PublicKeyRanges); err != nil { @@ -95,7 +88,7 @@ func provide(c *dig.Container) { return res } - // load from config or default value + // load from config if err := deps.NodeConfig.Unmarshal(CfgProtocolPublicKeyRanges, &res.PublicKeyRanges); err != nil { panic(err) } diff --git a/docker/Dockerfile b/docker/Dockerfile index 569d8d42c..97e9d24c2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -48,6 +48,7 @@ EXPOSE 14626/udp # Copy assets into distroless image COPY --from=build /go/bin/hornet /app/hornet COPY ./config.json /app/config.json +COPY ./config_as.json /app/config_as.json COPY ./peering.json /app/peering.json COPY ./profiles.json /app/profiles.json diff --git a/nfpm/rpm_files/postrm b/nfpm/rpm_files/postrm index ea0df0e85..9000f700e 100644 --- a/nfpm/rpm_files/postrm +++ b/nfpm/rpm_files/postrm @@ -6,5 +6,4 @@ if [ $1 -ge 1 ]; then fi rm -rf /var/lib/hornet/snapshots/* \ /etc/default/hornet \ - /var/lib/hornet/mainnetdb/* \ - /var/lib/hornet/comnetdb/* + /var/lib/hornet/mainnetdb/*