How to deploy ligo contract to Tezos
Assuming folder structure is like
Get the latest CEL-customized ligo
You can get it via Dockerhub
Compile ligo resources into bytecode and initial values
# This ligo command is different from current directory and
# this executable is in /usr/local/bin/ligo
ligo compile-storage main.ligo main "echo $(cat initial_storage)" > storage.tz
ligo compile-contract main.ligo main > ./main.tz
Initial Storage is very initial value of the contract. In solidity, constructor of a contract is doing the same thing.
Storage syntax is a bit tricky. You can find here doc ref
# balances = map
# ("tz1TGu6TN5GSez2ndXXeDX6LgUDvLzPLqgYV": address) -> record
# unlock_level = 1;
# amount = 1mutez;
ligo compile-storage src/test/contracts/level_lock.ligo main "echo $(cat initial_storage)" > storage.tz
ligo compile-contract src/test/contracts/level_lock.ligo main > ./main.tz
Deploy them to Tezos
./scripts/localnet.sh client originate contract ovm_contract for my_identity transferring 2.01 from my_account running container:../ligo/main.tz -init 'cat ../ligo/storage.tz'
# originate contract <new> transferring <qty> from <src> running <prg> --fee <amount>
ovm_contract is arbitrary contract nickname.
Replace my_identity with funded identity
Replace my_account with funded account