Configure SPCTL
SPCTL—Super Protocol Control—is a versatile tool to access the Super Protocol CLI. With this tool, you can create and manage orders, offers, providers, keys, files, and more.
Download
- 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
Install and launch WSL. 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.
Set Up
You can set up SPCTL using the ./spctl setup command or by manually creating a configuration file.
- SPCTL setup
- Manual configuration
- Super Protocol recommends creating a separate wallet for the testnet. Generate a private key:
head -c 32 /dev/urandom | xxd -p -c 32
-
Execute the
./spctl setupcommand to initiate the setup dialog. -
Enter the following Access Token when prompted:
eyJhbGciOiJFUzI1NiJ9.eyJhZGRyZXNzIjoiMHhBN0E5NjQ4ZGE2QTg5QjBhNzFhNGMwRDQ2Y2FENDAwMDU3ODI3NGEyIiwiaWF0IjoxNjc5OTk4OTQyLCJleHAiOjE3NDMxMTQxNDJ9.x2lx90D733mToYYdOWhh4hhXn3YowFW4JxFjDFtI7helgp2uqekDHFgekT5yjbBWeHTzRap7SHbDC3VvMIDe0g
-
Enter the private key you generated in step 1.
-
Answer
Nowhen prompted 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.
- Super Protocol recommends creating a separate wallet for the testnet. Generate a private key:
head -c 32 /dev/urandom | xxd -p -c 32
- 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 set values to the following keys:
| Key | Description |
|---|---|
"accountPrivateKey" | The private key you generated in step 1. |
"bucket" | (optional) Name of a Storj bucket. |
"prefix" | (optional) Path to a directory inside the bucket with a trailing slash, for example, data/. 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. |
Save and close the file.
- Generate a key for order result encryption using the
workflows generate-keycommand. Openconfig.jsonagain and set the generated key toworkflow.resultEncryption.key. Save and close the file.
Set up Storj access (optional)
If you upload files without configuring Storj access, Super Protocol will automatically provide you with 20 GB of storage. However, for additional control and storage space, set up and use your Storj account.
- 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.
-
Run
./spctl setupagain or open SPCTL'sconfig.jsonin 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 or via the contact form.