1

I am using substrate node-template for my blockchain, I want run with my own accounts, for some reason below code converting chainSpec.json raw format is throwing error.

macOS: : Apple M1 pro Ventura 13.2.1

installed toolchains
--------------------

stable-aarch64-apple-darwin
nightly-2022-05-15-aarch64-apple-darwin
nightly-2022-10-30-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin

installed targets for active toolchain
--------------------------------------

aarch64-apple-darwin
wasm32-unknown-unknown

active toolchain
----------------

nightly-2022-10-30-aarch64-apple-darwin (default)
rustc 1.66.0-nightly (5e9772042 2022-10-29)

Converting Raw Format

./target/release/node-template build-spec --chain=customSpec.json --raw --disable-default-bootnode > customSpecRaw.json
Error: Service(Other("Error parsing spec file: trailing characters at line 30 column 13"))
2023-03-29 19:06:14 Building chain spec
{
  "name": "development",
  "id": "dev",
  "chainType": "Development",
  "bootNodes": [],
  "telemetryEndpoints": null,
  "protocolId": null,
  "properties": {
    "ss58Format": 42,
    "tokenDecimals": "8",
    "tokenSymbol": "TOKEN"
  },
  "codeSubstitutes": {},
  "genesis": {
    "runtime": {
      "system": {
        "code": "code hash is huge so removed"
      },
      "aura": {
        "authorities": [
          "5G23QwkKM3u1ssrkZW4UYayBmnSV2VtetgnSFhhWpdjACe9N",
          "5Hp4YMLZBEveQQUwiVcYCFYSngmFiWUaspKGEzLepuNXE5C1"
        ]
      },
      "grandpa": {
        "authorities": [
          [
            "5Cx5UcnGQMRNtKh63UR5BYMh3SAg3ivKh5wSki24wchvZyGo",
            1,
            "5DHXJTByBPsUf7xRzJXtBAAFdtF26pyi4iYZccNzHFxM5kDa",
            10
          ]
        ]
      },
      "balances": {
        "balances": [
          ["5G23QwkKM3u1ssrkZW4UYayBmnSV2VtetgnSFhhWpdjACe9N", 1000000000000],
          ["5Hp4YMLZBEveQQUwiVcYCFYSngmFiWUaspKGEzLepuNXE5C1", 1000000000000],
          ["5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", 1000000000000]
        ]
      },
      "transactionPayment": {
        "multiplier": "1000000000000000000"
      },
      "sudo": {
        "key": "5G23QwkKM3u1ssrkZW4UYayBmnSV2VtetgnSFhhWpdjACe9N"
      },
      "assets": {
        "assets": [],
        "metadata": [],
        "accounts": []
      }
    }
  }
}

3
  • You must have entered any parameter wrong can you share your custom spec file here Mar 29, 2023 at 13:06
  • @ShubhamGupta, I have updated my chain-spec.
    – nagaraj
    Mar 29, 2023 at 13:09
  • try changing grandpa authority value at line 31 to 1 instead of 10 Mar 29, 2023 at 13:16

1 Answer 1

1

The error was in the line number 31

From this

"grandpa": {
        "authorities": [
          [
            "5Cx5UcnGQMRNtKh63UR5BYMh3SAg3ivKh5wSki24wchvZyGo",
            1,
            "5DHXJTByBPsUf7xRzJXtBAAFdtF26pyi4iYZccNzHFxM5kDa",
            10
          ]
        ]
      },

Update to this

"grandpa": {
        "authorities": 
    [["5Cx5UcnGQMRNtKh63UR5BYMh3SAg3ivKh5wSki24wchvZyGo",1,], 
    ["5DHXJTByBPsUf7xRzJXtBAAFdtF26pyi4iYZccNzHFxM5kDa",10] ]
   },

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.