(image)

Programming Hotmoka
A tutorial on Hotmoka and smart contracts in Takamaka

8.3 Logs

The moka tool generates a hotmoka.log.* log file. Therefore, that file is generated also for the moka nodes commants that initialize or resume a Hotmoka node. In that case, the logs will report which transactions have been processed, together with potential errors.

The hotmoka.log file is normally rotated across successive or very long executions of moka. Therefore, look for files such as hotmoka.log.0 or hotmoka.log.1 to find the logs of the specific execution of moka that you are interested in.

The content of the logs, in the case of the execution of a Hotmoka node, might look like:

cat ~/hotmoka.log.0 | tail -10
[2026-02-02 19:50:24] [INFO ] 1e1b85af2622777e7292efe60c1f0af313876b7182b10db04b19757804d23318: delivering start -- [io.hotmoka.node.local.internal.AbstractStoreTransformationImpl deliverTransaction]
[2026-02-02 19:50:24] [INFO ] the gas cache has been updated since it might have changed: the new gas price is 75 -- [io.hotmoka.node.local.internal.AbstractStoreTransformationImpl updateCaches]
[2026-02-02 19:50:24] [INFO ] 1e1b85af2622777e7292efe60c1f0af313876b7182b10db04b19757804d23318: delivering success -- [io.hotmoka.node.local.internal.AbstractStoreTransformationImpl deliverTransaction]
[2026-02-02 19:50:24] [INFO ] coinbase: units of coin minted since the previous reward: 713470294182709052557 -- [io.hotmoka.node.disk.internal.DiskStoreTransformation deliverCoinbaseTransactions]
[2026-02-02 19:50:24] [INFO ] 1e1b85af2622777e7292efe60c1f0af313876b7182b10db04b19757804d23318#0: notified as event with creator bfb48958275c8f7242868fed2fbce6fb936f01e07738a522ee9a11bc4cf000ff#e -- [io.hotmoka.node.local.internal.
AbstractLocalNodeImpl notifyEvent]
[2026-02-02 19:50:24] [INFO ] Started listener bound to [0.0.0.0:8001] -- [org.glassfish.grizzly.http.server.NetworkListener start]
[2026-02-02 19:50:24] [INFO ] [HttpServer-2] Started. -- [org.glassfish.grizzly.http.server.HttpServer start]
[2026-02-02 19:50:24] [INFO ] node service(ws://localhost:8001): published -- [io.hotmoka.node.service.internal.NodeServiceImpl <init>]
[2026-02-02 19:50:24] [INFO ] Stopped listener bound to [0.0.0.0:8001] -- [org.glassfish.grizzly.http.server.NetworkListener shutdownNow]
[2026-02-02 19:50:25] [INFO ] node service(ws://localhost:8001): closed -- [io.hotmoka.node.service.internal.NodeServiceImpl closeResources]

If you want to follow in real time what is happening inside your node, you can run for instance tail -f hotmoka.log.0: this will hang and print the new log entries as they are generated. Assuming that you have a local node running in your machine, try for instance in another shell to run moka nodes manifest show: you will see in the log all new entries related to the execution of the methods to access the information on the node printed by the last command.

Hotmoka nodes started with Docker disable the generation of the log files and dump logs to the standard output, where they can be accessed with the docker logs command. Therefore, they do not generate any hotmoka.log file. See next chapter for information.