Golem users execute tasks on remote computers.
In this exercise, you will learn how to create a script that will run a task on a remote node and utilize a specific Golem image.
Create a script that will run a fortune command on the remote node and display the output. For this task, you can use a Golem-provided image containing the fortune command. That image's hash is 1e65223a888bd7a4521e06ba7f3f3ba648e8a09ffd18f3658efba336.
Please observe how long it takes to complete the technical part of the tasks. We will ask you for such information in the feedback form.
-
Modify the
main.mjsscript to execute the fortune commands. -
Run the script and verify the output.
-
Add changes in the
run-a-taskdirectory. -
Fill out the feedback form and publish changes in your repository fork.
-
See Golem JS QuickStart and JS QuickStart Explained.
-
The
fortunecommand is available in the/usr/gamesdirectory within the image. -
The usage example of the
fortunecommand:fortune -lwill produce a sentence from literature, i.e.:When I was younger, I could remember anything, whether it had happened or not; but my faculties are decaying now and soon I shall be so I cannot remember any but the things that never happened. It is sad to go to pieces like this but we all have to do it. -- Mark Twainfortune -iwill produce a short fortune, i.e.:Don't hate yourself in the morning -- sleep till noon. -
You can always ask on the Discord
#js-discussionchannel in the SDK section.