Clarity Tutorial Help

#1

So I have gotten through “Hello Clarity Tutorial” using the container as directed.

Now I am going back over things and am puzzled over:

  1. how to save the hello-world.clar so that I can run check and launch it per the “Welcome to Clarity” instructions.
  2. how to access the sqlite db. The db is in the container on my local directory.

Did I miss something?

I am using Ubuntu 18.04 LTS.

Any direction or help would be appreciated.

Sheryl

#2

Are you using -v for the data directory when launching the docker image?

docker run -it -v $HOME/blockstack-dev-data:/data/ blockstack/blockstack-core:clarity-developer-preview bash

You can edit files in your normal environment in ~/blockstack-dev-data . Maybe create a directory contracts next to data and then in the docker image call clarity-cli check /data/contracts/tokens.clar /data/db. Does it make sense?

For sqlite db, you can use it in your normal enviroment like this:
sqlite3 ~/blockstack-dev-data/db

#3

You can see examples of using SQL lite and interacting with the database in this section of the tutorial:

I’ll see about adding an example to /data/ though you can actually simply mount a different directory on the container when you start:

docker run -it -v $HOME/blockstack-clarity-examples:/clarity-examples/ -v $HOME/blockstack-dev-data:/data/ blockstack/blockstack-core:clarity-developer-preview bash

That way the data can be independent from your examples.

1 Like
#4

Thank you. I will look into that.

#5

Sorry this took so long, but I finally got the hello-world.clar to work. I have learned much
in the process and am looking forward to studying this some more.

Thank you to moxiegirl and friedger for your helpful responses.

Sheryl

1 Like
#6

@scalish Great to hear.

Could you please share your experience? What was easy to understand what more difficult?

#7

The thing that hindered me the most was my lack of familiarity with docker. It would have been nice to see a list of prerequisite knowledge or more explanation.

Also, I would have liked to see the setup commands before the hello-world example, since it was presented first.

Just my 2 cents, since you asked.

#8

Docker is not necessarily required. Many people find it more useful as, with the exception of running Docker, the dependencies and the running processes are isolated. If you don’t want to run Docker, you can install the Clarity dependencies and the source yourself. That is documented here:

You may also find it useful to simply start with Clarity, that is here: