Skip to content

Commit

Permalink
Merge branch 'nara' into luxor/reduce-council-budget
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignazio Bovo committed Feb 23, 2024
2 parents cce2f27 + 04af90e commit 3c79cf4
Show file tree
Hide file tree
Showing 98 changed files with 5,317 additions and 66,756 deletions.
30 changes: 24 additions & 6 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ TYPEORM_LOGGING=error
BLOCK_HEIGHT=0

# Query node GraphQL server port
# Remember to change it in COLOSSUS_QUERY_NODE_URL and DISTRIBUTOR_QUERY_NODE_URL as well
GRAPHQL_SERVER_PORT=8081
PROCESSOR_STATE_APP_PORT=8082
PROCESSOR_HOST=processor
Expand All @@ -48,11 +47,11 @@ GRAPHQL_SERVER_HOST=localhost
# Websocket RPC endpoint containers will use.
JOYSTREAM_NODE_WS=ws://joystream-node:9944/

# Query node which colossus will use
COLOSSUS_QUERY_NODE_URL=http://graphql-server:8081/graphql
# Storage Squid (graphql-server) which colossus will use
COLOSSUS_STORAGE_SQUID_URL=http://squid-graphql-server:4352/graphql

# Query node which distributor will use
DISTRIBUTOR_QUERY_NODE_URL=http://graphql-server:8081/graphql
# Storage Squid (graphql-server) which distributor will use
DISTRIBUTOR_STORAGE_SQUID_URL=http://squid-graphql-server:4352/graphql

# Indexer gateway used by processor. If you don't use the local indexer set this to a remote gateway
PROCESSOR_INDEXER_GATEWAY=http://hydra-indexer-gateway:4000/graphql
Expand Down Expand Up @@ -154,7 +153,7 @@ [email protected]
SQD_DEBUG=api:*
OPENAPI_PLAYGROUND=true

