First, install SPARKL and make sure you’ve got a node running (use sse list if running natively, or docker ps if running the docker container).

We’re going to load HelloWorld into the node.

The file contains a mix which in turn contains a simple transaction.

The transaction invokes a request/reply operation on a nano-service.

  1. Connect to the local SPARKL
    sparkl connect http://localhost:8000
    
  2. Login as local administrator (remember to register the local admin first)
    sparkl login admin@localhost
    
  3. Upload the HelloWorld configuration file to the Scratch folder in your SPARKL node
    sparkl put http://opensparkl.org/uploads/HelloWorld.xml Scratch
    
  4. For convenience, change current folder to your new Scratch/HelloWorld
    sparkl cd Scratch/HelloWorld
    
  5. Set a cli variable called name to the literal value of your name
    sparkl vars -l name Maria
    
  6. Invoke the transaction by calling the solicit operation and you will see the response
    sparkl call Solicit
    

A polite greeting comes back.

Congratulations! You’ve now defined and executed your first Clear Box transaction!

You can try sparkl tree -a to view the HelloWorld mix on the console, which will show you this:


 µ HelloWorld
 ├── ▒ Sequencer:sequencer
 ├── ▒ NanoService:expr
 ├── ƒ name:string
 ├── ƒ greeting:string
 ├── >> Solicit:Sequencer name
 │   └── << Ok greeting
 └── <  Request:NanoService name
     └── > Ok greeting

You can also use sparkl render | browser to render it in your browser (I’m on a mac and used brew install browser which is a handy way to instantly render stdin).

Jacoby Thwaites

Jacoby Thwaites

Strictly no more than 2 cups of coffee, morning only