Skip to content

Commit

Permalink
Feat prepare release (#1054)
Browse files Browse the repository at this point in the history
* - 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 <[email protected]>
  • Loading branch information
alexsporn and luca-moser committed Apr 28, 2021
1 parent 7333b75 commit e27f512
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 28 deletions.
19 changes: 5 additions & 14 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -70,6 +56,7 @@ archives:
- README.md
- LICENSE
- config.json
- config_as.json
- peering.json
- profiles.json

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"pruneReceipts": false
},
"protocol": {
"networkID": "c2-mainnet",
"networkID": "chrysalis-mainnet",
"bech32HRP": "iota",
"minPoWScore": 4000,
"milestonePublicKeyCount": 2,
Expand Down
210 changes: 210 additions & 0 deletions config_as.json
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion core/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
Name = "HORNET"

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

var (
Expand Down
11 changes: 2 additions & 9 deletions core/protocfg/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}(),
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions nfpm/rpm_files/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

0 comments on commit e27f512

Please sign in to comment.