A rewardable DCDN node on the Ara Network
Kind: global class
Emits: info
, warn
, peer-update
, download-progress
, download-complete
, request-complete
Constructs a new dcdn instance
Param | Type | Description |
---|---|---|
opts.userId | String |
The user's did |
opts.password | String |
The user's password |
[opts.queue] | Object |
The transaction queue |
Start running the DCDN node in the latest configuration
Kind: instance method of DCDN
Access: public
Stop running the DCDN node
Kind: instance method of DCDN
Access: public
Joins a hyperswarm for a given AFS and replicates for a reward. Adds the options to the node's configuration. Note: this will also start the node and load the previous configuration.
Kind: instance method of DCDN
Access: public
Param | Type | Description |
---|---|---|
opts.did | String |
The did of the AFS |
opts.upload | boolean |
Whether to seed the AFS |
opts.download | boolean |
Whether to download the AFS |
[opts.metaOnly] | boolean |
Whether to only replicate the metadata |
[opts.price] | string |
Price in Ara to distribute AFS |
[opts.maxPeers] | int |
The maximum peers for the AFS |
[opts.jobId] | String |
A job id for the AFS |
Leaves a hyperswarm for a given AFS and removes its options from the node's configuration
Kind: instance method of DCDN
Access: public
Param | Type | Description |
---|---|---|
opts.did | String |
The did of the AFS |
Informational event
Kind: event emitted by DCDN
Param | Type | Description |
---|---|---|
message | string |
Helpful information about the state of the DCDN Node |
Warning event
Kind: event emitted by DCDN
Param | Type | Description |
---|---|---|
message | string |
Warning information about the state of the DCDN Node |
Emitted when the download is complete and the data is ready
Kind: event emitted by DCDN
Param | Type | Description |
---|---|---|
did | string |
The did of the downloaded AFS |
Emitted when the peers have been rewarded and the job is complete
Kind: event emitted by DCDN
Param | Type | Description |
---|---|---|
did | string |
The did of the downloaded AFS |
Emitted when a new data block has been downloaded
Kind: event emitted by DCDN
Param | Type | Description |
---|---|---|
did | string |
The did of the AFS |
downloaded | int |
The current number of downloaded blocks |
total | int |
The total number of blocks |
Emitted when a peer has been added or removed from an AFS
Kind: event emitted by DCDN
Param | Type | Description |
---|---|---|
did | string |
The did of the AFS |
count | int |
The current number of peers |