Skip to main content

On-Chain

The Stellar smart contract can be directly used and inspected either using an explorer or via the convenient Stellar CLI. See the contract address.

Typical flow

The first step is to register a project by providing some information. This will notably check that the maintainer doing this action owns a Soroban Domain for the project's name. If that's not the case, it will attempt to register one for a year.

stellar contract invoke \
--source-account G... \
--network testnet \
--id C... \
-- \
register \
--maintainer G... \
--name tansu \
--maintainers '[G...,G...]' \
--url https://github.com/your_project/tansu.toml \
--hash toml_hash \
--domain_contract_id C...

Contract on-chain

Then maintainers can commit changes on-chain as they push new commits.

stellar contract invoke \
--source-account G... \
--network testnet \
--id C... \
-- \
commit \
--maintainer G... \
--project_key ... \
--hash ...

Contract on-chain

transactions

Later on, anyone can fetch on-chain data about a project and verify the last commit hash for themselves.

stellar contract invoke \
--source-account G... \
--network testnet \
--id C... \
-- \
get_commit \
--project_key ...

Events

Registering a project or committing a new hash, sends a contract event off-chain.

Contract events off-chain

These events are ingested by a backend to make them easily consumable off-chain.

Git Hooks

There is a convenient pre-push hook which can be used. This ensures that a commit is only pushed if the hash is sent properly on-chain first.

pre-commit install -t pre-push