Welcome
User Guide
Developer guide
Reference Guide
Frequently Asked Questions
Pricing policy
Data retention policy
Draft: Default Space How to upgrade by payment?
How to re-subscribe to an expired DID Space
Connecting to the DID Space using the Gateway Address
Switch the DID Space bound to NFT Blender.
The automatic backup of Blocklet is stuck, how can it be quickly restored?
Fix CORS error when connecting DID Space
Change log
Draft: Purchase DID Space
DID Spaces v0.6.0: OAuth Integration in DID Spaces
DID Spaces v0.5.83: OAuth integrated DID Space
Prod Spaces data retention policy updated
DID Spaces v0.4.26 released: subscription fully adopts pay-as-you-go & supports paid upgrade Default Space
DID Spaces v0.3.75 released: Supports reading and writing component spaces
DID Spaces v1.0.48: 支持预览 post/bookmark/blog/doc
Same text: SyncFolderPushCommand
This interface synchronizes local folders to a DID Space.
Parameter Types#
Parameter | Kind | Required | Default | Parameter Descriptions |
---|---|---|---|---|
source |
| Y | — | The source folder to be synchronized. Please add a trailing slash /. |
target | string | Y | — | The source folder to synchronize to the destination folder. Please add a trailing slash "/" to folder paths. |
Concurrency | number | N | 256 | Concurrency, defaulting to 256. |
Retry count | number | N | 3 | Number of retries after a synchronization failure. The default is 3. |
debug | boolean | N | false | Output debug information? |
filter | function | N | Synchronizes all files by default, without filtering. | Filter function that excludes specific directories or files |
tmpDir | string | N | — | The directory for temporary file storage. This is optional, but must be set at runtime. |
Preview | Preview Template | N | — | Preview object being written |
Returns#
Field Name | Kind | Required | Parameter Description |
statusCode | number | Y | Status Code |
---|---|---|---|
Status message | string | N | This value is typically only present when an error occurs. |
stack | string | N | Stack Trace |
data.errorCount | number | Y | Number of failed tasks |
data.count | number | Y | Total Tasks |
data.duration | number | Y | Elapsed time (s) |
Example Code#
- Sync a local folder to DID Spaces
const { SpaceClient, SyncFolderPushCommand } = require('@blocklet/did-space-js');
const spaceClient = new SpaceClient({
endpoint,
wallet: getWallet(),
});
const syncFolderPushCommandInput = {
source: 'source-folder/',
target: 'target-folder/',
concurrency: 100,
retryCount: 5,
debug: true,
filter: (object, index, objects) => {...},
tmpDir: 'temp/'
};
const output = await spaceClient.send(new SyncFolderPushCommand(syncFolderPushCommandInput));