Create Your Own Table

Most applications require data management - and SXT has you covered!

Creating your own custom tables in the Space and Time network is very similar to any other database, with only minor differences to account for SXT's decentralized nature - the biggest is the need for keypairs that govern authorization of tables.

Let's Get Started!

To be able to validate your script, we'd ask that you generate a new file called <span style={{ color: "blue" }}>Create_Your_Own_Table.sh that you can commit to your branch of the SXT-Community/SXTAccreditation repo at the end of the activity.



Create a Table Keypair


Save Your Keys

Before we go any farther, let's take a moment to save your keys and other variables to your project file. It's highly recommended you save your keys in a format that works well with dotenv or shell files. Specifically:

API_URL="https://api.spaceandtime.dev"
API_KEY="sxt_b24iOiIzMWNiMGI0Yi0xMjZlLTRl2MtYTd"

RESOURCE_PRIVATE_KEY="D4EAC895937773E3047FE2E9AFA7004B80601BA0F687511BC23658D366FFB51B"  
RESOURCE_PUBLIC_KEY="51297647296389ADABBB6E62230203C620DF47BF8DCAEEF1B1EC35507FBA48E0"
ADMIN_BISCUIT="EpABCiYKDnN4dDpjYXBhYmlsaXR5CgEqGAMiDwoNCIAIEgMYgQgSAxiBCBIkCAASIJK..."

By convention, Keys for tables, views, etc. are typically labeled as "Resources" to differentiate them from "User" keys, hence the the RESOURCE_ prefix above. The above examples are NOT real keys, and have been purposely modified to be invalid - please generate your own unique keys.

❗️

Do not push an active API_KEY to github! It would be possible for someone to gain full control of your account / table and lock you out! Save keys to an dotenv file, or to an alternate location entirely.



Create Your Table

Once you have an ED25519 keypair, it's time to create your table!

Again, sure to replace $USERID with your actual Space and Time UserName. This will allow us to validate and give you credit for your table!



Get Credit:

You'll get credit for this activity if you:

  • Create a new table in the schema: SXTTemp.Test_<your UserID>
    If your UserID has special characters that aren't accepted, simply replace them with underscores ().
  • Commit your work file to the SXT-Community/SXTAccreditation repo

{/ looking for SXTTemp.Test_$USERID where the creator = $USERID /}


What’s Next