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.
- Connect to the local SPARKL
sparkl connect http://localhost:8000
- Login as local administrator (remember to register the local admin first)
sparkl login admin@localhost
- Upload the HelloWorld configuration file to the Scratch folder in your SPARKL node
sparkl put http://opensparkl.org/uploads/HelloWorld.xml Scratch
- For convenience, change current folder to your new Scratch/HelloWorld
sparkl cd Scratch/HelloWorld
- Set a cli variable called
nameto the literal value of your name
sparkl vars -l name Maria
- 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
µ 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