subql
subql copied to clipboard
Support multichain deployment via CLI
Description
Extend the subql multichain
command to allow deploying the updates to the managed service.
Requirements
- It should take the multichain manifest as the
-f
parameter - It should be non-interactive so that it works with CIs
- Arguments should match the current deploy command but can specify on a per-network basis. They should also work the same way to apply an option to all networks.
e.g. The
--endpoint=<rpc-endpoint>
flag should be used like so `--endpoint=": , :<rpc-endpoint">
Managed service API docs: https://api.subquery.network/doc/#/DeploymentV3/DeploymentV3Controller_
Example creating project
### create multichain for 2 chains
POST {{host}}/v3/subqueries/454076513/multi-chain/deployments
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"type": "stage",
"queryAdvancedSettings": {
"query": {}
},
"chains": [
{
"cid": "QmPzVNXEd9LZbJSGSGiexsgmxSG5s5gbKcAu8kZsRx2G2L",
"dictEndpoint": "https://api.subquery.network/sq/subquery/dictionary-kusama",
"endpoint": [
"https://kusama.api.onfinality.io/rpc?apikey=b8b99961-e876-41dd-bd7d-0c143f3a3428"
],
"indexerImageVersion": "v3.4.2",
"indexerAdvancedSettings": {
"indexer": {}
},
"extraParams": {}
},
{
"cid": "QmZxc1iEvWS4g8LhovEaYFhAk1homTZfxHoPJZC95TsX1F",
"dictEndpoint": "https://api.subquery.network/sq/subquery/polkadot-dictionary",
"endpoint": [
"https://polkadot.api.onfinality.io/rpc?apikey=b8b99961-e876-41dd-bd7d-0c143f3a3428"
],
"indexerImageVersion": "v3.4.2",
"indexerAdvancedSettings": {
"indexer": {}
},
"extraParams": {}
}
],
"cid": "QmP53dMKzmpHGjTAJxPTDGD1g1AsX8zER7gS1KXQ28JzHx",
"queryImageVersion": "v2.7.0"
}
Example updating project
### update multichain for 2 chains
PUT {{host}}/v3/subqueries/454076513/multi-chain/deployments/12
Content-Type: application/json
Authorization: Bearer {{accessToken}}
{
"type": "stage",
"queryAdvancedSettings": {
"query": {}
},
"chains": [
{
"cid": "QmPzVNXEd9LZbJSGSGiexsgmxSG5s5gbKcAu8kZsRx2G2L",
"dictEndpoint": "https://api.subquery.network/sq/subquery/dictionary-kusama",
"endpoint": [
"https://kusama.api.onfinality.io/rpc?apikey=b8b99961-e876-41dd-bd7d-0c143f3a3428"
],
"indexerImageVersion": "v3.4.2",
"indexerAdvancedSettings": {
"indexer": {}
},
"extraParams": {"workers": {
"num": 1
}}
},
{
"cid": "QmZxc1iEvWS4g8LhovEaYFhAk1homTZfxHoPJZC95TsX1F",
"dictEndpoint": "https://api.subquery.network/sq/subquery/polkadot-dictionary",
"endpoint": [
"https://polkadot.api.onfinality.io/rpc?apikey=b8b99961-e876-41dd-bd7d-0c143f3a3428"
],
"indexerImageVersion": "v3.4.2",
"indexerAdvancedSettings": {
"indexer": {}
},
"extraParams": {"workers": {
"num": 2
}}
}
],
"cid": "QmP53dMKzmpHGjTAJxPTDGD1g1AsX8zER7gS1KXQ28JzHx",
"queryImageVersion": "v2.7.0"
}