Local Installation
This guide configures the recommended vbase-api Python client and runs the first samples.
1. Get a vBase API key
Sign in to the vBase app and copy your API key from Account Settings. The key belongs to your vBase account. Do not create it in GitHub and do not commit it to this repository.
2. Install the samples
git clone https://github.com/validityBase/vbase-py-samples.git
cd vbase-py-samples
python -m venv venv
source venv/bin/activate
python -m pip install -r requirements.txtOn Windows PowerShell, activate the environment with:
.\venv\Scripts\Activate.ps1
python -m pip install -r requirements-win.txt3. Configure the environment
Copy the safe template and add your API key:
cp .env.example .envVBASE_API_KEY="YOUR_VBASE_API_KEY"The samples load .env without replacing values already present in the process environment.
4. Verify the setup
Create or retrieve the sample collection, then stamp and verify a text record:
A successful run prints the collection CID, object CID, owner address, stamp timestamp, and transaction hash.
5. Configure Amazon S3
Only the storage-backed samples need AWS configuration. Set the bucket name in .env:
The samples use boto3’s standard credential and region resolution. A shared profile, AWS IAM Identity Center (SSO), or an IAM role needs no static access keys in .env. When using environment credentials, add:
Use AWS_SESSION_TOKEN only with temporary AWS credentials. The bucket name must not include s3://.
Run a producer first. It prints values for the matching verifier:
Add the printed collection information to .env, then run the verifier:
The verifier requires exactly the expected sample files and matches every file CID to the configured collection and owner. For canonical complete-archive verification, use vBase Verify.
Last updated

