Adding Allocation Functionalities
Describing Code
Line 1 to 219 defines the following allocation functionalities for the web app :
initClick:Initialize SDK functionality on click.js-sdk init function is called. Here await keyword tells that the async function stops the execution until the config data is fetched.listAllocationsClick: List Allocations on mouse click . Retrieved via js-sdk listAllocations function.createAllocationClick :Create allocation on click.Allocation is created via js-sdk createAllocation function.Hereawait keyword tells that the async create allocation function to stop the execution until the allocation config is provided .configconstant provides configuration for the allocation.createAllocationWithBlobbersClick: Create allocation on a specific set /preferred blobbers.The blobber list is fetched viagetBlobberListforAllocationfunction .Js-sdkcreateAllocationWithBlobbersmethod is called.getAllocationDetailsClick :Get Allocation details in web app by callinglistAllocationsClickfunction defined above.reloadAllocationClick: Reloads the allocation in web app by calling js-sdkreloadAllocationmethod.freezeAllocationClick: Freeze Allocation on click in web app by calling js-sdkfreezeAllocationmethod.Await execution until allocation id is provided.cancelAllocationClick:Cancel Allocation on click .Functionality provided by js-sdkcancelAllocationfunction.updateAllocationClick: Update Allocation configuration.Functionality provided by js-sdk updateAllocation method .Execution ofupdateAllocationmethod is awaited until updated allocation config is provided in term of allocation expiry or size.getBlobberListForAllocation: Get list of blobbers available to host allocation.Calls js-sdk getAllocationBlobbers method.getAllocationBlobbersClick :Get Blobbers for Allocation .awaits execution of getBlobberListForAllocation function specified above.getBlobberIdsClick :Get blobber ID's on click.Calls js-sdk getBlobberIds method .getAllocationFromAuthTicketClick :Get Allocation with AuthTicket.Calls js-sdk getAllocationFromAuthTicket .createReadPoolClick :Create Read Pool for Storage SC. Calls js-sdk createReadPool methodgetReadPoolInfoClick:Get Read pool information.Calls js-sdk getReadPoolInfo method.lockWritePoolClick:Lock Tokens into Write Pool. Calls js-sdk lockWritePool method.getBlobbersClick:Get Blobbers for honoring allocation. Calls js-sdk getBlobbers method.decodeAuthTicket:A function for decoding AuthTicket generated by file share. Calls js-sdk decodeAuthTicket method.greetClick:A function for displaying a greeting message.selectAllocation:A helper function for setting allocation.selectFile:A helper function for selecting file for operations.showLogs:Show logs for web app functionalities.Calls js-sdk showLogs method.hideLogs:Hide logs for web app functionalities. Calls js-sdk hideLogs method
Last updated