Submitting a Proposal
These are the three primary steps to getting your proposal live on-chain.
Interacting with the Swisstronik via the command line in order to run queries or submit proposals has several prerequisites:
You will need to compile rom source into a binary file executable
You will need to indicate which chain you are querying, and currently this is
--chain-id swisstronik_1291-1
You will need to connect to a full node
Running a full node can be difficult for those not technically-inclined, so you may choose to use a third-party's full node. In this case, the primary security risk is that of censorship: it's the single place where you have a single gateway to the network, and any messages submitted through an untrusted node could be censored.
Hosting supplementary materials
In general we try to minimize the amount of data pushed to the blockchain. Hence, detailed documentation about a proposal is usually hosted on a separate censorship resistant data-hosting platform, like IPFS.
Once you have drafted your proposal, ideally as a Markdown file, you can upload it to the IPFS network:
By using a service such as https://pinata.cloud
Ensure that you "pin" the file so that it continues to be available on the network. You should get a URL like this: https://ipfs.io/ipfs/QmbkQNtCAdR1CNbFE8ujub2jcpwUcmSRpSCg8gVWrTHSWD
The value QmbkQNtCAdR1CNbFE8ujub2jcpwUcmSRpSCg8gVWrTHSWD
is called the CID
of your file - it is effectively the file's hash.
If you uploaded a markdown file, you can use the IPFS markdown viewer to render the document for better viewing. Links for the markdown viewer look like https://ipfs.io/ipfs/QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D/example#/ipfs/<CID>
, where <CID>
is your CID. For instance the link above would be: https://ipfs.io/ipfs/QmTkzDwWqPbnAh5YiV5VwcTLnGdwSNsNTn2aDxdXBFca7D/example#/ipfs/QmbkQNtCAdR1CNbFE8ujub2jcpwUcmSRpSCg8gVWrTHSWD
Share the URL with others and verify that your file is publicly accessible.
The reason we use IPFS is that it is a decentralized means of storage, making it resistant to censorship or single points of failure. This increases the likelihood that the file will remain available in the future.
Formatting the JSON file for the governance proposal
Prior to sending the transaction that submits your proposal on-chain, you must create a JSON file. This file will contain the information that will be stored on-chain as the governance proposal. Begin by creating a new text (.txt) file to enter this information. Use these best practices as a guide for the contents of your proposal. When you're done, save the file as a .json file.
Each proposal type is unique in how the JSON should be formatted. See the relevant section at the previous page for the type of proposal you are drafting:
Text Proposals
Community Pool Spend Proposals
Parameter Change Proposals
Once on-chain, most people will rely upon block explorers to interpret this information with a graphical user interface (GUI).
Sending the transaction that submits your governance proposal
This is the generic command format for using swisstronikd (the command-line interface) to submit your proposal on-chain:
If <proposal type>
is left blank, the type will be a Text proposal. Otherwise, it can be set to param-change
or community-pool-spend
. Use --help
to get more info from the tool.
Be careful what you use for --fees
. A mistake here could result in spending hundreds or thousands of SWTRs accidentally, which cannot be recovered.
Verifying your transaction
After posting your transaction, your command line interface (swisstronikd
) will provide you with the transaction's hash, which you can either query using swisstronikd
or by searching the transaction hash using block explorers. The hash should look something like this: 0506447AE8C7495DE970736474451CF23536DF8EA837FAF1CF6286565589AB57
Troubleshooting a failed transaction
There are a number of reasons why a transaction may fail. Here are two examples:
Running out of gas - The more data there is in a transaction, the more gas it will need to be processed. If you don't specify enough gas, the transaction will fail.
Incorrect denomination - You may have specified an amount in 'awtr' or 'aswt' instead of 'aswtr', causing the transaction to fail.
Depositing funds after a proposal has been submitted
Sometimes a proposal is submitted without having the minimum token amount deposited yet. In these cases you would want to be able to deposit more tokens to get the proposal into the voting stage. In order to deposit tokens, you'll need to know what your proposal ID is after you've submitted your proposal. You can query all proposals by the following command:
If there are a lot of proposals on the chain already, you can also filter by your own address. For the proposal above, that would be:
Once you have the proposal ID, this is the command to deposit extra tokens:
Last updated