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, files, 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.
Configure SPCTL for users
You can configure SPCTL using the ./spctl setup
command or by manually creating a configuration file.
- SPCTL setup
- Manual configuration
-
Execute the
./spctl setup
command to initiate the setup dialog. -
Enter the following Access Token when prompted:
eyJhbGciOiJFUzI1NiJ9.eyJhZGRyZXNzIjoiMHhBN0E5NjQ4ZGE2QTg5QjBhNzFhNGMwRDQ2Y2FENDAwMDU3ODI3NGEyIiwiaWF0IjoxNjc5OTk4OTQyLCJleHAiOjE3NDMxMTQxNDJ9.x2lx90D733mToYYdOWhh4hhXn3YowFW4JxFjDFtI7helgp2uqekDHFgekT5yjbBWeHTzRap7SHbDC3VvMIDe0g
-
Enter a private key to your testnet EVM wallet when prompted.
-
Answer
No
when promted about a Storj bucket. You can configure Storj and provide this information later or skip this step entirely.
When done, 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 a text editor.
In the SPCTL directory, create a file named config.json
. Use the following template:
{
"backend": {
"url": "https://bff.superprotocol.com/graphql",
"accessToken": "eyJhbGciOiJFUzI1NiJ9.eyJhZGRyZXNzIjoiMHhBN0E5NjQ4ZGE2QTg5QjBhNzFhNGMwRDQ2Y2FENDAwMDU3ODI3NGEyIiwiaWF0IjoxNjc5OTk4OTQyLCJleHAiOjE3NDMxMTQxNDJ9.x2lx90D733mToYYdOWhh4hhXn3YowFW4JxFjDFtI7helgp2uqekDHFgekT5yjbBWeHTzRap7SHbDC3VvMIDe0g"
},
"blockchain": {
"rpcUrl": "https://opbnb.superprotocol.com",
"smartContractAddress": "0x3C69ea105Fc716C1Dcb41859281Aa817D0A0B279",
"accountPrivateKey": "",
"authorityAccountPrivateKey": ""
},
"storage": {
"type": "STORJ",
"bucket": "",
"prefix": "",
"writeAccessToken": "",
"readAccessToken": ""
},
"workflow": {
"resultEncryption": {
"algo": "ECIES",
"key": "",
"encoding": "base64"
}
}
}
- Do not change the preconfigured values and provide values to the following keys:
Key | Description |
---|---|
"accountPrivateKey" | An EVM wallet private key. Super Protocol recommends creating a separate wallet for the testnet. |
"bucket" | (optional) Name of a Storj bucket. |
"prefix" | (optional) Path to a directory inside the bucket. It can be empty. |
"writeAccessToken" | (optional) Storj access grant with Full permission (Read, List, Write, Delete) for this bucket. |
"readAccessToken" | (optional) Storj access grant with Read permission for this bucket. |
- Generate a private key for order result encryption using the workflows generate-key command. Set it in
"key"
(workflow.resultEncryption.key
) inconfig.json
.
Configure SPCTL for providers
This section is for offer providers only. Skip it if you are a regular user.
Providers need another copy of SPCTL configured for their accounts to manage offers.
- Provider Tools
- Manual Configuration
If you registered a provider using Provider Tools, you should have a configuration file created automatically in the Provider Tools directory. Its name looks similar to the following:
spctl-config-0xB9f0b77BDbAe9fBe3E60BdC567E453f503605BAb.json
Where 0xB9f0b77BDbAe9fBe3E60BdC567E453f503605BAb
is your Authority Account wallet address.
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
Alternatively, rename this file to config.json
so SPCTL can recognize it as its configuration file. Copy or download the SPCTL binary to the Provider Tools directory.
As with your User Account's configuration file, you can manually create the provider's SPCTL configuration file.
- In the Provider Tools directory, create a file named
config.json
. Use the following template:
{
"backend": {
"url": "https://bff.superprotocol.com/graphql",
"accessToken": "eyJhbGciOiJFUzI1NiJ9.eyJhZGRyZXNzIjoiMHhBN0E5NjQ4ZGE2QTg5QjBhNzFhNGMwRDQ2Y2FENDAwMDU3ODI3NGEyIiwiaWF0IjoxNjc5OTk4OTQyLCJleHAiOjE3NDMxMTQxNDJ9.x2lx90D733mToYYdOWhh4hhXn3YowFW4JxFjDFtI7helgp2uqekDHFgekT5yjbBWeHTzRap7SHbDC3VvMIDe0g"
},
"blockchain": {
"rpcUrl": "https://opbnb.superprotocol.com",
"smartContractAddress": "0x3C69ea105Fc716C1Dcb41859281Aa817D0A0B279",
"accountPrivateKey": "",
"authorityAccountPrivateKey": ""
},
"storage": {
"type": "STORJ",
"bucket": "",
"prefix": "",
"writeAccessToken": "",
"readAccessToken": ""
},
"workflow": {
"resultEncryption": {
"algo": "ECIES",
"key": "",
"encoding": "base64"
}
}
}
- Do not change the preconfigured values and provide values to the following keys:
Key | Description |
---|---|
"accountPrivateKey" | The provider's Action Account private key. |
"authorityAccountPrivateKey" | The provider's Authority Account private key. |
"bucket" | (optional) Name of a Storj bucket. |
"prefix" | (optional) Path to a directory inside the bucket. It can be empty. |
"writeAccessToken" | (optional) Storj access grant with Full permission (Read, List, Write, Delete) for this bucket. |
"readAccessToken" | (optional) Storj access grant with Read permission for this bucket. |
You can find the section with your Authority and Action Accounts private keys in provider-tools-config.json
in the Provider Tools directory. For example:
"account": {
"authority": "0x50612a8bf52cb263825e58c72361ea58c04efa7af7e5b549ea9c2ed02059c668d",
"action": "0x0512ad96fzc01900d3ecf0987m81c7bc1fd2daf455ebb49kjce5b410c7dc6f05",
"tokenReceiver": "0x167d93786ghbf00d19b7d58065a5a59276e55ca1e621e47330f2b64d9fcb6a38"
},
- Generate a private key for order result encryption using the workflows generate-key command. Set it in
"key"
(workflow.resultEncryption.key
) inconfig.json
.
Set up Storj access (optional)
You can use a Marketplace storage offer in the files upload
command instead of configuring Storj. However, for additional control, 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 Full permission (Read, List, Write, Delete), and the other one Read permission. Refer to the Storj guide to generate access grants.
-
Open SPCTL's
config.json
in a text editor and provide values to the following key:
Key | Description |
---|---|
"bucket" | Name of a Storj bucket. |
"writeAccessToken" | Storj access grant with Full permission (Read, List, Write, Delete) for this bucket. |
"readAccessToken" | Storj access grant with 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.