Blockchain Drive includes an admin panel that lets privileged users view all accounts, control what each user can do, and allocate on-chain storage quotas. Admin access is role-based: the backend checks whether the logged-in user holds theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ankit-bista/Final-Project/llms.txt
Use this file to discover all available pages before exploring further.
admin role before executing any admin operation. This guide explains how admin access is granted and how to use each admin feature.
Admin access
The wallet address stored inMAIN_ADMIN_WALLET is granted the admin role automatically the first time that wallet logs in. No manual database entry is required. All other users start as commenter by default.
Only one wallet address is bootstrapped via
MAIN_ADMIN_WALLET. Additional admin accounts must be promoted manually by an existing admin using the role assignment feature described below.401 Not authenticated and non-admin sessions receive 403 Admin access required.
User management
The admin panel gives you a full view of every registered account, including each user’s current storage consumption. Fetching all users callsGET /api/admin/users. The response is a list of user objects, each including the fields returned by the database plus a computed storage_used field (in bytes) derived from the files that user has uploaded.
Use this view to identify users who are approaching their quota, to audit who has which role, or to find accounts to promote or remove.
Roles
Blockchain Drive defines three user roles with distinct capability sets.commenter
Can read files and add comments. Cannot upload files or manage other users. This is the default role for new accounts.
uploader
Can upload files and add comments. Cannot manage other users or bypass quota limits.
admin
Full access: upload files, add comments, manage users, and bypass quota restrictions. Required for all admin panel actions.
The
viewer role is not currently defined in the codebase. Any unrecognised role string is normalised to commenter by the backend.Assigning a role
To change a user’s role, submit aPOST /api/admin/users/:id/access request with the user’s database ID in the path and the desired role in the request body:
quotaBytes field is optional when you only want to change the role, and role is optional when you only want to change the quota. Both fields can be set in the same request. The backend normalises the role value to lowercase and falls back to commenter for any unrecognised string.
Quota allocation
Storage quotas are enforced in two layers: the database records aquota_bytes value per user, and the smart contracts track on-chain allocations. When ENFORCE_QUOTA_ON_UPLOAD=true, a user cannot upload a file if doing so would exceed their on-chain quota.
Allocating quota through the admin panel involves two sequential on-chain transactions:
Allocate a storage pool
Before assigning quota to individual users, a named storage pool must exist on-chain. Call This invokes
POST /api/admin/pool/allocate to create one:allocatePool on the STORAGE_ALLOC_CONTRACT. The bytesAmount is the total capacity of the pool in bytes.Deleting a user
Admins can permanently remove a user account and all associated data. In the admin panel, locate the user and confirm the delete action. This callsDELETE /api/admin/users/:id with the user’s database ID.
If the user ID does not exist, the endpoint returns 404 User not found. On success it returns: