I'm trying to launch a private PoA chain with two nodes, using validator smart contract.
Nodes use keys from Demo PoA Tutorial
Peers see each others and smart contract with address 0x0000000000000000000000000000000000000005 returns validators account addresses. But when i try to deploy contract tx created, but not mined and no block is sealed.
Could you give some example to launch this kind of config.
Also, when i try to use parameter safeContract (mentioned here) for validators field , then parity throws error about invalid specification
chain spec
{
"name": "mychain",
"engine": {
"authorityRound": {
"params": {
"gasLimitBoundDivisor": "0x400",
"stepDuration": "3",
"validators": {
"contract": "0x0000000000000000000000000000000000000005"
}
}
}
},
"params": {
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID": "0x2323"
},
"genesis": {
"seal": {
"authorityRound": {
"step": "0x0",
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x20000",
"gasLimit": "0x7A12000"
},
"accounts": {
"0x0000000000000000000000000000000000000005": {
"balance": "1",
"constructor" : "{contract byte code here}"
}
}
}
Validators smart contract (from example TestList contract)
pragma solidity ^0.4.6;
contract MyChainValidators {
address[] public validators = [ 0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e, 0x00Aa39d30F0D20FF03a22cCfc30B7EfbFca597C2];
mapping(address => uint) indices;
address public disliked;
function TestList() {
for (uint i = 0; i < validators.length; i++) {
indices[validators[i]] = i;
}
}
// Called on every block to update node validator list.
function getValidators() constant returns (address[]) {
return validators;
}
// Expand the list of validators.
function addValidator(address validator) {
validators.push(validator);
}
// Remove a validator from the list.
function reportMalicious(address validator) {
validators[indices[validator]] = validators[validators.length-1];
delete indices[validator];
delete validators[validators.length-1];
validators.length--;
}
function reportBenign(address validator) {
disliked = validator;
}
}
keys are unlocked in node configuration
[account]
password = ["my-node.pwds"]
unlock = ["0x00aa39d30f0d20ff03a22ccfc30b7efbfca597c2"]
[mining]
engine_signer = "0x00aa39d30f0d20ff03a22ccfc30b7efbfca597c2"
reseal_on_txs = "none"
usd_per_tx = "0"
Can you post the bytecode included in the spec?
Compiled via https://ethereum.github.io/browser-solidity/
Solidity version: 0.4.9+commit.364da425.Emscripten.clang
Optimization not enabled
0x606060405260406040519081016040528072bd138abd70e2f00903268f3db08f2d25677c9e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200172aa39d30f0d20ff03a22ccfc30b7efbfca597c273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681525060009060026100a89291906100b6565b5034156100b157fe5b610183565b82805482825590600052602060002090810192821561012f579160200282015b8281111561012e5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906100d6565b5b50905061013c9190610140565b5090565b61018091905b8082111561017c57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101610146565b5090565b90565b6106e7806101926000396000f30060606040523615610081576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806335aa2e441461008357806337e09b95146100e35780634d238c8e146100f5578063b7ab4db51461012b578063bfc708a0146101a0578063d8f2e0bf146101d6578063fd6e1b5014610228575bfe5b341561008b57fe5b6100a1600480803590602001909190505061025e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100eb57fe5b6100f361029e565b005b34156100fd57fe5b610129600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610343565b005b341561013357fe5b61013b6103ab565b604051808060200182810382528381815181526020019150805190602001906020028083836000831461018d575b80518252602083111561018d57602082019150602081019050602083039250610169565b5050509050019250505060405180910390f35b34156101a857fe5b6101d4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610440565b005b34156101de57fe5b6101e66105bf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561023057fe5b61025c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105e5565b005b60008181548110151561026d57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600090505b60008054905081101561033f5780600160006000848154811015156102c657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b80806001019150506102a5565b5b50565b60008054806001018281610357919061062a565b916000526020600020900160005b83909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b50565b6103b3610656565b600080548060200260200160405190810160405280929190818152602001828054801561043557602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116103eb575b505050505090505b90565b600060016000805490500381548110151561045757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548154811015156104d257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009055600060016000805490500381548110151561057657fe5b906000526020600020900160005b6101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560008054809190600190036105ba919061066a565b505b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b815481835581811511610651578183600052602060002091820191016106509190610696565b5b505050565b602060405190810160405280600081525090565b815481835581811511610691578183600052602060002091820191016106909190610696565b5b505050565b6106b891905b808211156106b457600081600090555060010161069c565b5090565b905600a165627a7a7230582039c6339735f6181d162508bc3d99c34746e047dd83b8f796cdb56a6cb260ac430029
I can not replicate it with a recent version of Parity, what version were you running? "safeContract" should load up fine in 1.5.
I have the same issue of "safeContract" showing invalid, and transaction not mined using "contract".
I've tried parity 1.5.4 and 1.5.6 on Windows. Mining is fine when I use "list".
version Parity/v1.5.4-beta-74b850e-20170223/x86_64-linux-gnu/rustc1.15.1, with "list" configuration works, with "contract" - not
Ok, sorry, seems like not everything was backported into 1.5. I will mark in docs that the contracts are available only from 1.6 (soon to be released) and 1.5 only officially supports "list".
For now before 1.6 is released can you use parent-state branch and indicate if it works well there.
Added some docs here.
Try 1.6.2 version, at first glance it works, thank you!
Most helpful comment
Ok, sorry, seems like not everything was backported into 1.5. I will mark in docs that the contracts are available only from 1.6 (soon to be released) and 1.5 only officially supports "list".
For now before 1.6 is released can you use
parent-statebranch and indicate if it works well there.