ARCHIVE_GATEWAY_URL=${CUSTOM_ARCHIVE_GATEWAY_URL:-http://squid-archive-gateway:8000/graphql}
ORION_ARCHIVE_GATEWAY_URL=${CUSTOM_ARCHIVE_GATEWAY_URL:-http://squid-archive-gateway:8000/graphql}

# =====================================================================================

Expand All @@ -168,3 +167,22 @@ TELEMETRY_ENDPOINT=http://collector:4318
# We do not provide a default value - scripts that startup a joystream-node service
# Should be explicit about what version to use.
# JOYSTREAM_NODE_TAG=latest

# =====================================================================================
## Storage-Squid configuration

# Db config
SQUID_DB_HOST=squid_db
SQUID_DB_NAME=squid
SQUID_DB_PASS=squid
SQUID_DB_PORT=23332

# Processor service prometheus port
SQUID_PROCESSOR_PROMETHEUS_PORT=3338

# Graphql server port
SQUID_GQL_PORT=4352

# Archive gateway host (Should not be set in local development)
# For running a production storage-squid instance uncomment the following line (to use the subsquid hosted archive)
# SQUID_ARCHIVE_GATEWAY_URL=${CUSTOM_ARCHIVE_GATEWAY_URL:-https://v2.archive.subsquid.io/network/joystream}
24 changes: 23 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion chain-metadata.json

Large diffs are not rendered by default.

59 changes: 46 additions & 13 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,6 +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 MEMBERID`](#joystream-cli-working-groupsverifyvalidator-memberid)

## `joystream-cli account:create`

Expand Down Expand Up @@ -2126,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 @@ -2155,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 @@ -2178,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 @@ -2722,4 +2726,33 @@ 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 MEMBERID`

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

```
USAGE
$ joystream-cli working-groups:verifyValidator MEMBERID
ARGUMENTS
MEMBERID ID of the membership bound to the validator account.
OPTIONS
-g, --group=(storageProviders|curators|forum|membership|app|builders|humanResources|marketing|distributors)
The working group context in which the command should be executed
Available values are: storageProviders, curators, forum, membership, app, builders, humanResources, marketing,
distributors.
--unverify
Whether the profile should be un-verified.
--useMemberId=useMemberId
Try using the specified member id as context whenever possible
--useWorkerId=useWorkerId
Try using the specified worker id as context whenever possible
```

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

<!-- commandsstop -->
6 changes: 3 additions & 3 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 @@ -39,7 +39,7 @@
"cross-fetch": "^3.0.6",
"fluent-ffmpeg": "^2.1.2",
"form-data": "^4.0.0",
"graphql": "^14.7.0",
"graphql": "^15.3.0",
"graphql-tag": "^2.12.6",
"inquirer": "^7.1.0",
"inquirer-datepicker-prompt": "^0.4.2",
Expand All @@ -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
59 changes: 59 additions & 0 deletions cli/src/commands/working-groups/verifyValidator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { flags } from '@oclif/command'
import WorkingGroupsCommandBase from '../../base/WorkingGroupsCommandBase'
import { WorkingGroups } from '../../Types'
import { VerifyValidator, RemarkMetadataAction } from '@joystream/metadata-protobuf'
import { metadataToString } from '../../helpers/serialization'
import Long from 'long'
import chalk from 'chalk'

export default class VerifyValidatorCommand extends WorkingGroupsCommandBase {
static description =
'Verify or un-verify the membership profile bound to a validator account. Available to membership workers only.'

static args = [
{
name: 'memberId',
required: true,
description: 'ID of the membership bound to the validator account.',
},
]

static flags = {
unverify: flags.boolean({
default: false,
description: 'Whether the profile should be un-verified.',
}),

...WorkingGroupsCommandBase.flags,
}

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

const { args, flags } = this.parse(VerifyValidatorCommand)
const memberId = Long.fromNumber(args.memberId)
const verifyValidator = !flags.unverify

const meta = new RemarkMetadataAction({
verifyValidator: new VerifyValidator({
memberId,
isVerified: verifyValidator,
}),
})
const message = metadataToString(RemarkMetadataAction, meta)

const keyPair = await this.getDecodedPair(worker.roleAccount)
const result = await this.sendAndFollowNamedTx(keyPair, 'membershipWorkingGroup', 'workerRemark', [
worker.workerId,
message,
])

const block = result.status.isInBlock ? result.status.asInBlock : undefined
const successMessage = `The validator profile ${args.memberId} was set to${verifyValidator ? '' : ' not'} verified.`
const inBlockMessage = block ? `(In block ${block})` : ''
this.log(chalk.green(`${successMessage} ${inBlockMessage}`))
}
}
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
2 changes: 1 addition & 1 deletion devops/kubernetes/argus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const deployment = new k8s.apps.v1.Deployment(
workingDir: '/joystream/distributor-node',
env: [
{
name: 'JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE',
name: 'JOYSTREAM_DISTRIBUTOR__ENDPOINTS__STORAGE_SQUID',
value: queryNodeHost,
},
{
Expand Down
4 changes: 4 additions & 0 deletions distributor-node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.5.1

- Added parsing of Axios errors on logger level so that we never log the whole Axios client instance (which is a circular object and causes the node to crash)

## 1.5.0

- Changed Elasticsearch transport to use data streams instead of regular indices. Renamed `config.logs.elastic.index` to `config.logs.elastic.indexPrefix`. Node ID from config will be automatically appended to the index name.
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
2 changes: 1 addition & 1 deletion distributor-node/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@joystream/distributor-node-client",
"description": "Joystream autogenerated distributor node api client.",
"version": "1.1.0",
"version": "2.0.0",
"author": "Joystream contributors",
"bugs": "https://github.com/Joystream/joystream/issues",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion distributor-node/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id: test-node
endpoints:
queryNode: http://localhost:8081/graphql
storageSquid: http://localhost:4352/graphql
joystreamNodeWs: ws://localhost:9944
directories:
assets: ./local/data
Expand Down
39 changes: 0 additions & 39 deletions distributor-node/docker-compose.yml

This file was deleted.

Loading

0 comments on commit 3c79cf4

Please sign in to comment.