Skip to content

Commit

Permalink
Merge pull request #5083 from kdembler/nara-master
Browse files Browse the repository at this point in the history
Update `nara` from `master`
  • Loading branch information
zeeshanakram3 authored Feb 22, 2024
2 parents 1c6b7f8 + efdd54b commit 04af90e
Show file tree
Hide file tree
Showing 33 changed files with 555 additions and 147 deletions.
42 changes: 23 additions & 19 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ $ npm install -g @joystream/cli
$ joystream-cli COMMAND
running command...
$ joystream-cli (-v|--version|version)
@joystream/cli/1.2.0 darwin-x64 node-v14.16.1
@joystream/cli/1.4.0 darwin-arm64 node-v18.6.0
$ joystream-cli --help [COMMAND]
USAGE
$ joystream-cli COMMAND
Expand Down Expand Up @@ -197,7 +197,7 @@ When using the CLI for the first time there are a few common steps you might wan
- [`joystream-cli working-groups:updateRewardAccount [ADDRESS]`](#joystream-cli-working-groupsupdaterewardaccount-address)
- [`joystream-cli working-groups:updateRoleAccount [ADDRESS]`](#joystream-cli-working-groupsupdateroleaccount-address)
- [`joystream-cli working-groups:updateWorkerReward WORKERID NEWREWARD`](#joystream-cli-working-groupsupdateworkerreward-workerid-newreward)
- [`joystream-cli working-groups:verifyValidator --group=membership MEMBERID`](#joystream-cli-working-groupsverifyvalidator---groupmembership-memberid)
- [`joystream-cli working-groups:verifyValidator MEMBERID`](#joystream-cli-working-groupsverifyvalidator-memberid)

## `joystream-cli account:create`

Expand Down Expand Up @@ -2127,10 +2127,11 @@ OPTIONS
ment|DeleteComment|PinOrUnpinComment|ModerateComment|BanOrUnbanMemberFromChannel|VideoReactionsPreference|CreateVideoC
ategory|MakeChannelPayment|AppMetadata|CreateApp|UpdateApp|MemberRemarked|ChannelModeratorRemarked|ChannelOwnerRemarke
d|PersonMetadata|ProposalsDiscussionPostMetadata|SeriesMetadata|SeasonMetadata|GeoCoordiantes|NodeLocationMetadata|Sto
rageBucketOperatorMetadata|DistributionBucketOperatorMetadata|GeographicalArea|DistributionBucketFamilyMetadata|Publis
hedBeforeJoystream|License|MediaType|SubtitleMetadata|VideoMetadata|ContentMetadata|OpeningMetadata|UpcomingOpeningMet
adata|ApplicationMetadata|WorkingGroupMetadata|SetGroupMetadata|AddUpcomingOpening|RemoveUpcomingOpening|WorkingGroupM
etadataAction|ModeratePost|RemarkMetadataAction)
rageBucketOperatorMetadata|DistributionBucketOperatorMetadata|GeographicalArea|DistributionBucketFamilyMetadata|Creato
rTokenIssuerRemarked|UpdateTokenMetadata|TokenMetadata|Benefit|SaleMetadata|PublishedBeforeJoystream|License|MediaType
|SubtitleMetadata|VideoMetadata|ContentMetadata|OpeningMetadata|UpcomingOpeningMetadata|ApplicationMetadata|WorkingGro
upMetadata|SetGroupMetadata|AddUpcomingOpening|RemoveUpcomingOpening|WorkingGroupMetadataAction|ModeratePost|RemarkMet
adataAction|VerifyValidator)
Type of the message
```

Expand All @@ -2156,10 +2157,11 @@ OPTIONS
ment|DeleteComment|PinOrUnpinComment|ModerateComment|BanOrUnbanMemberFromChannel|VideoReactionsPreference|CreateVideoC
ategory|MakeChannelPayment|AppMetadata|CreateApp|UpdateApp|MemberRemarked|ChannelModeratorRemarked|ChannelOwnerRemarke
d|PersonMetadata|ProposalsDiscussionPostMetadata|SeriesMetadata|SeasonMetadata|GeoCoordiantes|NodeLocationMetadata|Sto
rageBucketOperatorMetadata|DistributionBucketOperatorMetadata|GeographicalArea|DistributionBucketFamilyMetadata|Publis
hedBeforeJoystream|License|MediaType|SubtitleMetadata|VideoMetadata|ContentMetadata|OpeningMetadata|UpcomingOpeningMet
adata|ApplicationMetadata|WorkingGroupMetadata|SetGroupMetadata|AddUpcomingOpening|RemoveUpcomingOpening|WorkingGroupM
etadataAction|ModeratePost|RemarkMetadataAction)
rageBucketOperatorMetadata|DistributionBucketOperatorMetadata|GeographicalArea|DistributionBucketFamilyMetadata|Creato
rTokenIssuerRemarked|UpdateTokenMetadata|TokenMetadata|Benefit|SaleMetadata|PublishedBeforeJoystream|License|MediaType
|SubtitleMetadata|VideoMetadata|ContentMetadata|OpeningMetadata|UpcomingOpeningMetadata|ApplicationMetadata|WorkingGro
upMetadata|SetGroupMetadata|AddUpcomingOpening|RemoveUpcomingOpening|WorkingGroupMetadataAction|ModeratePost|RemarkMet
adataAction|VerifyValidator)
Type of the message
```

Expand All @@ -2179,10 +2181,11 @@ OPTIONS
ment|DeleteComment|PinOrUnpinComment|ModerateComment|BanOrUnbanMemberFromChannel|VideoReactionsPreference|CreateVideoC
ategory|MakeChannelPayment|AppMetadata|CreateApp|UpdateApp|MemberRemarked|ChannelModeratorRemarked|ChannelOwnerRemarke
d|PersonMetadata|ProposalsDiscussionPostMetadata|SeriesMetadata|SeasonMetadata|GeoCoordiantes|NodeLocationMetadata|Sto
rageBucketOperatorMetadata|DistributionBucketOperatorMetadata|GeographicalArea|DistributionBucketFamilyMetadata|Publis
hedBeforeJoystream|License|MediaType|SubtitleMetadata|VideoMetadata|ContentMetadata|OpeningMetadata|UpcomingOpeningMet
adata|ApplicationMetadata|WorkingGroupMetadata|SetGroupMetadata|AddUpcomingOpening|RemoveUpcomingOpening|WorkingGroupM
etadataAction|ModeratePost|RemarkMetadataAction)
rageBucketOperatorMetadata|DistributionBucketOperatorMetadata|GeographicalArea|DistributionBucketFamilyMetadata|Creato
rTokenIssuerRemarked|UpdateTokenMetadata|TokenMetadata|Benefit|SaleMetadata|PublishedBeforeJoystream|License|MediaType
|SubtitleMetadata|VideoMetadata|ContentMetadata|OpeningMetadata|UpcomingOpeningMetadata|ApplicationMetadata|WorkingGro
upMetadata|SetGroupMetadata|AddUpcomingOpening|RemoveUpcomingOpening|WorkingGroupMetadataAction|ModeratePost|RemarkMet
adataAction|VerifyValidator)
Type of the message
```

Expand Down Expand Up @@ -2723,21 +2726,22 @@ OPTIONS

_See code: [src/commands/working-groups/updateWorkerReward.ts](https://github.com/Joystream/joystream/blob/master/cli/src/commands/working-groups/updateWorkerReward.ts)_

## `joystream-cli working-groups:verifyValidator --group=membership MEMBERID`
## `joystream-cli working-groups:verifyValidator MEMBERID`

Verify or un-verify the membership profile bound to a validator account. Available to membership workers only.

```
USAGE
$ joystream-cli working-groups:verifyValidator --group=membership MEMBERID
$ joystream-cli working-groups:verifyValidator MEMBERID
ARGUMENTS
MEMBERID ID of the membership bound to the validator account.
MEMBERID ID of the membership bound to the validator account.
OPTIONS
-g, --group=membership
-g, --group=(storageProviders|curators|forum|membership|app|builders|humanResources|marketing|distributors)
The working group context in which the command should be executed
membership is the only valid value for this command.
Available values are: storageProviders, curators, forum, membership, app, builders, humanResources, marketing,
distributors.
--unverify
Whether the profile should be un-verified.
Expand Down
4 changes: 2 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@joystream/cli",
"description": "Command Line Interface for Joystream community and governance activities",
"version": "1.2.3",
"version": "1.4.0",
"author": "Leszek Wiesner",
"bin": {
"joystream-cli": "./bin/run"
Expand Down Expand Up @@ -56,7 +56,7 @@
"proper-lockfile": "^4.1.1",
"slug": "^2.1.1",
"tslib": "^1.11.1",
"@joystream/js": "^1.6.3"
"@joystream/js": "^1.8.0"
},
"devDependencies": {
"@graphql-codegen/cli": "^1.21.4",
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/working-groups/verifyValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class VerifyValidatorCommand extends WorkingGroupsCommandBase {

async run(): Promise<void> {
const worker = await this.getRequiredWorkerContext()
if (!worker || this.group === WorkingGroups.Membership) {
if (!worker || this.group !== WorkingGroups.Membership) {
return this.error('Only membership workers can perform this command')
}

Expand Down
7 changes: 4 additions & 3 deletions cli/src/schemas/ContentDirectory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {
import {
ChannelCreationInputParameters,
ChannelUpdateInputParameters,
VideoInputParameters,
VideoCategoryInputParameters,
ContentModerationActionNullEnum,
JsonSchema,
ModerationPermissionsByLevelInputParameters,
PropertySchema,
ContentModerationActionNullEnum,
VideoCategoryInputParameters,
VideoInputParameters,
} from '../Types'

export const VideoCategoryInputSchema: JsonSchema<VideoCategoryInputParameters> = {
Expand Down Expand Up @@ -118,6 +118,7 @@ export const VideoInputSchema: JsonSchema<VideoInputParameters> = {
hasMarketing: { type: 'boolean' },
isExplicit: { type: 'boolean' },
isPublic: { type: 'boolean' },
isShort: { type: 'boolean' },
language: { type: 'string' },
license: {
type: 'object',
Expand Down
6 changes: 6 additions & 0 deletions distributor-node/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ export interface StatusResponseQueryNodeStatus {
* @memberof StatusResponseQueryNodeStatus
*/
'blocksProcessed': number;
/**
*
* @type {string}
* @memberof StatusResponseQueryNodeStatus
*/
'packageVersion': string;
}

/**
Expand Down
7 changes: 5 additions & 2 deletions distributor-node/docs/api/public/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ Returns json object describing current node status.
"queryNodeStatus": {
"url": "string",
"chainHead": 0,
"blocksProcessed": 0
"blocksProcessed": 0,
"packageVersion": "string"
}
}
```
Expand Down Expand Up @@ -345,7 +346,8 @@ This operation does not require authentication
"queryNodeStatus": {
"url": "string",
"chainHead": 0,
"blocksProcessed": 0
"blocksProcessed": 0,
"packageVersion": "string"
}
}

Expand All @@ -368,6 +370,7 @@ This operation does not require authentication
|» url|string|true|none|none|
|» chainHead|integer|true|none|none|
|» blocksProcessed|integer|true|none|none|
|» packageVersion|string|true|none|none|

<h2 id="tocS_BucketsResponse">BucketsResponse</h2>

Expand Down
3 changes: 3 additions & 0 deletions distributor-node/src/api-spec/public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ components:
- 'url'
- 'chainHead'
- 'blocksProcessed'
- 'packageVersion'
properties:
url:
type: string
Expand All @@ -207,6 +208,8 @@ components:
blocksProcessed:
type: integer
minimum: 0
packageVersion:
type: string
BucketsResponse:
oneOf:
- type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { parseAxiosError } from '../parsers/errors'
import { PendingDownload, PendingDownloadStatusType } from './PendingDownload'
import Mime from 'mime/lite'
import { RuntimeApi } from './runtime/api'
import _ from 'lodash'

// Concurrency limits
export const MAX_CONCURRENT_AVAILABILITY_CHECKS_PER_OBJECT = 10
Expand Down Expand Up @@ -445,7 +446,9 @@ export class NetworkingService {
}

async getQueryNodeStatus(): Promise<StatusResponse['queryNodeStatus']> {
const squidStatus = await this.queryNodeApi.getQueryNodeState()
const memoizedGetPackageVersion = _.memoize(this.queryNodeApi.getPackageVersion.bind(this.queryNodeApi))
const squidVersion = await memoizedGetPackageVersion()
const squidStatus = await this.queryNodeApi.getState()

if (squidStatus === null) {
this.logger.error("Couldn't fetch the state from connected storage-squid")
Expand All @@ -455,6 +458,7 @@ export class NetworkingService {
url: this.config.endpoints.storageSquid,
chainHead: (await this.runtimeApi.derive.chain.bestNumber()).toNumber() || 0,
blocksProcessed: squidStatus?.height || 0,
packageVersion: squidVersion,
}
}
}
14 changes: 13 additions & 1 deletion distributor-node/src/services/networking/query-node/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import {
GetDistributionBucketsWithBagsByWorkerId,
GetDistributionBucketsWithBagsByWorkerIdQuery,
GetDistributionBucketsWithBagsByWorkerIdQueryVariables,
GetSquidVersion,
GetSquidVersionQuery,
GetSquidVersionQueryVariables,
MinimalDataObjectFragment,
SquidStatus,
SquidStatusFieldsFragment,
Expand Down Expand Up @@ -236,7 +239,16 @@ export class QueryNodeApi {
>(GetActiveStorageBucketOperatorsData, {}, 'storageBuckets')
}

public async getQueryNodeState(): Promise<SquidStatusFieldsFragment | null> {
public async getPackageVersion(): Promise<string> {
const squidVersion = await this.uniqueEntityQuery<GetSquidVersionQuery, GetSquidVersionQueryVariables>(
GetSquidVersion,
{},
'squidVersion'
)
return squidVersion?.version || ''
}

public async getState(): Promise<SquidStatusFieldsFragment | null> {
const squidStatus = await this.uniqueEntityQuery<SquidStatusQuery, SquidStatusQueryVariables>(
SquidStatus,
{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,22 @@ query getActiveStorageBucketOperatorsData {
}
}

fragment SquidVersionFields on SquidVersion {
version
}

query getSquidVersion {
squidVersion {
...SquidVersionFields
}
}

fragment SquidStatusFields on SquidStatus {
height
}

query squidStatus {
squidStatus {
height
...SquidStatusFields
}
}
4 changes: 4 additions & 0 deletions joystreamjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.7.0

- Update dependency on metadata protobuf to v2.13.0

### 1.6.0

- rework `util/readBytesFromFile` to support use in browser [#4584](https://github.com/Joystream/joystream/pull/4584)
Expand Down
4 changes: 2 additions & 2 deletions joystreamjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@joystream/js",
"version": "1.7.0",
"version": "1.9.0",
"license": "GPL-3.0-only",
"description": "Joystream JS package provides utilities required to work with Joystream network.",
"main": "lib/index.js",
Expand Down Expand Up @@ -41,7 +41,7 @@
"generate:all": "yarn generate:schema-typings"
},
"dependencies": {
"@joystream/metadata-protobuf": "^2.12.0",
"@joystream/metadata-protobuf": "^2.13.0",
"@joystream/types": "^4.0.0",
"@polkadot/util-crypto": "9.5.1",
"axios": "^1.2.1",
Expand Down
Loading

0 comments on commit 04af90e

Please sign in to comment.