4.3 Performing Sanity Checks

After setting up your node, it's crucial to perform some sanity checks to ensure everything is working correctly. Let's go through the process of creating a token and checking balances.

Creating a Test Tok (costs gas)

  1. Open a new terminal tab and submit your first transaction by creating a token:

make test-create-token
  1. Once the batch is submitted, you should see output containing the transaction hash. For example:

Your batch was submitted to the sequencer for publication. Response: "Submitted 1 transaction"
0: 0xfce2381221722b8114ba41a632c44f54384d0a31f332a64f7cbc3f667841d7f0
  1. Use this transaction hash to query the REST API endpoint and fetch events belonging to the transaction:

curl -sS http://127.0.0.1:12346/ledger/txs/0xfce2381221722b8114ba41a632c44f54384d0a31f332a64f7cbc3f667841d7f0/events | jq

Replace the transaction hash with the one from your output.

  1. You should see output similar to:

{
  "data": [
    {
      "type": "event",
      "number": 0,
      "key": "token_created",
      "value": {
        "token-created": {
          "token_name": "sov-test-token",
          "coins": {
            "amount": 1000000,
            "token_id": "token_1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27ss0lusz"
          },
          "minter": {
            "User": "sov15vspj48hpttzyvxu8kzq5klhvaczcpyxn6z6k0hwpwtzs4a6wkvqwr57gc"
          },
          "authorized_minters": [
            {
              "user": "sov1l6n2cku82yfqld30lanm2nfw43n2auc8clw7r5u5m6s7p8jrm4zqrr8r94"
            },
            {
              "user": "sov15vspj48hpttzyvxu8kzq5klhvaczcpyxn6z6k0hwpwtzs4a6wkvqwr57gc"
            }
          ]
        }
      },
      "module": {
        "type": "moduleRef",
        "name": "Bank"
      }
    }
  ],
  "meta": {}
}

Note the token_id in the output. You'll need this for checking balances.

Checking Balances (Gasless)

  1. In a new terminal tab, run an RPC query to check the balance of your address:

curl -Ss http://127.0.0.1:12346/modules/bank/tokens/TOKEN_ID/balances/YOUR_ADDRESS | jq -c -M

Replace TOKEN_ID with the actual token ID and ADDRESS with the address you want to check.

  1. You should see a response similar to:

{"data":{"coins": {"amount": 1000000,"token_id": "token_1zdwj8thgev2u3yyrrlekmvtsz4av4tp3m7dm5mx5peejnesga27ss0lusz"}},"meta":{}}

this confirms that your address has received the newly created tokens.

By completing these sanity checks, you've verified that your node can create tokens, submit transactions, and query balances. This indicates that your Spicenet validator node is set up correctly and functioning as expected.

Submitting Test Transactions

  1. Generate a test transaction:

./target/debug/sov-cli transactions import from-file bank --max-fee 100000000 --path ./examples/test-data/requests/transfer.json
  1. Submit the transaction:

./target/debug/sov-cli node submit-batch --wait-for-processing by-address YOUR_ADDRESS

Replace YOUR_ADDRESS with your actual address.

  1. Verify the transaction by checking balances again.

By following these steps, you should now have a configured and running Spicenet validator node. Remember to regularly check for updates and maintain your node's security and performance.

Last updated