Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added some more detail

...

In the example above, port number 8084 was chosen. By default, if you run the command `pico-engine` without setting the environment variable, port 8080 will be used. The node pico engine will spend some time initializing internal data structures before it starts its web server.

When you first run the node pico-engine, it does some initialization work, which may take some time. After doing this, it starts a web server on the port you selected, if any, or on port 8080.

Note that the web server displays the URL of its document root, ex. "http://localhost:8084" and then continues to run. As we will see later, messages will be logged to this console.

Create a primary, or owner pico

Visit the default web page of your web server. As this page loads, it will perform a bootstrap sequence, which creates a pico, known as naming it "Owner Pico" and then registers and installs two rulesets.

...

Subsequent visits to the same page will short-circuit the bootstrap (because it's already been done).

In the console window in which the node pico-engine is running, there will be some logging concerning the two events sent during intial bootstrapping. You may find it interesting to try to make sense of these log messages.

Writing KRL

Here is a sample KRL ruleset:

...

Open the "Engine Rulesets" page (linked from the "Pico Bootstrap" page), and paste the ruleset above into the big text area, and click the "validate" button. When your KRL compiles correctly, you will see a result of "ok" beneath the buttons, with the page looking like this screenshot.

Info

Hint: you The editor in the "Engine Rulesets" page is very primitive and does not include a "save to disk" option. You should also save your ruleset somewhere in your file system , (or in a repository), named, say "hello_world.krl", as the editor in the "Engine Rulesets" page is very primitive and does not include a "save to disk" option.

Click on the "register" button, and then your page will look like this screenshot.

Image Added

Your ruleset is now registered with the node pico-engine, and its name is highlighted in the list of registered rulesets. Notice the circle beside the ruleset name. This indicates that the source code has been registered with the pico-engine, but is not yet enabled. Click on the "enable" button to take care of this.

Finally, click on the "install" button. This causes the pico-engine to compile the KRL and cache the compiled version in a rulesets folder. Once this has been done, the ruleset can be added to picos.

...