This repository has been archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* hello example * out dir * README * Update README.md * Update hello/README.md Co-Authored-By: Jakub Konka <kubkon@jakubkonka.com> * Update task.json * Add files via upload * Add files via upload
- Loading branch information
1 parent
2d6ce8d
commit c2f0f61
Showing
6 changed files
with
5,427 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
It is simple hello world gWASM program. Download the `hello` directory, enter it, update paths in `task.json` file | ||
``` | ||
"input_dir": "/path/to/your/working/directory/hello/in", | ||
"output_dir": "/path/to/your/working/directory/hello/out", | ||
``` | ||
and execute the command | ||
``` | ||
golemcli tasks create task.json | ||
``` | ||
|
||
If datadir cannot be found, then | ||
``` | ||
golemcli tasks create task.json --datadir=/path/to/your/datadir | ||
``` | ||
|
||
If golemcli cannot be found, then please read [Golem docs](https://docs.golem.network/#/Products/Brass-Beta/Command-line-interface) on how to use golemcli. | ||
|
||
After a while check the output | ||
``` | ||
cat out/subtask1/out.txt | ||
``` | ||
|
||
It should contain | ||
``` | ||
hello world! | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <stdio.h> | ||
|
||
int main(int argc, char** argv) { | ||
char* name = argc >= 2 ? argv[1] : "anonymous"; | ||
|
||
FILE* f_out = fopen("out.txt", "w"); | ||
if (f_out == NULL) { | ||
printf("couldn't open file for writing\n"); | ||
return 1; | ||
} | ||
|
||
fprintf(f_out, "hello %s!\n", name); | ||
|
||
fclose(f_out); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.