symbol-bootstrap
symbol-bootstrap copied to clipboard
Allow a SN host with an IP address without a hostname (FQDN)
After having installed and configured a Symbol node with symbol-bootstrap, the node can be used to be enrolled in the SN reward program. However, if the node does not have a hostname (FQDN), the $ symbol-bootstrap enrolRewardProgram gives the following error:
Error: Cannot create reward program configuration. You need to provide a host field in preset: api-node at ConfigService.generateNodeConfiguration (/usr/lib/node_modules/symbol-bootstrap/lib/service/ConfigService.js:220:23) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async /usr/lib/node_modules/symbol-bootstrap/lib/service/ConfigService.js:175:81 at async Promise.all (index 0) at async ConfigService.generateNodes (/usr/lib/node_modules/symbol-bootstrap/lib/service/ConfigService.js:175:9) at async ConfigService.run (/usr/lib/node_modules/symbol-bootstrap/lib/service/ConfigService.js:100:13) at async Config.run (/usr/lib/node_modules/symbol-bootstrap/lib/commands/config.js:26:9) at async Config._run (/usr/lib/node_modules/symbol-bootstrap/node_modules/@oclif/command/lib/command.js:43:20) at async Config.runCommand (/usr/lib/node_modules/symbol-bootstrap/node_modules/@oclif/config/lib/config.js:173:24) at async Main.run (/usr/lib/node_modules/symbol-bootstrap/node_modules/@oclif/command/lib/main.js:27:9) Error: Cannot create reward program configuration. You need to provide a host field in preset: api-node
With a host without a FQDN, there is no need to provide the host in the config as mentioned in the documentation on https://docs.symbolplatform.com/guides/network/configuring-node-properties.html:
"host string Node host (leave empty to auto-detect IP)."
So something is not working as described or as intended, or at least is not consistent. The error "Cannot create reward program configuration. You need to provide a host field in preset:" is contradictory and could probably be eliminated, as the documentation seems to be correct about auto-detecting an IP address.
Finally, as a little quality suggestion, it would be better to use the term 'host' when an IP address is meant, and the term 'hostname' when a FQDN is meant. Mixing both can be confusing and cause misunderstandings and errors as the above. And in the case a required parameter could contain both, please clarify that is indeed the case in help, documentation and examples.
Thanks in advance.
As a side note, when doing the SN tests with $ symbol-bootstrap enrolRewardProgram , which resulted in the error described above, another error was presented first: "error The target folder 'target' should be deleted"
It is not clear why that would be needed, as the error does not provide any cause, reason or clarification. If possible it should be allowed to convert an existing (potentially fully synced) node into a SN. Why the target folder would have to be deleted seems to be unclear. If it indeed would be needed for whatever reason, that would cause operational issues, because it requires to restart an already synced node from scratch and resync from block 1 and resync the whole chain potentially taking a long time ..... better to avoid that if possible. And if not possible to avoid, please add clarification to the error so the node owner has a better idea what is causing the error or how it could be mitigated. Thanks in advance.
host can be either a hostname or an IP. Something our NGL reward controller can talk back