Configure SPCTL
SPCTL—Super Protocol Control—is a versatile tool to access the Marketplace CLI. With this tool, you can create and manage orders, offers, providers, keys, workflows, files on distributed storage, and more.
Download SPCTL
- Linux
- MacOS
- Windows
Open a terminal in the directory where you want to place SPCTL for Linux and run the following command:
curl -L https://github.com/Super-Protocol/ctl/releases/latest/download/spctl-linux-x64 -o spctl
chmod +x ./spctl
Open Terminal in the directory where you want to place SPCTL for macOS and run the following command:
curl -L https://github.com/Super-Protocol/ctl/releases/latest/download/spctl-macos-x64 -o spctl
chmod +x ./spctl
Launch WSL from PowerShell, go to the directory where you want to place SPCTL, and run the following command:
curl -L https://github.com/Super-Protocol/ctl/releases/latest/download/spctl-linux-x64 -o spctl
chmod +x ./spctl
You can also download and install SPCTL manually from the Super Protocol GitHub repository.
For users
Execute the ./spctl setup
command to initiate the setup dialog. First, provide your Testnet Access Token and then your Testnet Private Key. You can find them in your Testnet invitation email.
Further, SPCTL asks if you have a Storj bucket with configured access grants. This step is optional. Select No
if you do not have them yet. You can configure Storj and provide this information later in this guide or skip this step entirely.
After that, SPCTL creates config.json
in the SPCTL root directory. If you need to update your account information, execute ./spctl setup
again or modify config.json
manually in any text editor.
For SPCTL to work correctly, config.json
must be in the same directory as the SPCTL executable. Do not move or rename this file unless you want to create a separate SPCTL configuration for another Testnet account.
Manual configuration
You can also skip the ./spctl setup
command completely and set up SPCTL manually. Create an empty config.json
file in the SPCTL directory and add the following template:
{
"backend": {
"url": "https://bff.testnet.superprotocol.com/graphql",
"accessToken": ""
},
"blockchain": {
"rpcUrl": "https://polygon.superprotocol.com/",
"smartContractAddress": "0x3C69ea105Fc716C1Dcb41859281Aa817D0A0B279",
"accountPrivateKey": ""
},
"storage": {
"type": "STORJ",
"bucket": "",
"writeAccessToken": "",
"readAccessToken": ""
},
"workflow": {
"resultEncryption": {
"algo": "ECIES",
"key": "",
"encoding": "base64"
}
}
}
Do not change the preconfigured parameters and fill in the following ones:
Parameter | Description |
---|---|
accessToken | Your Testnet Access Token from the Testnet invitation email |
accountPrivateKey | Your Testnet Private Key from the Testnet invitation email |
key | Private key for order result encryption. Use the workflows generate-key command to create this key |
bucket | Name of your Storj bucket (optional) |
writeAccessToken | Storj access grant with write and delete permissions for this bucket (optional) |
readAccessToken | Storj access grant with read permission for this bucket (optional) |
For offer providers
This section is for offer providers only. Skip it if you are a regular user.
Offer providers need another copy of SPCTL configured for their provider accounts. If you completed all the necessary steps in the [Providers and Offers] guide, you should have the configuration file created automatically in your Provider Tools directory. Its name looks like this:
spctl-config-0xB9f0b77BDbAe9fBe3E60BdC567E453f503605BAa.json
Where 0xB9f0b77BDbAe9fBe3E60BdC567E453f503605BAa
is your Authority Account wallet address.
Rename this file to config.json
so SPCTL can recognize it as its configuration file. Copy or download the SPCTL executable to the Provider Tools root directory.
Alternatively, copy this provider's SPCTL config to your User Account's SPCTL directory. Use the --config
option with SPCTL commands to manage your provider and orders. For example:
./spctl orders list --my-account --type tee --config spctl-config-0xB9f0b77BDbAe9fBe3E60BdC567E453f503605BAa.json
Manual configuration
As with your User Account's configuration file, you can manually create the provider's configuration file. Back up the current config.json
or create a separate directory for your provider's copy of the SPCTL executable.
Use the following config.json
template:
{
"backend": {
"url": "https://bff.testnet.superprotocol.com/graphql",
"accessToken": ""
},
"blockchain": {
"rpcUrl": "https://polygon.superprotocol.com/",
"smartContractAddress": "0x3C69ea105Fc716C1Dcb41859281Aa817D0A0B279",
"accountPrivateKey": "",
"authorityAccountPrivateKey": ""
},
"storage": {
"type": "STORJ",
"bucket": "",
"writeAccessToken": "",
"readAccessToken": ""
},
"workflow": {
"resultEncryption": {
"algo": "ECIES",
"key": "",
"encoding": "base64"
}
}
}
Do not change the preconfigured parameters and fill in the following ones:
Parameter | Description |
---|---|
accessToken | Your regular Testnet Access Token from the Testnet invitation email |
accountPrivateKey | Private Key of your provider's Action Account |
authorityAccountPrivateKey | Private Key of your provider's Authority Account |
key | Private key for order result encryption. Use the key from your User Account or generate a new one with the workflows generate-key command |
bucket | Name of your Storj bucket (optional) |
writeAccessToken | Storj access grant with write and delete permissions for this bucket (optional) |
readAccessToken | Storj access grant with read permission for this bucket (optional) |
You can find the section with your Authority and Action Accounts Private Keys in provider-tools-config.json
in the Provider Tools directory:
"account": {
"authority": "0x50612a8bf52cb263825e58c72361ea58c04efn7af7e5b549ea9c2ed02059c668d",
"action": "0x0512ad96f1900d3ecf0987m81c74af455ebb49kjce5bc1fd3zc0b410c7dc6f05",
"tokenReceiver": "0x167d93786ghbf058065a5a592a1d55ca1e620d19b7d1e47330f2b64d9fcb6a38"
},
Set up Storj
This step is optional. You can add a Marketplace storage offer to the files upload
command instead of configuring Storj. However, for additional control, you can set up and use your storage.
Register a Storj account if you do not have one yet.
If you use a free Storj account, your files will become unavailable after the end of the trial period.
Create a bucket for your encrypted solutions and data. Refer to the Storj documentation for guidance.
Create two access grants for this bucket. One should provide the write and delete permissions, and the other one the read permission. Alternatively, you can create a single access grant with the all permission. Refer to the Storj guide to generate access grants.
Open SPCTL's config.json
in a text editor and fill in the following parameters:
Parameter | Description |
---|---|
bucket | Name of a Storj bucket |
writeAccessToken | Storj access grant with the write and delete permissions for this bucket |
readAccessToken | Storj access grant with the read permission for this bucket |
Support
If you have any issues or questions, contact Super Protocol on Discord. The Community Managers will be happy to help you.