π Deploy Soroban KYC/KYB Contract to Testnet π οΈ
π Description
Deploy the Soroban smart contract designed for KYC/KYB data to the Stellar testnet. This deployment will enable the Stellar wallet service to interact with the contract for storing and verifying KYC/KYB data on the blockchain. The deployment process will use the Soroban client and a funded Stellar account to ensure successful contract deployment.
π― Objective
Create a module in services/stellar-wallet/src/soroban/deploy.js to deploy the KYC/KYB contract to the testnet and add a unit test to verify the deployment process.
π Structure
- Directory:
services/stellar-wallet
- Files:
src/soroban/deploy.js
tests/soroban/deploy.test.js
- Expected structure:
services/stellar-wallet
βββ src
β βββ index.js
β βββ stellar
β β βββ client.js
β β βββ keys.js
β β βββ fund.js
β βββ db
β β βββ kyc.js
β βββ routes
β β βββ kyc.js
β βββ kyc
β β βββ validate.js
β βββ soroban
β βββ client.js
β βββ kyc-contract.rs
β βββ deploy.js
βββ config
β βββ db.sqlite
βββ tests
β βββ stellar
β β βββ client.test.js
β β βββ keys.test.js
β β βββ fund.test.js
β βββ db
β β βββ kyc.test.js
β βββ routes
β β βββ kyc.test.js
β βββ kyc
β β βββ validate.test.js
β βββ soroban
β βββ client.test.js
β βββ deploy.test.js
βββ package.json
βββ .env.example
βββ .eslintrc.json
βββ .eslintignore
βββ .prettierrc.json
βββ .prettierignore
βββ .gitignore
β
Requirements
- Create a branch named
feat/deploy-soroban-contract for this task.
- Create
src/soroban/deploy.js with a function deployKycContract that:
- Uses the Soroban client (from Issue 11) to connect to the testnet RPC server.
- Loads the compiled contract from
src/soroban/kyc-contract.rs.
- Deploys the contract to the Stellar testnet using a funded Stellar account (funded via Friendbot).
- Implement a function
getContractId to retrieve the deployed contractβs ID.
- Use environment variables (e.g.,
DEPLOYER_SECRET_KEY) for the deployer accountβs private key.
- Handle errors (e.g., invalid account, deployment failure) with appropriate error messages.
- Create a unit test in
tests/soroban/deploy.test.js to verify that deployKycContract deploys the contract and getContractId returns a valid contract ID.
- Mock the Soroban client and network interactions in the unit test to avoid network dependencies.
- Ensure the code adheres to ESLint and Prettier rules.
- Commit changes to the
feat/deploy-soroban-contract branch with a message like feat: deploy soroban contract.
- Verify that the CI pipeline passes, with linting and test jobs succeeding.
π Expected Outcomes
src/soroban/deploy.js contains deployKycContract and getContractId functions.
- The
deployKycContract function successfully deploys the KYC contract to the testnet.
- The
getContractId function returns the deployed contractβs ID.
- Unit test in
tests/soroban/deploy.test.js verifies deployment and contract ID retrieval with mocked responses.
- Code passes ESLint and Prettier checks.
- Changes are committed to the
feat/deploy-soroban-contract branch with a descriptive lowercase commit message.
- CI pipeline runs successfully, with linting passing for
src/soroban/deploy.js and tests/soroban/deploy.test.js, and the unit test passing.
π References
π Notes
- The deployer account must be funded using Friendbot before deployment.
- The
DEPLOYER_SECRET_KEY environment variable should be added to .env.example as a placeholder.
- Mocking the Soroban client in tests ensures reliable CI execution without network dependencies.
- The contract ID should be stored or logged for use in subsequent issues.
- Commit messages must be in lowercase and start with
feat, change, fix, chore, or refactor.
- The CI pipeline should validate the new code, ensuring ESLint passes and the unit test executes successfully.
π Deploy Soroban KYC/KYB Contract to Testnet π οΈ
π Description
Deploy the Soroban smart contract designed for KYC/KYB data to the Stellar testnet. This deployment will enable the Stellar wallet service to interact with the contract for storing and verifying KYC/KYB data on the blockchain. The deployment process will use the Soroban client and a funded Stellar account to ensure successful contract deployment.
π― Objective
Create a module in
services/stellar-wallet/src/soroban/deploy.jsto deploy the KYC/KYB contract to the testnet and add a unit test to verify the deployment process.π Structure
services/stellar-walletsrc/soroban/deploy.jstests/soroban/deploy.test.jsβ Requirements
feat/deploy-soroban-contractfor this task.src/soroban/deploy.jswith a functiondeployKycContractthat:src/soroban/kyc-contract.rs.getContractIdto retrieve the deployed contractβs ID.DEPLOYER_SECRET_KEY) for the deployer accountβs private key.tests/soroban/deploy.test.jsto verify thatdeployKycContractdeploys the contract andgetContractIdreturns a valid contract ID.feat/deploy-soroban-contractbranch with a message likefeat: deploy soroban contract.π Expected Outcomes
src/soroban/deploy.jscontainsdeployKycContractandgetContractIdfunctions.deployKycContractfunction successfully deploys the KYC contract to the testnet.getContractIdfunction returns the deployed contractβs ID.tests/soroban/deploy.test.jsverifies deployment and contract ID retrieval with mocked responses.feat/deploy-soroban-contractbranch with a descriptive lowercase commit message.src/soroban/deploy.jsandtests/soroban/deploy.test.js, and the unit test passing.π References
π Notes
DEPLOYER_SECRET_KEYenvironment variable should be added to.env.exampleas a placeholder.feat,change,fix,chore, orrefactor.