_Before filing a new issue, please provide the following information._
I am running a single node using parity with Authority round engine.
chain specs file:
{
"name": "DemoPoA",
"engine": {
"authorityRound": {
"params": {
"stepDuration": "5",
"validators": {
"list": [
"0xc648a00f39b8605cf036f9ed8dc40ff4f164836f"
]
},
"blockReward": 0
}
}
},
"params": {
"gasLimitBoundDivisor": "0x400",
"maximumExtraDataSize": "0x20",
"minGasLimit": "0x1388",
"networkID": "0x2323",
"eip155Transition": 0,
"validateChainIdTransition": 0,
"eip140Transition": 0,
"eip211Transition": 0,
"eip214Transition": 0,
"eip658Transition": 0
},
"genesis": {
"seal": {
"authorityRound": {
"step": "0x0",
"signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
},
"difficulty": "0x20000",
"gasLimit": "0x5B8D80"
},
"accounts": {
"0x0000000000000000000000000000000000000001": {
"balance": "1",
"builtin": {
"name": "ecrecover",
"pricing": {
"linear": {
"base": 3000,
"word": 0
}
}
}
},
"0x0000000000000000000000000000000000000002": {
"balance": "1",
"builtin": {
"name": "sha256",
"pricing": {
"linear": {
"base": 60,
"word": 12
}
}
}
},
"0x0000000000000000000000000000000000000003": {
"balance": "1",
"builtin": {
"name": "ripemd160",
"pricing": {
"linear": {
"base": 600,
"word": 120
}
}
}
},
"0x0000000000000000000000000000000000000004": {
"balance": "1",
"builtin": {
"name": "identity",
"pricing": {
"linear": {
"base": 15,
"word": 3
}
}
}
},
"0xc648a00f39b8605cf036f9ed8dc40ff4f164836f": {
"balance": "10000000000000000000000"
}
}
}
node.toml file:
[parity]
chain = "demo-spec.json"
base_path = "chains/parity0"
[network]
port = 30300
[rpc]
port = 8540
apis = ["web3", "eth", "net", "personal", "parity", "parity_set", "traces", "rpc", "parity_accounts"]
[websockets]
port = 8450
[account]
password = ["node.pwds"]
unlock = ["0xc648a00f39b8605cf036f9ed8dc40ff4f164836f"]
[mining]
engine_signer = "0xc648a00f39b8605cf036f9ed8dc40ff4f164836f"
reseal_on_txs = "none"
truffle.js
module.exports = {
networks: {
development: {
host: "localhost",
port: 8545,
network_id: "*"
},
parity: {
host: "localhost",
port: 8540,
network_id: "*",
from: "0xc648a00f39b8605cf036f9ed8dc40ff4f164836f"
}
}
};
I have a smart contract that is deploying successfully on ganache development network. But I'm failing to deploy it to the parity private network.
$ truffle migrate --network parity
Using network 'parity'.
Running migration: 1_initial_migration.js
Deploying Migrations...
... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Your account is locked. Unlock the account via CLI, personal_unlockAccount or use Trusted Signer.
Edit: after adding unlock = ["0xc648a00f39b8605cf036f9ed8dc40ff4f164836f"] as suggested by @ddorgan, I'm getting this RPC Response:
{"jsonrpc":"2.0","error":{"code":-32020,"message":"Your account is locked. Unlock the account via CLI, personal_unlockAccount or use Trusted Signer.","data":"NotUnlocked"},"id":6}
It seems that the node didn't unlock the account properly
https://github.com/trufflesuite/truffle/issues/389
https://github.com/trufflesuite/truffle/issues/624
sounds related to these issues? ^^
I'm uncertain if there are any workarounds, but it seems to be fixed in the latest versions? https://github.com/ethereum/web3.js/pull/936 People bump into the issue regularly so I'm not certain that is the case..
If you run your migration with --verbose-rpc you'll be able to confirm whether you received a transaction receipt for the deployment. If you want to check this, you can make an rpc request to parity using eth_getTransactionReceipt, passing the hash as the parameter. If that works then it's likely the same issue that @joshua-mir linked above.
I think this is still an issue with current truffle.
@iaaly if you open the parity ui and connect it to your websocket port you'll notice a pending authorization. This is because you haven't unlocked the account.
Edit your node.toml and include an unlock statement in the account section:
[account]
password = ["node.pwds"]
unlock = ["0xc648a00f39b8605cf036f9ed8dc40ff4f164836f"]
@ddorgan good catch thanks.
Now I'm having a weird problem after I've added the unlock line as you suggested
unlock = ["0xc648a00f39b8605cf036f9ed8dc40ff4f164836f"]
I'm getting this RPC Response after calling truffle migrate:
{"jsonrpc":"2.0","error":{"code":-32020,"message":"Your account is locked. Unlock the account via CLI, personal_unlockAccount or use Trusted Signer.","data":"NotUnlocked"},"id":6}
It seems that the node didn't unlock the account properly, how do you think I can debug that issue?
Did you add a password file containing the password for the account you want to unlock?
@joshua-mir yes I did, it has a single line containing the password for the account
This issue is similar to my case now.
Please use the basicAuthority engine when only using a single signer.
@iaaly if you open the parity ui and connect it to your websocket port you'll notice a pending authorization. This is because you haven't unlocked the account.
Edit your node.toml and include an unlock statement in the account section:
[account] password = ["node.pwds"] unlock = ["0xc648a00f39b8605cf036f9ed8dc40ff4f164836f"]
Adding unlock in toml file works for me . Thanks
Most helpful comment
@iaaly if you open the parity ui and connect it to your websocket port you'll notice a pending authorization. This is because you haven't unlocked the account.
Edit your node.toml and include an unlock statement in the account section: