How to add a constant to ligolang
is duplicated codebase against Tezos
is equivalent dir in the Tezos codebase
If you've already added an opcode to the Tezos, just replace this dir by it.
This step will be obsoleted when Labnet has been launched
level constrant commit
, add your own reserved name.
is the core part to add a constant. If you typo or miss a charactor here, ligo compiler would fail and say "unbound variable 'level' found".
I experienced that I've changed that line correctly however I've met the unbound variable error.
I changed "now" constant to "nowa" and I could confirmed my change is correctly reflected to docker container
Then I tried "level" constant, it works fine. Feels like cache issue.
How to build
sh ./scripts/distribution/generic/build.sh "debian" "debian" "10"
docker image will be generated
This image is 5GB or some. You need a huge storage space or external storage
External storage setting of docker was somehow tough. Here's
buggy but working instruction
It's embarassing that docker external storage setting is very plausible usecase but not supported.
You'll consume 500MB for each build. So you need good connection.
command reference. This ligo executable is just a bash script and running a docker image
and see your latest build
and point your image's tagname
How to test the constant
ligo compile-expression "level" -s pascaligo
ligo compile-contract "$(cat src/test/contracts/level_lock.ligo)" main
You need to write your own sample contract by using your constant/operation.
How to upload ligo-image to Dockerhub
You need to build an image with your Dockerhub's account's username/reponame tag.
is controlling that. You can comment out existing one and add your own.
So now you can see repository name
and tag name
like thingy in
I created a repo named ligo with account name sgtn
Add yourself as a collaborator
and login in CLI
Then run this
docker push sgtn/ligo:level