i am using corda os 4.4, and i am trying to use postgresql instead of h2. i managed to get my node running initially after running "gradle clean deployNodes" and "runnodes", but after i shutdown the nodes and try running them again using "gradle clean deployNodes", i see the following error:
[ERROR] 15:01:30+0800 [main] internal.NodeStartupLogging. - Exception during node startup: Private key for the node legal identity not found (alias identity-private-key) but the corresponding public key for it exists in the database. This suggests the identity for this node has been lost. Shutting down to prevent network map issues. [errorCode=r5hpbl, moreInformationAt=https://errors.corda.net/OS/4.4/r5hpbl]
here are the settings for one of my nodes:
node {
name "O=test1,L=test2,C=test3"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
rpcUsers = [[ user: "user1", "password": "test", "permissions": ["ALL"]]]
extraConfig = [
"dataSourceProperties.dataSourceClassName" : "org.postgresql.ds.PGSimpleDataSource",
"dataSourceProperties.dataSource.url" : "jdbc:postgresql://localhost:5432/postgres",
"dataSourceProperties.dataSource.user" : "corda-node-test",
"dataSourceProperties.dataSource.password" : "password",
"database.transactionIsolationLevel" : "READ_COMMITTED",
"database.initialiseSchema" : "true",
"jarDirs" : [ "../../../libs" ]
]
}
The only way I can remove this error is to drop the whole schema and recreate them:
DROP SCHEMA "corda-node-test_schema" CASCADE;
CREATE USER "corda-node-test" WITH LOGIN PASSWORD 'password';
CREATE SCHEMA "corda-node-test_schema";
GRANT USAGE, CREATE ON SCHEMA "corda-node-test_schema" TO "corda-node-test";
GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON ALL tables IN SCHEMA "corda-node-test_schema" TO "corda-node-test";
ALTER DEFAULT privileges IN SCHEMA "corda-node-test_schema" GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON tables TO "corda-node-test";
GRANT USAGE, SELECT ON ALL sequences IN SCHEMA "corda-node-test_schema" TO "corda-node-test";
ALTER DEFAULT privileges IN SCHEMA "corda-node-test_schema" GRANT USAGE, SELECT ON sequences TO "corda-node-test";
ALTER ROLE "corda-node-test" SET search_path = "corda-node-test_schema";
but after i start it up, and try to run "gradle clean deployNodes" again, im back to square one. anyone got any ideas or suggestions? Thanks!