Types
Object
dataclass
Distributed/Stored media representation. This class is used to represent any media decentralized and already stored in IPFS.
Usage:
# generally, these objects are returned by storage operations
stored_object = Object("bafyjvzacdjrk37kqvy5hbqepmcraz3txt3igs7dbjwwhlfm3433a","image",250)
Source code in nucleus/sdk/storage/types.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Pin
dataclass
Represents ipfs pin output
Usage:
# generally, returned by pinning operations
pin = Pin("bafyjvzacdjrk37kqvy5hbqepmcraz3txt3igs7dbjwwhlfm3433a","pinned", "image.jpg")
Source code in nucleus/sdk/storage/types.py
23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
Client
Bases: Protocol
Provides an standard interface for handling IPFS storage services. Each storage service represents a remote cache service, such as Estuary.
Source code in nucleus/sdk/storage/types.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
pin(obj)
Pin cid to storage service
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj |
Object
|
Object to pin |
required |
Returns:
Type | Description |
---|---|
Pin
|
Pin object |
Source code in nucleus/sdk/storage/types.py
50 51 52 53 54 55 56 |
|
unpin(cid)
Remove pin from storage service
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cid |
CID
|
The cid to remove from service |
required |
Returns:
Type | Description |
---|---|
CID
|
The just removed object cid |
Source code in nucleus/sdk/storage/types.py
58 59 60 61 62 63 64 |
|