nuriel77 / hornet-playbook

Ansible Playbook for Hornet IOTA Full Node
MIT License
67 stars 11 forks source link

Hornet private tangle setup #20

Closed CMIT-RomanP closed 3 years ago

CMIT-RomanP commented 3 years ago

I tried the Hornet private tangle setup.

I found the following minor changes. The values specified in the coordinator configuration should be "coordinator": { "address":"", "securityLevel":1, "merkleTreeDepth":18, "mwm":5, "stateFilePath":"coordinator/coordinator.state", "merkleTreeFilePath":"coordinator/coordinator.tree", "intervalSeconds":60, "checkpoints": { "maxTrackedTails": 10000 }, "tipsel": { "minHeaviestBranchUnconfirmedTransactionsThreshold": 20, "maxHeaviestBranchTipsPerCheckpoint": 10, "randomTipsPerCheckpoint": 2, "heaviestBranchSelectionDeadlineMilliseconds": 100 } not as shown in https://github.com/gohornet/hornet/wiki/Tutorials%3A-Private-Tangle#configuration. The coordinator bootstrap command should contain "-v /var/lib/hornet/peering.json:/app/peering.json" otherwise "No config file found via './peering.[json,toml,yaml, yml] '. Loading default settings." error will occur.

However, after the coordinator bootstrap command, the coordinator does not start and no milestone is generated. It looks like maybe two configs are loading, see the following log

Parameters loaded: { "acceptanyconnection": false, "config": "config", "config-dir": ".", "coobootstrap": true, "coordinator": { "address": "YINUKLVAQSLNKIWOITTKHIZJYZNPGGWOSHWSHOOGXKHZMONPPJCICHQ9XDZHVMVTDDMZEMDXTCIJOIUOC", "checkpoints": { "maxtrackedtails": 10000, "maxtrackedtransactions": 10000 }, "intervalseconds": 60, "merkletreedepth": 18, "merkletreefilepath": "coordinator/coordinator.tree", "milestonemerkletreehashfunc": "BLAKE2b-512", "mwm": 5, "securitylevel": 1, "statefilepath": "coordinator/coordinator.state", "tipsel": { "heaviestbranchselectiondeadlinemilliseconds": 100, "maxheaviestbranchtipspercheckpoint": 10, "minheaviestbranchunconfirmedtransactionsthreshold": 20, "randomtipspercheckpoint": 2 } }, "coostartindex": "0", "dashboard": { "basicauth": { "enabled": false, "username": "" }, "bindaddress": "127.0.0.1:8087", "dev": false, "theme": "default" }, "db": { "debug": false, "path": "mainnetdb" }, "forceglobalsnapshot": false, "help": false, "httpapi": { "basicauth": { "enabled": false, "username": "" }, "bindaddress": "127.0.0.1:14265", "excludehealthcheckfromauth": false, "limits": { "bodylengthbytes": 1000000, "findtransactions": 1000, "gettrytes": 1000, "requestslist": 1000 }, "permitremoteaccess": [ "getNodeInfo", "getBalances", "checkConsistency", "getTipInfo", "getTransactionsToApprove", "getInclusionStates", "getNodeAPIConfiguration", "wereAddressesSpentFrom", "broadcastTransactions", "findTransactions", "storeTransactions", "getTrytes", "attachToTangle", "interruptAttachingToTangle" ], "whitelistedaddresses": [] }, "maxpeers": 5, "mqtt": { "config": "mqtt_config.json" }, "network": { "autopeering": { "bindaddress": "0.0.0.0:14626", "entrynodes": [], "inboundpeers": 2, "maxdroppedpacketspercentage": 0, "outboundpeers": 2, "runasentrynode": true, "saltlifetime": 30, "seed": "" }, "gossip": { "bindaddress": "0.0.0.0:15600", "reconnectattemptintervalseconds": 60 }, "preferipv6": false }, "node": { "alias": "Digiblocks", "disableplugins": [ "Autopeering", "Spammer", "ZMQ", "MQTT" ], "enableplugins": [ "Coordinator", "Prometheus" ], "showaliasingetnodeinfo": false }, "overwritecooaddress": false, "peeringconfig": "peering", "profilesconfig": "profiles", "profiling": { "bindaddress": "127.0.0.1:6060" }, "prometheus": { "bindaddress": "127.0.0.1:9312", "fileservicediscovery": { "enabled": false, "path": "target.json", "target": "localhost:9311" }, "gometrics": true, "processmetrics": true, "promhttpmetrics": true }, "snapshots": { "global": { "index": 0, "path": "snapshot/snapshot.csv", "spentaddressespaths": [] }, "loadtype": "global", "local": { "depth": 50, "downloadurls": [], "intervalsynced": 50, "intervalunsynced": 1000, "path": "snapshots/mainnet/export.bin" }, "pruning": { "delay": 40000, "enabled": true } }, "spammer": { "address": "HORNET99INTEGRATED99SPAMMER999999999999999999999999999999999999999999999999999999", "bundlesize": 1, "cpumaxusage": 0.8, "depth": 1, "message": "Spamming with HORNET tipselect, thank you for using HORNET playbook", "semilazytipslimit": 30, "tag": "HORNET99INTEGRATED99SPAMMER99PLAYBOOK99RULES", "tagsemilazy": "", "tpsratelimit": 0, "valuespam": false, "workers": 0 }, "spentaddresses": { "enabled": true }, "syncedatstartup": false, "tipsel": { "belowmaxdepth": 15, "maxdeltatxoldestrootsnapshotindextolsmi": 13, "maxdeltatxyoungestrootsnapshotindextolsmi": 8, "nonlazy": { "maxapprovers": 2, "maxreferencedtipageseconds": 3, "retentionrulestipslimit": 100 }, "semilazy": { "maxapprovers": 2, "maxreferencedtipageseconds": 3, "retentionrulestipslimit": 20 } }, "useprofile": "auto", "version": false, "warpsync": { "advancementrange": 50 }, "zmq": { "bindaddress": "127.0.0.1:5556", "protocol": "tcp" } } Parameters loaded: { "acceptanyconnection": false, "config": "config", "config-dir": ".", "coobootstrap": true, "coordinator": { "address": "UDYXTZBE9GZGPM9SSQV9LTZNDLJIZMPUVVXYXFYVBLIEUHLSEWFTKZZLXYRHHWVQV9MNNX9KZC9D9UZWZ", "checkpoints": { "maxtrackedtransactions": 10000 }, "intervalseconds": 10, "merkletreedepth": 24, "merkletreefilepath": "coordinator.tree", "milestonemerkletreehashfunc": "BLAKE2b-512", "mwm": 14, "securitylevel": 2, "statefilepath": "coordinator.state", "tipsel": { "heaviestbranchselectiondeadlinemilliseconds": 100, "maxheaviestbranchtipspercheckpoint": 10, "minheaviestbranchunconfirmedtransactionsthreshold": 20, "randomtipspercheckpoint": 3 } }, "coostartindex": "0", "dashboard": { "basicauth": { "enabled": false, "passwordhash": "", "passwordsalt": "", "username": "" }, "bindaddress": "localhost:8081", "dev": false, "theme": "default" }, "db": { "debug": false, "path": "mainnetdb" }, "forceglobalsnapshot": false, "help": false, "httpapi": { "basicauth": { "enabled": false, "passwordhash": "", "passwordsalt": "", "username": "" }, "bindaddress": "0.0.0.0:14265", "excludehealthcheckfromauth": false, "limits": { "bodylengthbytes": 1000000, "findtransactions": 1000, "gettrytes": 1000, "requestslist": 1000 }, "permitremoteaccess": [ "getNodeInfo", "getBalances", "getTransactionsToApprove", "getInclusionStates", "getNodeAPIConfiguration", "wereAddressesSpentFrom", "broadcastTransactions", "findTransactions", "storeTransactions", "getTrytes" ], "whitelistedaddresses": [] }, "maxpeers": 5, "mqtt": { "config": "mqtt_config.json" }, "network": { "autopeering": { "bindaddress": "0.0.0.0:14626", "entrynodes": [ "46CstniGgfWMdAySiWuS7bVfugwuHZCUQKVaC4Y34EYJ@enter.hornet.zone:14626", "EkSLZ4uvSTED1x6KaGzqxoGxjbytt2rPVfbJk1LRLCGL@enter.manapotion.io:18626", "2GHfjJhTqRaKCGBJJvS5RWty61XhjX7FtbVDhg7s8J1x@entrynode.tanglebay.org:14626", "iotaMk9Rg8wWo1DDeG7fwV9iJ41hvkwFX8w6MyTQgDu@enter.thetangle.org:14627" ], "inboundpeers": 2, "maxdroppedpacketspercentage": 0, "outboundpeers": 2, "runasentrynode": false, "saltlifetime": 30, "seed": "" }, "gossip": { "bindaddress": "0.0.0.0:15600", "reconnectattemptintervalseconds": 60 }, "preferipv6": false }, "node": { "alias": "", "disableplugins": [], "enableplugins": [], "showaliasingetnodeinfo": false }, "overwritecooaddress": false, "peeringconfig": "peering", "peers": [], "profilesconfig": "profiles", "profiling": { "bindaddress": "localhost:6060" }, "prometheus": { "bindaddress": "localhost:9311", "fileservicediscovery": { "enabled": false, "path": "target.json", "target": "localhost:9311" }, "gometrics": false, "processmetrics": false, "promhttpmetrics": false }, "snapshots": { "global": { "index": 1050000, "path": "snapshotMainnet.txt", "spentaddressespaths": [ "previousEpochsSpentAddresses1.txt", "previousEpochsSpentAddresses2.txt", "previousEpochsSpentAddresses3.txt" ] }, "loadtype": "local", "local": { "depth": 50, "downloadurls": [], "intervalsynced": 50, "intervalunsynced": 1000, "path": "snapshots/mainnet/export.bin" }, "pruning": { "delay": 40000, "enabled": true } }, "spammer": { "address": "HORNET99INTEGRATED99SPAMMER999999999999999999999999999999999999999999999999999999", "bundlesize": 1, "cpumaxusage": "0.5", "message": "Spamming with HORNET tipselect", "semilazytipslimit": 20, "tag": "HORNET99SPAMMER999999999999", "tagsemilazy": "", "tpsratelimit": "0.1", "valuespam": false, "workers": 1 }, "spentaddresses": { "enabled": true }, "syncedatstartup": false, "tipsel": { "belowmaxdepth": 15, "maxdeltatxoldestrootsnapshotindextolsmi": 13, "maxdeltatxyoungestrootsnapshotindextolsmi": 8, "nonlazy": { "maxapprovers": 2, "maxreferencedtipageseconds": 3, "retentionrulestipslimit": 100 }, "semilazy": { "maxapprovers": 2, "maxreferencedtipageseconds": 3, "retentionrulestipslimit": 20 } }, "useprofile": "auto", "version": false, "warpsync": { "advancementrange": 50 }, "zmq": { "bindaddress": "localhost:5556", "protocol": "tcp" } } Parameters loaded: { "custom": { "caches": { "addresses": { "cachetimems": 100, "leakdetection": { "enabled": false, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "approvers": { "cachetimems": 1500, "leakdetection": { "enabled": false, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "bundles": { "cachetimems": 1500, "leakdetection": { "enabled": false, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "bundletransactions": { "cachetimems": 500, "leakdetection": { "enabled": false, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "incomingtransactionfilter": { "cachetimems": 2000, "leakdetection": { "enabled": false, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "milestones": { "cachetimems": 500, "leakdetection": { "enabled": false, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "tags": { "cachetimems": 100, "leakdetection": { "enabled": false, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "transactions": { "cachetimems": 1500, "leakdetection": { "enabled": false, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "unconfirmedtx": { "cachetimems": 100, "leakdetection": { "enabled": false, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } } } }, "debug": { "caches": { "addresses": { "cachetimems": 1500, "leakdetection": { "enabled": true, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "approvers": { "cachetimems": 1500, "leakdetection": { "enabled": true, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "bundles": { "cachetimems": 1500, "leakdetection": { "enabled": true, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "bundletransactions": { "cachetimems": 500, "leakdetection": { "enabled": true, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "incomingtransactionfilter": { "cachetimems": 1500, "leakdetection": { "enabled": true, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "milestones": { "cachetimems": 1500, "leakdetection": { "enabled": true, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "tags": { "cachetimems": 1500, "leakdetection": { "enabled": true, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "transactions": { "cachetimems": 1500, "leakdetection": { "enabled": true, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } }, "unconfirmedtx": { "cachetimems": 1500, "leakdetection": { "enabled": true, "maxconsumerholdtimesec": 30, "maxconsumersperobject": 50 } } } } }

          ██╗  ██╗ ██████╗ ██████╗ ███╗   ██╗███████╗████████╗
          ██║  ██║██╔═══██╗██╔══██╗████╗  ██║██╔════╝╚══██╔══╝
          ███████║██║   ██║██████╔╝██╔██╗ ██║█████╗     ██║
          ██╔══██║██║   ██║██╔══██╗██║╚██╗██║██╔══╝     ██║
          ██║  ██║╚██████╔╝██║  ██║██║ ╚████║███████╗   ██║
          ╚═╝  ╚═╝ ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═══╝╚══════╝   ╚═╝
                               v0.5.0

2020-08-25T16:24:22Z INFO CLI cli/plugin.go:85 Profile mode 'auto', Using profile '8gb' 2020-08-25T16:24:22Z INFO CLI cli/plugin.go:90 Loading plugins ... 2020-08-25T16:24:22Z INFO Node node/node.go:95 Loading Plugin: CLI ... done 2020-08-25T16:24:22Z INFO Node node/node.go:95 Loading Plugin: Graceful Shutdown ... done 2020-08-25T16:24:22Z INFO Node node/node.go:95 Loading Plugin: Profiling ... done 2020-08-25T16:24:22Z INFO Node node/node.go:95 Loading Plugin: Database ... done 2020-08-25T16:24:22Z INFO Node node/node.go:86 Skipping Plugin: Autopeering 2020-08-25T16:24:22Z INFO Node node/node.go:95 Loading Plugin: WebAPI ... done 2020-08-25T16:24:22Z INFO Node node/node.go:113 Executing plugins ... 2020-08-25T16:24:22Z INFO Node node/node.go:117 Starting Plugin: CLI ... done 2020-08-25T16:24:22Z INFO Node node/node.go:117 Starting Plugin: Graceful Shutdown ... done 2020-08-25T16:24:22Z INFO Node node/node.go:117 Starting Plugin: Profiling ... done 2020-08-25T16:24:22Z INFO Node node/node.go:117 Starting Plugin: Database ... done 2020-08-25T16:24:22Z INFO WebAPI webapi/plugin.go:166 Starting WebAPI server ... 2020-08-25T16:24:22Z INFO Node node/node.go:117 Starting Plugin: WebAPI ... done 2020-08-25T16:24:22Z INFO Node node/node.go:120 Starting background workers ... 2020-08-25T16:24:22Z INFO WebAPI webapi/plugin.go:182 Starting WebAPI server ... done 2020-08-25T16:24:22Z INFO WebAPI webapi/plugin.go:188 You can now access the API using: http://127.0.0.1:14265

Thank you for your help, Roman

nuriel77 commented 3 years ago

@CMIT-RomanP Thanks for reporting. Hornet have removed the coordinator values from the main configuration file, I have therefore automatically (and wrongfully) removed the parameters from the comnet variables.

I have it back in recent commits and comnet setup seems to work. Can you please try to run:

cd /opt/hornet-playbook && git pull && ansible-playbook -i inventory site.yml -v -e overwrite=yes
CMIT-RomanP commented 3 years ago

Thank you for the quick reply. I tried, but the coordinator still does not start and no milestone is generated.

nuriel77 commented 3 years ago

@CMIT-RomanP I see that HORNET's official documentation has not been updated with the release changes of 0.5.0.

Regarding this:

command should contain "-v /var/lib/hornet/peering.json:/app/peering.json" otherwise "No config file found via './peering.[json,toml,yaml, yml] '. Loading default settings." error will occur.

This is not an error and can be safely ignored: 2020/08/25 20:54:16 No config file found via './peering.[json,toml,yaml,yml]'. Loading default settings. As you can see it is using default values, and since this only appears during merkle tree and bootstrap commands it is not important.

I have successfully managed to get the coo working:

  1. Goto horc and enable the coordinator plugin
  2. Stop hornet, delete files from /var/lib/hornet/mainnetdb/* and /var/lib/hornet/snapshot/*
  3. Add the coordinator values in /var/lib/hornet/config.json, mine looked like this:
    "coordinator": {
    "address": "NYBKHUUGK9RBOAZUATPIBRQEABNL9ECFTTWTVKLXHODK9OB9ATLUJA9GBROETAUGWVBAFOPDEMO9XNVTW",
    "securityLevel": 2,
    "merkleTreeDepth": 5,
    "mwm": 3,
    "stateFilePath": "coordinator/state",
    "merkleTreeFilePath": "coordinator/tree",
    "intervalSeconds": 60,
    "checkpoints": {
      "maxTrackedTails": 10000
    },
    "tipsel": {
      "minHeaviestBranchUnconfirmedTransactionsThreshold": 20,
      "maxHeaviestBranchTipsPerCheckpoint": 10,
      "randomTipsPerCheckpoint": 2,
      "heaviestBranchSelectionDeadlineMilliseconds": 100
    }
    },
  4. The snapshot section in config.json should look like this:
    "snapshots": {
    "loadType": "global",
    "local": {
      "intervalSynced": 200,
      "intervalUnsynced": 1000,
      "path": "snapshot/export.bin",
      "downloadURLs": [
        "https://ls.manapotion.io/comnet/export.bin"
      ]
    },
    "global": {
      "path": "snapshot/snapshot.csv",
      "spentAddressesPaths": [],
      "index": 0
    },
    "pruning": {
      "enabled": true,
      "delay": 1000
    }
    },
  5. Add the /var/lib/hornet/snapshot/snapshot.csv file as described in HORNET's tutorial (path is correct here for playbook node)
  6. run, and save the result of:
    docker run --rm -e COO_SEED=QQXBGONJZKHZBZIEVUYTOYTLPGDGAOVYMOGFNSGPELJFNPZMBLDEJZUPAOCVFZ9JNBKVXNDXYCADRXXFO -v /var/lib/hornet/coordinator:/app/coordinator -v /var/lib/hornet/config.json:/app/config.json -v /var/lib/hornet/profiles.json:/app/profiles.json -v /var/lib/hornet/snapshot:/app/snapshot gohornet/hornet:v0.5.0 tool merkle
  7. Bootstrap coo, stop (ctrl-c) once you see it has issued a milestone (Coordinator coordinator/plugin.go:373 milestone issued (1)...)
    docker run --rm -e COO_SEED=QQXBGONJZKHZBZIEVUYTOYTLPGDGAOVYMOGFNSGPELJFNPZMBLDEJZUPAOCVFZ9JNBKVXNDXYCADRXXFO -v /var/lib/hornet/mainnetdb:/app/mainnetdb -v /var/lib/hornet/coordinator:/app/coordinator -v /var/lib/hornet/snapshot:/app/snapshot -v /var/lib/hornet/config.json:/app/config.json -v /var/lib/hornet/profiles.json:/app/profiles.json gohornet/hornet:v0.5.0 --cooBootstrap
  8. Edit /etc/default/hornet and add the COO_SEED, e.g.:
    DOCKER_OPTS="-e COO_SEED=QQXBGONJZKHZBZIEVUYTOYTLPGDGAOVYMOGFNSGPELJFNPZMBLDEJZUPAOCVFZ9JNBKVXNDXYCADRXXFO"

Hope this helps.

NB I didn't want to automate the process as there are rapid changes to keep up with on each release. I hope they will update the documentation in the tutorial soon.

CMIT-RomanP commented 3 years ago

Thank you for your help. I finally successfully installed Hornet private tangle. The fact that IOTA thus changed the config parameters in version 0.5.0 is evidenced by a small note regarding reease (https://github.com/gohornet/hornet/releases/tag/v0.5.0), however, the documentation remained unchanged.

nuriel77 commented 3 years ago

@CMIT-RomanP I've created a PR on HORNET's wiki, I think that should be corrected soon. If you have any input on the PR please feel free to comment on it https://github.com/gohornet/wiki/pull/39