Chain Specification - Wiki Parity Ethereum Documentation

By default, when simply running parity, Parity Ethereum will connect to the official public Ethereum network.

In order to run a chain different to the official public Ethereum one, Parity has to run with the --chain option or with a config file specifying chain = "path" under [parity]. There are a few named presets that can be selected from or a custom JSON spec file can be supplied.

Chain presets available

Private chains

Parity supports private chain and private network configuration via Chain specification file provided with --chain. In addition to the usual Proof of Work Chains, Parity also includes Proof of Authority Chains which do not require mining. More details on the available options can be found on the Pluggable Consensus page.

JSON chain spec format

A JSON file which specifies rules of a blockchain, some fields are optional which are described following the minimal example, these default to 0.

{
	"name": "CHAIN_NAME",
	"engine": {
		"ENGINE_NAME": {
			"params": {
				ENGINE_PARAMETERS
			}
		}
	},
	"genesis": {
		"seal": {
			ENGINE_SPECIFIC_GENESIS_SEAL
		},
		"difficulty": "0x20000",
		"gasLimit": "0x2fefd8"
	},
	"params": {
			"networkID" : "0x2",
			"maximumExtraDataSize": "0x20",
			"minGasLimit": "0x1388"
	},
	"accounts": {
		GENESIS_ACCOUNTS
	}
}

Optional spec fields:

Example :

"hardcodedSync": {
		"header": "f90219a061d694007fbaca6e23e73e29c8c6a60099abc740ab7e27ae3cd1b9c6a47efef7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347945a0b54d5dc17e0aadc383d2db43b0a0d3e029c4ca0a2f1bdabc1a72737de1c22a76cacc8fc162366904f759a99db7d6d19efee3090a0ac5f5b236e8977928a2ce43c7569ea5a74919643cb0b06d7540407b1ea1298f0a04356ddc5d77c83923a6541260308be167386e0969a608a017770c9e38091cfcab90100a00010002001009080011010141088000004000080081100000a002023000002204204801204084000c000010008000000000880080020c0000440200460000290005010c01c80800080004800100406003380000400402040000028084002a80087000008090a00200100544020019580022000000306100a0080100084020006809000e80000010000254810002000000a240050014200002002c10809202030006422022000203012000241089300080400000009001021020200012410348500028290230408100302000000058c0000020c08c20480081040020260004008481000080000800010010060020000e00020002140100a8988000004400201870b9af4a66df8038350a8018379d54483799eba845ab0426d984554482e45544846414e532e4f52472d3231323134313232a05eeccc80302d8fecca48a47be03654b5a41b5e5f296f271f910ebae631124f518890074810024c6c2b",
		"totalDifficulty": "3144406426008470895785",
		"CHTs": [
			"0x0eb474b7721727204978e92e27d31cddff56471911e424a4c8271c35f9c982cc",
			"0xe10e94515fb5ffb7ffa9bf50db4a959b3f50c2ff75e0b8bd5f5e038749e52a11",
			"0x816e7463af7b5d2fcb804ba55f09e8452182b0ba6c995a34e144245d76333d55",
			"0x3793af64c1ddc07ab61b2ba120034d91c02183ff788f07d3120fd4e6a48305b5",
			"0x14c6106a17e041032210bfa0ca80d11860a1c6d95175d55eff39f97b8d8acded",
			"0x396f832bfa3a9c494e9245471f0e65552613d87b6fe62128103590d95de72c2d",
...
			"0xb060979f095c170a776b2b50a1e2ab0ffea80f6e522753fa36ad6f106ee32e9f",
			"0x8f452e7cbd8a333ed04d819a143a8d3a75fe8c58418e7fc420bb2a717c0d4d2f",
			"0x37fe1b0cf156bfc07571569af210540be753777903a308d5707538fffed75b59",
			"0x6f0561d017cfc123b3f0d37b044e4f7231516b8731a1cab89afb569238643c33",
		]
}

Coming from Geth

To connect to a Geth node or just use the same network setup you can use the genesis converter to generate a Parity compatible chain specification file or the preconfigured cross-client chain specifications to get started quickly. The chain spec can be then used by supplying it to the --chain Parity option.

To replicate some of the more obscure bugs from Geth’s RPC, --geth option can be used; be warned, this disables some of the more advanced Parity features so only use it if you know you have to.