demo
tag 1
tag 2

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, viverra non, semper suscipit, posuere a, pede.

Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris sit amet orci. Aenean dignissim pellentesque felis.Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.

Lorem ipsum dolor sit amet Link inside text Lorem ipsum dolor sit amet

Example of text highlight

Heading 2

Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris sit amet orci. Aenean dignissim pellentesque felis.Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.

Example of a process

  • Golem, a global, open-source, decentralized supercomputer that anyone can access.
  • Learn what you need to know to set-up your Golem requestor node:
  • Requestor development: a quick primer
  • Quick start
  • Have a look at the most important concepts behind any Golem application: Golem application fundamentals

Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris sit amet orci. Aenean dignissim pellentesque felis.Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.

Example standard bullets

  • Golem, a global, open-source, decentralized supercomputer that anyone can access.
  • Learn what you need to know to set-up your Golem requestor node:
  • Requestor development: a quick primer
  • Quick start
  • Have a look at the most important concepts behind any Golem application: Golem application fundamentals

Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris sit amet orci. Aenean dignissim pellentesque felis.Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.

Example standard bullets

  1. Golem, a global, open-source, decentralized supercomputer that anyone can access.
  2. Learn what you need to know to set-up your Golem requestor node:
  3. Requestor development: a quick primer
  4. Quick start
  5. Have a look at the most important concepts behind any Golem application: Golem application fundamentals

Donec nec justo eget felis facilisis fermentum. Aliquam porttitor mauris sit amet orci. Aenean dignissim pellentesque felis.Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.

info

Now you know what a Golem VM application is and how it works.

success

Now you know what a Golem VM application is and how it works.

warning

Now you know what a Golem VM application is and how it works.

danger

Now you know what a Golem VM application is and how it works.

#!/bin/bash
echidna "Hello, Mars!" # gibberish: 'echidna' is not a valid bash command
tumbleweed | unicorns --glittery # again, 'tumbleweed' and 'unicorns' are not recognized commands
armadillo=$(cats playing_piano) # 'cats' not a recognized command, misuse of command substitution syntax
echo $rainbowFrogs # 'rainbowFrogs' not defined or given any value
See also

Example of an image being used

Hacker image

working comments (see source)

(below this line there is comment: see source)

(above this line there is a comment: see source)

Example of code from Github

import { TaskExecutor } from "@golem-sdk/task-executor";
import { pinoPrettyLogger } from "@golem-sdk/pino-logger";
import { program } from "commander";
import { fileURLToPath } from "url";

const DIR_NAME = fileURLToPath(new URL(".", import.meta.url));

const blenderParams = (frame) => ({
  scene_file: "/golem/resource/scene.blend",
  resolution: [400, 300],
  use_compositing: false,
  crops: [
    {
      outfilebasename: "out",
      borders_x: [0.0, 1.0],
      borders_y: [0.0, 1.0],
    },
  ],
  samples: 100,
  frames: [frame],
  output_format: "PNG",
  RESOURCES_DIR: "/golem/resources",
  WORK_DIR: "/golem/work",
  OUTPUT_DIR: "/golem/output",
});

async function main(subnetTag: string, driver?: "erc20", network?: string, maxParallelTasks?: number) {
  const setup = async (exe) => {
    console.log("Uploading the scene to the provider %s", exe.provider.name);
    await exe.uploadFile(`${DIR_NAME}/cubes.blend`, "/golem/resource/scene.blend");
    console.log("Upload of the scene to the provider %s finished", exe.provider.name);
  };
  const executor = await TaskExecutor.create({
    task: {
      maxParallelTasks,
      setup,
    },
    logger: pinoPrettyLogger(),
    payment: { driver, network },
    demand: {
      workload: { imageTag: "golem/blender:latest" },
      subnetTag,
    },
    market: {
      rentHours: 0.5,
      pricing: {
        model: "linear",
        maxStartPrice: 0.5,
        maxCpuPerHourPrice: 1.0,
        maxEnvPerHourPrice: 0.5,
      },
    },
  });

  try {
    const futureResults = [0, 10, 20, 30, 40, 50].map(async (frame) =>
      executor.run(async (exe) => {
        console.log("Started rendering of frame %d on provider %s", frame, exe.provider.name);

        const result = await exe
          .beginBatch()
          .uploadJson(blenderParams(frame), "/golem/work/params.json")
          .run("/golem/entrypoints/run-blender.sh")
          .downloadFile(`/golem/output/out${frame?.toString().padStart(4, "0")}.png`, `${DIR_NAME}/output_${frame}.png`)
          .end();

        console.log("Finished rendering of frame %d on provider %s", frame, exe.provider.name);

        return result?.length ? `output_${frame}.png` : "";
      }),
    );

    console.log("Scheduling all tasks");
    const results = await Promise.all(futureResults);
    console.log("Completed all tasks");

    results.forEach((result) => console.log(result));
  } catch (error) {
    console.error("Computation failed:", error);
  } finally {
    await executor.shutdown();
  }
}

program
  .option("--subnet-tag <subnet>", "set subnet name, for example 'public'")
  .option("--payment-driver, --driver <driver>", "payment driver name, for example 'erc20'")
  .option("--payment-network, --network <network>", "network name, for example 'holesky'")
  .option("-t, --max-parallel-tasks <maxParallelTasks>", "max parallel tasks");
program.parse();
const options = program.opts();
main(options.subnetTag, options.driver, options.network, options.maxParallelTasks);

How to import from other files

If you wish to import content from another file, these files has to go into the src/markdoc/partials directory. You can then import the content using the following syntax.

{% partial file="demo.md" /%}

Keep in mind that this partial syntax root is in the directory specified above.

I'm saying hello from the partials demo file!

How to use the default values component

We came across the need to create a page with all the default values in the SDK, so it was easy for the users to find them. The page looked blank, so what we came up with was a custom component to make it easier on the eyes.

The component accepts a title and a default value, and everything inside will be rendered as the description, and in here its possible to markdown syntax to for example highlight code.

{% defaultvalue title="allocationExpires" defaultValue="60000 * 60" %}
Specifies the duration after which an allocation expires, in milliseconds. A valid allocation is essential for accepting invoices.
{% /defaultvalue %}

allocationExpires

Specifies the duration after which an allocation expires, in milliseconds. A valid allocation is essential for accepting invoices.

Default value: 60000 * 60

Was this helpful?