First, thank you for considering contributing to Linkora-socials! We welcome contributions to help build out the social primitives, tooling, and ecosystem on Soroban.
This document outlines the development workflow, branching conventions, testing practices, and how to add new contract functions.
To get started with local development, ensure you have the following installed:
- Node.js 18+ (recommended)
- pnpm 9+
- Rust toolchain (latest stable)
- Stellar CLI with Soroban support
- Docker (required for integration tests)
You can install the Stellar CLI using Cargo:
cargo install --locked stellar-cli(Note: Depending on your tooling version, soroban-cli may also be valid).
Clone the repository and install the JavaScript workspace dependencies:
git clone git@github.com:Epta-Node/Linkora-social.git
cd Linkora-social
pnpm installYou can build the Soroban smart contracts from the repository root:
pnpm build:contractsAlternatively, from within the contracts package:
cd packages/contracts
pnpm buildWe maintain two test suites: unit tests and integration tests.
Unit tests are lightweight, do not require a running network, and often use mocked authorization (mock_all_auths()). They cover core contract logic and state changes.
Run from the repository root:
pnpm --filter contracts testOr using Cargo directly:
cd packages/contracts
cargo testIntegration tests run against a local Stellar sandbox and use real transaction signing via the CLI. They ensure end-to-end flows (e.g., cross-contract calls, real auth) work as expected.
Run from the repository root:
pnpm test:integrationFor more details on sandbox setup, see the Integration Tests README.
When adding a new feature or function to the Linkora contracts, follow these guidelines:
- Focus: Ensure the function has a single, clear purpose and falls within the scope of the project.
- Access Control: Carefully consider who should be able to call the function and implement the necessary
require_auth()checks. - Tests: Every new contract function must be covered by unit tests. If the function introduces a major flow, consider adding or updating an integration test.
- Events: New state-changing functions should emit appropriate events to facilitate indexing. Review our event design strategy in EVENTS.md.
- Documentation: Add a Rust docstring explaining the inputs, outputs, and authorization rules. Update the API Reference table in the root
README.md.
We use a standard GitHub flow. Please follow these branching and PR conventions:
- Create a branch from
mainusing a descriptive name (e.g.,feat/add-xyz,fix/bug-name,docs/update-readme). - Keep changes focused and prefer small pull requests.
- Make sure all tests pass locally before opening the PR.
- Fill out the Pull Request Template completely.
The contract crate version in packages/contracts/contracts/linkora-contracts/Cargo.toml must stay in sync with CHANGELOG.md.
- Patch bump (
x.y.Z): internal fixes that do not change contract interface or behavior expected by integrators. - Minor bump (
x.Y.z): backward-compatible additions such as new read functions or optional flows. - Major bump (
X.y.z): breaking changes to function signatures, auth model, storage assumptions, or event contracts.
When a PR changes contract behavior, include a changelog entry and update the crate version in the same PR.
Before submitting or requesting a review, verify the following (as found in our PR template):
- Tests added or updated for changed behavior
- Existing tests pass (
cargo testandpnpm test:integration) - Changes are focused — one concern per PR
- If a contract function was added or changed, the README API table is updated
- No unresolved merge conflicts
The main branch is protected. The following rules are enforced:
- CI must pass: All pull requests must pass the
CI / Unit Testsworkflow before they can be merged. This gate exists because unreviewed merges have previously introduced duplicate imports and broken function bodies intomain. - Review required: At least one approving review from a repository collaborator is required before merge.
- No direct pushes: Direct pushes to
mainare restricted to repository administrators. All changes must go through a pull request. - No force-pushes: Force-pushing to
mainis disabled to preserve commit history.
These rules are enforced at the repository level and cannot be bypassed by contributors. If CI fails on your PR, investigate and fix the root cause rather than asking for a merge exemption.
The CI / Unit Tests job runs cargo test inside packages/contracts. Your PR will be blocked if:
- Any unit test panics or returns an unexpected result.
- The code does not compile (including
wasm32v1-nonetarget).
The integration test suite (integration.yml) runs on a nightly schedule and on manual dispatch; it is not a required check for PRs but failures there should still be investigated promptly.