Skip to content

Commit

Permalink
rename queryNode to storageSquid in Argus/Colossus configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanakram3 committed Jan 8, 2024
1 parent adb71b7 commit e2ce216
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 30 deletions.
9 changes: 4 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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 @@ -49,11 +48,11 @@ GRAPHQL_SERVER_HOST=localhost
# Websocket RPC endpoint containers will use.
JOYSTREAM_NODE_WS=ws://joystream-node:9944/

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

# Query node (graphql-server) which distributor will use
DISTRIBUTOR_QUERY_NODE_URL=http://squid-graphql-server:4352/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
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
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:4352/graphql
storageSquid: http://localhost:4352/graphql
joystreamNodeWs: ws://localhost:9944
directories:
assets: ./local/data
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## storageSquid Type

`string`

## storageSquid Constraints

**URI**: the string must be a URI, according to [RFC 3986](https://tools.ietf.org/html/rfc3986 "check the specification")
14 changes: 7 additions & 7 deletions distributor-node/docs/schema/definition-properties-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@

| Property | Type | Required | Nullable | Defined by |
| :---------------------------------- | :------- | :------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [queryNode](#querynode) | `string` | Required | cannot be null | [Distributor node configuration](definition-properties-endpoints-properties-querynode.md "https://joystream.org/schemas/argus/config#/properties/endpoints/properties/queryNode") |
| [storageSquid](#storagesquid) | `string` | Required | cannot be null | [Distributor node configuration](definition-properties-endpoints-properties-storagesquid.md "https://joystream.org/schemas/argus/config#/properties/endpoints/properties/storageSquid") |
| [joystreamNodeWs](#joystreamnodews) | `string` | Required | cannot be null | [Distributor node configuration](definition-properties-endpoints-properties-joystreamnodews.md "https://joystream.org/schemas/argus/config#/properties/endpoints/properties/joystreamNodeWs") |

## queryNode
## storageSquid

Query node graphql server uri (for example: <http://localhost:8081/graphql>)
Storage-Squid graphql server uri (for example: <http://localhost:4352/graphql>)

`queryNode`
`storageSquid`

* is required

* Type: `string`

* cannot be null

* defined in: [Distributor node configuration](definition-properties-endpoints-properties-querynode.md "https://joystream.org/schemas/argus/config#/properties/endpoints/properties/queryNode")
* defined in: [Distributor node configuration](definition-properties-endpoints-properties-storagesquid.md "https://joystream.org/schemas/argus/config#/properties/endpoints/properties/storageSquid")

### queryNode Type
### storageSquid Type

`string`

### queryNode Constraints
### storageSquid Constraints

**URI**: the string must be a URI, according to [RFC 3986](https://tools.ietf.org/html/rfc3986 "check the specification")

Expand Down
4 changes: 2 additions & 2 deletions distributor-node/src/schemas/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const configSchema: JSONSchema4 = objectSchema({
endpoints: objectSchema({
description: 'Specifies external endpoints that the distributor node will connect to',
properties: {
queryNode: {
storageSquid: {
description: 'Storage-Squid graphql server uri (for example: http://localhost:4352/graphql)',
type: 'string',
format: 'uri',
Expand All @@ -38,7 +38,7 @@ export const configSchema: JSONSchema4 = objectSchema({
format: 'uri',
},
},
required: ['queryNode', 'joystreamNodeWs'],
required: ['storageSquid', 'joystreamNodeWs'],
}),
directories: objectSchema({
description: "Specifies paths where node's data will be stored",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export class NetworkingService {
}

return {
url: this.config.endpoints.queryNode,
url: this.config.endpoints.storageSquid,
chainHead: (await this.runtimeApi.derive.chain.bestNumber()).toNumber() || 0,
blocksProcessed: squidStatus?.height || 0,
}
Expand Down
2 changes: 1 addition & 1 deletion distributor-node/src/services/networking/query-node/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class QueryNodeApi {
})

this.apolloClient = new ApolloClient({
link: from([errorLink, new HttpLink({ uri: this.config.endpoints.queryNode, fetch })]),
link: from([errorLink, new HttpLink({ uri: this.config.endpoints.storageSquid, fetch })]),
// Ref: https://www.apollographql.com/docs/react/api/core/ApolloClient/#assumeimmutableresults
assumeImmutableResults: true,
cache: new InvalidationPolicyCache({
Expand Down
8 changes: 4 additions & 4 deletions docker-compose-no-bind-volumes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
command: [
'start', '--worker=${COLOSSUS_1_WORKER_ID}', '--port=3333', '--uploads=/data/uploads',
'--sync', '--syncInterval=1',
'--queryNodeEndpoint=${COLOSSUS_QUERY_NODE_URL}',
'--storageSquidEndpoint=${COLOSSUS_STORAGE_SQUID_URL}',
'--apiUrl=${JOYSTREAM_NODE_WS}',
'--logFilePath=/logs',
'--tempFolder=/data/temp/',
Expand Down Expand Up @@ -67,7 +67,7 @@ services:
# Node configuration can be overriden via env, for exampe:
environment:
JOYSTREAM_DISTRIBUTOR__ID: distributor-1
JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: ${DISTRIBUTOR_QUERY_NODE_URL}
JOYSTREAM_DISTRIBUTOR__ENDPOINTS__STORAGE_SQUID: ${DISTRIBUTOR_STORAGE_SQUID_URL}
JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_1_ACCOUNT_URI}\"}]"
JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_1_WORKER_ID}
JOYSTREAM_DISTRIBUTOR__PUBLIC_API__PORT: 3334
Expand Down Expand Up @@ -107,7 +107,7 @@ services:
command: [
'server', '--worker=${COLOSSUS_2_WORKER_ID}', '--port=3333', '--uploads=/data/uploads',
'--sync', '--syncInterval=1',
'--queryNodeEndpoint=${COLOSSUS_QUERY_NODE_URL}',
'--storageSquidEndpoint=${COLOSSUS_STORAGE_SQUID_URL}',
'--apiUrl=${JOYSTREAM_NODE_WS}',
'--logFilePath=/logs',
'--tempFolder=/data/temp/',
Expand All @@ -133,7 +133,7 @@ services:
# Node configuration can be overriden via env, for exampe:
environment:
JOYSTREAM_DISTRIBUTOR__ID: distributor-2
JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: ${DISTRIBUTOR_QUERY_NODE_URL}
JOYSTREAM_DISTRIBUTOR__ENDPOINTS__STORAGE_SQUID: ${DISTRIBUTOR_STORAGE_SQUID_URL}
JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_2_ACCOUNT_URI}\"}]"
JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_2_WORKER_ID}
JOYSTREAM_DISTRIBUTOR__PUBLIC_API__PORT: 3334
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
command: [
'server', '--worker=${COLOSSUS_1_WORKER_ID}', '--port=3333', '--uploads=/data/uploads/',
'--sync', '--syncInterval=1',
'--queryNodeEndpoint=${COLOSSUS_QUERY_NODE_URL}',
'--storageSquidEndpoint=${COLOSSUS_STORAGE_SQUID_URL}',
'--apiUrl=${JOYSTREAM_NODE_WS}',
'--logFilePath=/logs',
'--tempFolder=/data/temp/',
Expand Down Expand Up @@ -67,7 +67,7 @@ services:
# Node configuration can be overriden via env, for exampe:
environment:
JOYSTREAM_DISTRIBUTOR__ID: distributor-1
JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: ${DISTRIBUTOR_QUERY_NODE_URL}
JOYSTREAM_DISTRIBUTOR__ENDPOINTS__STORAGE_SQUID: ${DISTRIBUTOR_STORAGE_SQUID_URL}
JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_1_ACCOUNT_URI}\"}]"
JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_1_WORKER_ID}
JOYSTREAM_DISTRIBUTOR__PUBLIC_API__PORT: 3334
Expand Down Expand Up @@ -110,7 +110,7 @@ services:
command: [
'server', '--worker=${COLOSSUS_2_WORKER_ID}', '--port=3333', '--uploads=/data/uploads',
'--sync', '--syncInterval=1',
'--queryNodeEndpoint=${COLOSSUS_QUERY_NODE_URL}',
'--storageSquidEndpoint=${COLOSSUS_STORAGE_SQUID_URL}',
'--apiUrl=${JOYSTREAM_NODE_WS}',
'--logFilePath=/logs',
'--tempFolder=/data/temp/',
Expand Down Expand Up @@ -139,7 +139,7 @@ services:
# Node configuration can be overriden via env, for exampe:
environment:
JOYSTREAM_DISTRIBUTOR__ID: distributor-2
JOYSTREAM_DISTRIBUTOR__ENDPOINTS__QUERY_NODE: ${DISTRIBUTOR_QUERY_NODE_URL}
JOYSTREAM_DISTRIBUTOR__ENDPOINTS__STORAGE_SQUID: ${DISTRIBUTOR_STORAGE_SQUID_URL}
JOYSTREAM_DISTRIBUTOR__KEYS: "[{\"suri\":\"${DISTRIBUTOR_2_ACCOUNT_URI}\"}]"
JOYSTREAM_DISTRIBUTOR__WORKER_ID: ${DISTRIBUTOR_2_WORKER_ID}
JOYSTREAM_DISTRIBUTOR__PUBLIC_API__PORT: 3334
Expand Down
2 changes: 1 addition & 1 deletion storage-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ OPTIONS
a single password can be set in ACCOUNT_PWD
environment variable.
-q, --queryNodeEndpoint=queryNodeEndpoint (required) [default: http://localhost:4352/graphql]
-q, --storageSquidEndpoint=storageSquidEndpoint (required) [default: http://localhost:4352/graphql]
Storage Squid graphql server endpoint (e.g.:
http://some.com:4352/graphql)
Expand Down
6 changes: 3 additions & 3 deletions storage-node/src/commands/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class Server extends ApiCommandBase {
description: 'Interval between periodic cleanup actions (in minutes)',
default: 360,
}),
queryNodeEndpoint: flags.string({
storageSquidEndpoint: flags.string({
char: 'q',
required: true,
default: 'http://localhost:4352/graphql',
Expand Down Expand Up @@ -188,7 +188,7 @@ Supported values: warn, error, debug, info. Default:debug`,
})
}

logger.info(`Query node endpoint set: ${flags.queryNodeEndpoint}`)
logger.info(`Storage Squid endpoint set: ${flags.storageSquidEndpoint}`)

const workerId = flags.worker

Expand All @@ -197,7 +197,7 @@ Supported values: warn, error, debug, info. Default:debug`,
this.exit(ExitCodes.InvalidWorkerId)
}

const qnApi = new QueryNodeApi(flags.queryNodeEndpoint)
const qnApi = new QueryNodeApi(flags.storageSquidEndpoint)

const selectedBucketsAndAccounts = await constructBucketToAddressMapping(api, qnApi, workerId, flags.buckets)

Expand Down

0 comments on commit e2ce216

Please sign in to comment.