Credible Layer CLI Reference
Reference documentation for the Credible Layer command-line interface
Overview
The pcl
(Phylax Credible Layer) is a command-line interface for interacting with the Credible Layer. It allows developers to authenticate, test, and submit assertions to the Credible Layer dApp.
- For installation: Installation Guide
- For getting started: Quick Start Guide
Project Structure
The pcl
command expects the following directory structure:
Commands
auth
Manage authentication with your Credible Layer dApp account.
When logging in:
- A URL and authentication code will be displayed
- Visit the URL in your browser
- Connect your wallet and approve the authentication
- CLI will automatically detect successful authentication
config
Manage your PCL configuration:
Configuration is stored in ~/.pcl/config.toml and includes:
- Authentication token
- Pending assertions for submission
- Project settings
test
Run tests for your assertions.
Note: The pcl test
command is a fork of Forge’s test
command so all functionality is available.
store
Submit Assertion bytecode and source code to the Assertion DA.
Be aware that if your assertion contract has constructor arguments, you need to pass them to the pcl store
command.
Example of an assertion contract that takes the address of the smart contract it protects as a constructor argument:
You can also hardcode the address of the smart contract it protects in the assertion contract, but you lose the flexibility of being able to use the same assertion for different smart contracts.
submit
Submit assertions to the Credible Layer dApp.
If you have provided a constructor argument when storing the assertion, you need to provide it when submitting the assertion.
If no options are provided, the command will prompt interactively to select the project and assertion(s).
Example:
Examples
Complete Authentication Flow
Troubleshooting
Authentication Issues
- Error: Not authenticated: Run
pcl auth login
to authenticate - Error: Authentication expired: Run
pcl auth login
to refresh your authentication - Browser doesn’t open: Manually visit the URL displayed in the terminal
Submission Issues
- Error: Failed to submit: Ensure you’re authenticated and have network connectivity
- Error: Project not found: Create a project in the Credible Layer dApp first
- Error: Assertion not found: Ensure the assertion name is correct and exists in your project
- Make sure to provide constructor arguments when storing the assertion if it has any