Skip to content

Commit

Permalink
chore(sdk) [NET-1394]: add new storage node cluster address (#3020)
Browse files Browse the repository at this point in the history
## Summary

- Add new storage node cluster address constant
`STREAMR_STORAGE_NODE_ADDRESS`
- Deprecate existing constant `STREAMR_STORAGE_NODE_GERMANY` 
- Adjust docs to reflect this change
  • Loading branch information
harbu authored Feb 25, 2025
1 parent eab2200 commit 88b8141
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ Changes before Tatum release are not documented in this file.

#### Added

- Add new storage node address `STREAMR_STORAGE_NODE_ADDRESS` (https://github.com/streamr-dev/network/pull/3020)

#### Changed

#### Deprecated

- Deprecate storage node address `STREAMR_STORAGE_NODE_GERMANY` (https://github.com/streamr-dev/network/pull/3020)

#### Removed

#### Fixed
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/usage/streams/store-and-retrieve.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ To retrieve data from storage, a key exchange between the publisher and subscrib
```ts
const {
StreamrClient,
STREAMR_STORAGE_NODE_GERMANY,
STREAMR_STORAGE_NODE_ADDRESS,
} = require('@streamr/sdk');

// assign a stream to a storage node
await stream.addToStorageNode(STREAMR_STORAGE_NODE_GERMANY);
await stream.addToStorageNode(STREAMR_STORAGE_NODE_ADDRESS);
```

Other operations with storage:

```ts
// remove the stream from a storage node
await stream.removeFromStorageNode(STREAMR_STORAGE_NODE_GERMANY);
await stream.removeFromStorageNode(STREAMR_STORAGE_NODE_ADDRESS);

// fetch the storage nodes for a stream
const storageNodes = stream.getStorageNodes();
Expand Down
5 changes: 5 additions & 0 deletions packages/sdk/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,13 @@ export type StrictStreamrClientConfig = MarkOptional<Required<StreamrClientConfi
_timeouts: Exclude<DeepRequired<StreamrClientConfig['_timeouts']>, undefined>
}

/**
* @deprecated use {@link STREAMR_STORAGE_NODE_ADDRESS} instead
*/
export const STREAMR_STORAGE_NODE_GERMANY = '0x31546eEA76F2B2b3C5cC06B1c93601dc35c9D916'

export const STREAMR_STORAGE_NODE_ADDRESS = '0x9dc08ff97f5c156181ec6a0b13fc3946454e529a' as HexString

export const createStrictConfig = (input: StreamrClientConfig = {}): StrictStreamrClientConfig => {
// TODO is it good to cloneDeep the input object as it may have object references (e.g. auth.ethereum)?
let config = cloneDeep(input)
Expand Down
1 change: 1 addition & 0 deletions packages/sdk/src/exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export {
ProviderAuthConfig,
PrivateKeyAuthConfig,
STREAMR_STORAGE_NODE_GERMANY,
STREAMR_STORAGE_NODE_ADDRESS,
NetworkConfig,
ControlLayerConfig,
NetworkNodeConfig,
Expand Down

0 comments on commit 88b8141

Please sign in to comment.