Skip to content
Snippets Groups Projects
Commit 509fb0cf authored by Boyan Tsolov's avatar Boyan Tsolov
Browse files

Merge branch 'develop' into 'main'

ID Union support

See merge request gaiax/ocm/ssi-abstraction!25
parents 9772df01 28692f96
No related branches found
No related tags found
No related merge requests found
Pipeline #21103 failed
......@@ -10,9 +10,10 @@ AGENT_PEER_PORT=:4000
AGENT_URL_PATH=/ocm/abstraction
AGENT_PUBLIC_DID_SEED=6b8b882e2618fa5d45ee7229ca880083
AGENT_AUTO_ACCEPT_CONNECTION=true
AGENT_AUTO_ACCEPT_CREDENTIAL=true
AGENT_AUTO_ACCEPT_CREDENTIAL=contentApproved
AGENT_WALLET_KEY=ssi-wallet-key
AGENT_WALLET_ID=ssi-wallet-id
AGENT_LEDGER_ID=GREEN_LIGHT
\ No newline at end of file
AGENT_LEDGER_ID=ID_UNION,BCOVRIN_TEST
AGENT_ID_UNION_KEY=example-example-example-example
\ No newline at end of file
......@@ -38,4 +38,7 @@ logs/log.json
#Env files
**/*.env
!config/env/development.env
.idea
\ No newline at end of file
.idea
#DOCS
AGENT-DOCUMENTATION.md
\ No newline at end of file
This diff is collapsed.
......@@ -11,15 +11,13 @@
[Aries REST Extension](swagger.json)
[Full Agent Endpoints](AGENT-DOCUMENTATION.md)
[Full Agent Events](EVENTS-DOCUMENTATION.md)
[Sign and Verify Interface](SIGN-AND-VERIFY.md)
with the default exposed ports:
* 3010 - Aries REST extension
* 3009 - full agent exposed
* 3009 - Sign and Veify interface exposed
* 4000 - didcomm interface
......@@ -45,6 +43,22 @@ https://dbeaver.io/download/
## Running the app
<hr/>
### Environment variables
[.env.example](.env.example)
* PORT is the port for the signing and verification interface
* AFJ_EXT_PORT is the port for the openapi documentation described in [swagger.json](swagger.json)
* AGENT_AUTO_ACCEPT_CONNECTION can be either true or false
* AGENT_AUTO_ACCEPT_CREDENTIAL can be either: always, contentApproved, never
* AGENT_PUBLIC_DID_SEED will generate the did and verkey (32 symbols)
* for security reasons AGENT_WALLET_KEY and AGENT_WALLET_ID should be different
* AGENT_LEDGER_ID can be: ID_UNION,BCOVRIN_TEST,GREEN_LIGHT
- the three pool transaction genesis are inside the code configuration
- every ledger can be provided on its own
- multiple ledgers can also be specified, separated by a comma
* AGENT_ID_UNION_KEY is needed if the ledger of choice is IDUnion
**Each service in the Organizational Credential Manager can be run from the infrastructure repository with Docker.**
**The .env files are in the infrastructure repository under /env**
......
......@@ -21,6 +21,7 @@ interface Config {
publicDidSeed: string;
autoAcceptConnection: boolean;
autoAcceptCredential: AutoAcceptCredential;
idUnionKey: string;
},
}
......@@ -45,6 +46,7 @@ const config = (): Config => ({
publicDidSeed: process.env.AGENT_PUBLIC_DID_SEED || '',
autoAcceptConnection: process.env.AGENT_AUTO_ACCEPT_CONNECTION === 'true',
autoAcceptCredential: process.env.AGENT_AUTO_ACCEPT_CREDENTIAL as AutoAcceptCredential,
idUnionKey: process.env.AGENT_ID_UNION_KEY || '',
},
});
......
......@@ -14,6 +14,7 @@ const validationSchema = Joi.object({
AGENT_PUBLIC_DID_SEED: Joi.string().required(),
AGENT_AUTO_ACCEPT_CONNECTION: Joi.boolean().required(),
AGENT_AUTO_ACCEPT_CREDENTIAL: Joi.string().required(),
AGENT_ID_UNION_KEY: Joi.string(),
});
export default validationSchema;
import logger from '@src/globalUtils/logger';
export function logAxiosError(err: any) {
if (err.response) {
logger.error('Request made and server responded: ');
logger.error(`Data: ${err.response.data}`);
logger.error(`Status: ${err.response.status}`);
logger.error(`Headers: ${err.response.headers}`);
} else if (err.request) {
logger.error('The request was made but no response was received: ');
logger.error(err.request);
} else {
// Something happened in setting up the request that triggered an Error
logger.error('Request error: ', err.message);
}
}
export default {
logAxiosError,
};
// TODO: move to config, after implementation of more than 1 ledger
import config from '@config/config';
export const LEDGER_GENESIS = {
ID_UNION: `{"reqSignature":{},"txn":{"data":{"data":{"alias":"MainIncubator","blskey":"14MPfxHnRvCL5dnbpD3SjxekAGnKyjkmifDFLnMJAvHcvEAarDLWX6KawhubPujSmmUMqRmQfPQzBambrdUqBGgHDryDS6Aj8BioWRwZkyTcH1zzkVQ7vZjE5S6ri5epkiS1VkVX42Z22z4cohdHVuKTgeQB5mjAwi55xNeRxpxhrNb","blskey_pop":"QoqRe3vMPr5Bt1qHDstYewWkxb5VEdugnvumLCWpkZAeUpdqjjaSTSKKJtT7U7aCe8CmShGSdCZFWs9hcpmMSGfMnmon7R99UTJj4jEr48smyxo1UpBcgooznc8N8USkZ8hSec3bRbN9y6NppuaFzfgt1WmJ3cdFi9L1Wbj1fNs5CK","client_ip":"35.207.81.15","client_port":"9702","node_ip":"35.207.81.15","node_port":"9701","services":["VALIDATOR"]},"dest":"EQ2oCtWpMdUCzKgQ2hvbyQ2i6VyJuQF9LcpHRfiah6rW"},"metadata":{"from":"2MZYuPv2Km7Q1eD4GCsSb6"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"0a35c047f19448f12a0c2961d8e3085140b8149d87291acbdaf56ed956900d48"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"tubzecm","blskey":"3Zpdx6LMWPdybnQKPq62S3TaWUhwypr7RV2BBFkeFigjKuue7KJ7rh5w1gZY9qgugww9vZnpURLSjBuTonJpfyfN5nn2ofwFQQa3viiT77hhFf6kQqoMH53f66ZfBNWU2LzphQikXsma9zjZWALMtMsNWx7ftNZ8yzMrZpf1X6VqYX5","blskey_pop":"RbPQSMsV8iuxNXVFNEUPvb6k1wQe1rxaXroMMkpHTstiiJfCApER38jW79Ew1yrnt5ndz7wJeDRU7CkLNzJ6pEZaRYjLzhZL2shRgyaGqnMqkxvD1ewxNMSz7cSgBSChwUgLBxsms5iDyshwAM5dx8B1GayMyATcFxAdgCRiDv3EHm","client_ip":"141.23.35.186","client_port":"9702","node_ip":"141.23.35.186","node_port":"9701","services":["VALIDATOR"]},"dest":"Ddqm5GATTcEb5hrgMBbVL8w6R6mtTHjUpdpyCeWg3pVS"},"metadata":{"from":"JhyMn8Nn3xy2zsXjPaPu3B"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"e2f9efff1bfef015098ae299a665154fa39a898a5071d0af03c7f2311fe8577f"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Bosch","blskey":"WNBd2CBPJMSaBan72XhY1v5XSkExX7GRCqxM7WNSfveoDcHSLXbQ59K1mWAcgoJZd89NaYa5pLb7N3AcLxSNUj8HJXwjd8jMECvX9iiGESVn2ssb8VFX2TDE2RBVC4nU5jDexzpwqnhJk27ev64J8H21SpbBecbHvP49ZQpRVaq6WL","blskey_pop":"QkmprUBuiKmoUGkFLGVbozGfiFRcNnjfyL8Zg4VfjPpUT7i8YPoPExbDhFxUKofgavJ1ZEsG8VZECpNDC75anfTfivsuMBr5w4a31ZKuqwCscAXzmeTPrkTPo7QLXuYc1SQMTjrm8YEkBYzHuXktJzkJXvLERnoAdLWqPqMyYWUzGo","client_ip":"20.52.38.11","client_port":"9702","node_ip":"20.52.38.11","node_port":"9701","services":["VALIDATOR"]},"dest":"9oB1GdDzFyn4p1Pb6BotYuSXozdwDWXW5s2jRjg86KpZ"},"metadata":{"from":"K3Bf63TUe3nTj1SKuQVZ2e"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"865ce0cf621e0d5f9c2dccb9e5079733a83d80ea2e814d32c3300bc2c2755b7b"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Bundesdruckerei","blskey":"ypA6Fzaqx3WgyeBWjahz94ZYMXdyRuC9v4NruuNVehxt3VgyRPnBeiRxNcXuN9x7PgD4Y585EkAZMSEUrpego9H75hiNppqFTBppPh8cMisKKxW2qZmePnwM8AR2MkWfsytP64AcZFxhXQw1Sx9SeDZwEZAhzNFg2CGY1Ywf1VyCkB","blskey_pop":"RBGcyWimwwZhTtJrW8f3br5osAFkSbpEsEyR3UtX3Lq82kFCA2yEn1H2HHYapmQ5KQ42ZAE2srfjYa5ihZGgs96oxAHpKdkPWX4rXcnxyFcbPihDCmqY9YvnR6DrzfLMc9ew5ac6xeQfiefiEZGMENFsehLPtiQyohSzZBFEqB8Tdy","client_ip":"193.28.64.163","client_port":"9702","node_ip":"193.28.64.163","node_port":"9701","services":["VALIDATOR"]},"dest":"8CMjmTUmAULZ25XUmLx3Gd2HX8bKf5uwPvF6oxcv3qfz"},"metadata":{"from":"BdrsFY8EFRNDwQpdKb6f5k"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"8406be5a8bde1145f642a9955a80475c7256a9957b3a984c74ca6a8484f9c0f7"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"esatus_AG","blskey":"2L1Egvidsqj44HosrLCUXDgCLC9g9SwU6XD3wY6XiudgWajEM6zpxVzvyagB4SY8ZgWinAnBRjQv2zdsUHrfdFCfEm6csB9sgG2HryqcLgLUtskSrctSEd7AgYTAE3mcYdZmGAACTQgkskkcNkmFh61Rh9uADyP6xoDoT7PXPgmW5Wx","blskey_pop":"RGtbexx5BMxZhr7hnEaPqPGvEQANjZozqdZk5fDJBXRLcnQwnii4YYefpvSCpBLnsy6iTBQTFQpUfs2gvwM92Cyi1J2SivPJF1hKr7FmiZbWuoR7dRpdJGFYw7avU12T6yYFjiwLieJ5LsHVyosHVLj1XDrrHKBBsEUFRHJCp8GBhZ","client_ip":"194.110.133.202","client_port":"9702","node_ip":"194.110.133.202","node_port":"9701","services":["VALIDATOR"]},"dest":"BQ1YEL8oXssKxaF4ZVwZCCk3px4BxDjVim3pFG8Y5Gk6"},"metadata":{"from":"PbvRAYyQfi1GS8ioCNZXTp"},"type":"0"},"txnMetadata":{"seqNo":5,"txnId":"b26a8b1ec76a165330faf13f0b9565f8167211c37d83845226b7986dd0f624e3"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Commerzbank","blskey":"4Y5aB7ywZaw2Vqg63Mb2XiaQbaxCwUS1zSkczTzTS6dg8FCzqJdmvkU9PucY4A144VjoubvQLS6Cxvt9ZRcWr1NTdUX6f3LYqCyp1W5vFWn2s8pLSirimxGcZuhNp8XYRJGYsMjH781cgoriEB1R6GBxP6u7PamA7zybYqdng5GKcr7","blskey_pop":"RVYvd1Pf6wGyEXTsGQpHtV3M3vzCvXernbdLxa6ngBrkShDhR1TbbzrHsNsbkoZeimdtcJ2quNqux57k3RbyuggB86kCjH7asmkKp7w8Pa4Pzrzy3hyvTQ8qwNiZZmNb3CEXNWFctkXBeLeB6ip5z3TWoYDx7LWBC3b5KLtjbhgN6K","client_ip":"20.52.50.218","client_port":"9702","node_ip":"20.52.50.218","node_port":"9701","services":["VALIDATOR"]},"dest":"5coVfaQRWkjapQTxvJutUciSHLRwzk8yuR2CngufN78T"},"metadata":{"from":"9UMDJTxi6RHtGmYdUJr6iR"},"type":"0"},"txnMetadata":{"seqNo":6,"txnId":"f630e5a6719c639039ad66be6e3ed30b54ace3bb2ef5eaa84e7f3d5ee2b5e2a9"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"DeutscheBahn","blskey":"4nJSdxfx7MPdBH1ioFy4dk9hDgRV1D21JTKbWCkWAtvqwnMNfLgg8qrXhuNf5Ux8owBjMZPPQMiYsgwd7UbBTKmi8P4Hef6udXDq7p2EYGcM512JRRi8Z6igeijcRinnzLTM3Bso7xjJngaohMTZ2yNdRmB5WuyJKbZfr5qRbzEReMd","blskey_pop":"RZTAfkfry51g41qCVbYkKbsE9Nw16hx9k6Dnnun4vJbFLbtnyvuRfWHUVrjvfdbq48MRRRyY3miVGgxdugKMCSA9LxzmXJSCJG2Hxck2xsiFKUzznsqF6DWtGfo639WNz4Qk5xCvbDxhmmRYmZ3mJhUg8X3MEoCkQCsqAEi2oAQg9D","client_ip":"81.200.193.232","client_port":"9702","node_ip":"81.200.193.232","node_port":"9701","services":["VALIDATOR"]},"dest":"Ahb65rjbm94hNxM8jynTbWBMZyNmuuvtvsCAyntKSd3k"},"metadata":{"from":"JoCzEPXHeef6zYoXGx87aZ"},"type":"0"},"txnMetadata":{"seqNo":7,"txnId":"58b0a0cb860a20b41082d4d1b2419867156ca7aea3a0bdf2bdb318a270a6a367"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"siemens","blskey":"2DpsFyaZFWpHChf9pbHiNtZx9ze7RfzRhdnaAp3ZHZmLrZivyyMcnM7xhyKoc9LkZCAd1kuQHtfYNtAW4yY4DsoDQnXzKmWkLbRRwA8aNjxFK1uGP8npAXpVNTnWieNuQpj9EgQSDU5WJYR3SDgrV7sx51vwsa6ggkhAJNENyMRqZHY","blskey_pop":"RCx6QwyeaLpAHaD3AGgGZSNqyxQLsaAa9H2kKoQAMpQXkh9XZfsZtGbZTvPK2ZTXHMVvUyfCmWvaM8YxuJGRZ7QQTFAg9ECaqLPKexrp3P4huHMMs7nzj992ECVnuu66Dppbn6AEEF46NQXcXEDsEquHEHhuzD1JV9oAvcqaPGu2Hm","client_ip":"3.120.0.165","client_port":"9702","node_ip":"3.120.0.165","node_port":"9701","services":["VALIDATOR"]},"dest":"9XrquGpmLMXq5v5UuVLmPdZ5nPVDbdtMLSEWzE9Phm8H"},"metadata":{"from":"GewebF4Nq1LLRw5gwX1Dwv"},"type":"0"},"txnMetadata":{"seqNo":8,"txnId":"30e363d3e8c59f2c1319f8d73d48e3ad26db5e087951a4d7ab809c6f5401aea8"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"T-Labs","blskey":"qLCWHTGoARJxSM8yCj3zDnx4gUDaTwMoX2v9enhYTg1FRLN2Wcu9Dg91hrHKcrp1RiJMphAvRYbpXZLYN7AGiu3vCfiTfSuwM9qEWmhRe23KF67kQyRDNDVa8PZjPL7xhtsQRkJ5Gox3H6TmC8H2JFYBZ5JwcbieGfZMzMF5eDku1c","blskey_pop":"RPrk8q1pZAQhzEM8KhPTp9BKixe2PrJFJFhEV6M3uq8qDrUvpbZEWJUvm9iPnfh5cXrXTojNFo472XrVtbcxtnRwxz9Xrm2dfbARu5Gjxd5s9TGn145iKuzEEFrVt2usyf18E8XudD4ZwPovVVQgp9seKStnfYPKVTYTp726Ps5fQs","client_ip":"185.27.183.119","client_port":"9702","node_ip":"185.27.183.119","node_port":"9701","services":["VALIDATOR"]},"dest":"9k4Sjfxg2XqP2GcVAPHFuVJeY2bLbSUCPcVty6FRLzbY"},"metadata":{"from":"Ta94MpvKrQwTtiNMegQMvs"},"type":"0"},"txnMetadata":{"seqNo":9,"txnId":"1626d887a6323309883ab5fb8381f6176ab5e4ff4502389bb2978daee076cc39"},"ver":"1"}`,
BCOVRIN_TEST: `{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.138.255","client_port":9702,"node_ip":"138.197.138.255","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.138.255","client_port":9704,"node_ip":"138.197.138.255","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"138.197.138.255","client_port":9706,"node_ip":"138.197.138.255","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"138.197.138.255","client_port":9708,"node_ip":"138.197.138.255","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"}`,
ID_UNION: `{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"40.89.175.63","client_port":9702,"node_ip":"40.89.175.63","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"40.89.175.63","client_port":9704,"node_ip":"40.89.175.63","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"40.89.175.63","client_port":9706,"node_ip":"40.89.175.63","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"40.89.175.63","client_port":9708,"node_ip":"40.89.175.63","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"}`,
GREEN_LIGHT: `{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node1","blskey":"4N8aUNHSgjQVgkpm8nhNEfDf6txHznoYREg9kirmJrkivgL4oSEimFF6nsQ6M41QvhM2Z33nves5vfSn9n1UwNFJBYtWVnHYMATn76vLuL3zU88KyeAYcHfsih3He6UHcXDxcaecHVz6jhCYz1P2UZn2bDVruL5wXpehgBfBaLKm3Ba","blskey_pop":"RahHYiCvoNCtPTrVtP7nMC5eTYrsUA8WjXbdhNc8debh1agE9bGiJxWBXYNFbnJXoXhWFMvyqhqhRoq737YQemH5ik9oL7R4NTTCz2LEZhkgLJzB3QRQqJyBNyv7acbdHrAT8nQ9UkLbaVL9NBpnWXBTw4LEMePaSHEw66RzPNdAX1","client_ip":"138.197.161.221","client_port":9702,"node_ip":"138.197.161.221","node_port":9701,"services":["VALIDATOR"]},"dest":"Gw6pDLhcBcoQesN72qfotTgFa7cbuqZpkX3Xo6pLhPhv"},"metadata":{"from":"Th7MpTaRZVRYnPiabds81Y"},"type":"0"},"txnMetadata":{"seqNo":1,"txnId":"fea82e10e894419fe2bea7d96296a6d46f50f93f9eeda954ec461b2ed2950b62"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node2","blskey":"37rAPpXVoxzKhz7d9gkUe52XuXryuLXoM6P6LbWDB7LSbG62Lsb33sfG7zqS8TK1MXwuCHj1FKNzVpsnafmqLG1vXN88rt38mNFs9TENzm4QHdBzsvCuoBnPH7rpYYDo9DZNJePaDvRvqJKByCabubJz3XXKbEeshzpz4Ma5QYpJqjk","blskey_pop":"Qr658mWZ2YC8JXGXwMDQTzuZCWF7NK9EwxphGmcBvCh6ybUuLxbG65nsX4JvD4SPNtkJ2w9ug1yLTj6fgmuDg41TgECXjLCij3RMsV8CwewBVgVN67wsA45DFWvqvLtu4rjNnE9JbdFTc1Z4WCPA3Xan44K1HoHAq9EVeaRYs8zoF5","client_ip":"138.197.161.221","client_port":9704,"node_ip":"138.197.161.221","node_port":9703,"services":["VALIDATOR"]},"dest":"8ECVSk179mjsjKRLWiQtssMLgp6EPhWXtaYyStWPSGAb"},"metadata":{"from":"EbP4aYNeTHL6q385GuVpRV"},"type":"0"},"txnMetadata":{"seqNo":2,"txnId":"1ac8aece2a18ced660fef8694b61aac3af08ba875ce3026a160acbc3a3af35fc"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node3","blskey":"3WFpdbg7C5cnLYZwFZevJqhubkFALBfCBBok15GdrKMUhUjGsk3jV6QKj6MZgEubF7oqCafxNdkm7eswgA4sdKTRc82tLGzZBd6vNqU8dupzup6uYUf32KTHTPQbuUM8Yk4QFXjEf2Usu2TJcNkdgpyeUSX42u5LqdDDpNSWUK5deC5","blskey_pop":"QwDeb2CkNSx6r8QC8vGQK3GRv7Yndn84TGNijX8YXHPiagXajyfTjoR87rXUu4G4QLk2cF8NNyqWiYMus1623dELWwx57rLCFqGh7N4ZRbGDRP4fnVcaKg1BcUxQ866Ven4gw8y4N56S5HzxXNBZtLYmhGHvDtk6PFkFwCvxYrNYjh","client_ip":"138.197.161.221","client_port":9706,"node_ip":"138.197.161.221","node_port":9705,"services":["VALIDATOR"]},"dest":"DKVxG2fXXTU8yT5N7hGEbXB3dfdAnYv1JczDUHpmDxya"},"metadata":{"from":"4cU41vWW82ArfxJxHkzXPG"},"type":"0"},"txnMetadata":{"seqNo":3,"txnId":"7e9f355dffa78ed24668f0e0e369fd8c224076571c51e2ea8be5f26479edebe4"},"ver":"1"}
{"reqSignature":{},"txn":{"data":{"data":{"alias":"Node4","blskey":"2zN3bHM1m4rLz54MJHYSwvqzPchYp8jkHswveCLAEJVcX6Mm1wHQD1SkPYMzUDTZvWvhuE6VNAkK3KxVeEmsanSmvjVkReDeBEMxeDaayjcZjFGPydyey1qxBHmTvAnBKoPydvuTAqx5f7YNNRAdeLmUi99gERUU7TD8KfAa6MpQ9bw","blskey_pop":"RPLagxaR5xdimFzwmzYnz4ZhWtYQEj8iR5ZU53T2gitPCyCHQneUn2Huc4oeLd2B2HzkGnjAff4hWTJT6C7qHYB1Mv2wU5iHHGFWkhnTX9WsEAbunJCV2qcaXScKj4tTfvdDKfLiVuU2av6hbsMztirRze7LvYBkRHV3tGwyCptsrP","client_ip":"138.197.161.221","client_port":9708,"node_ip":"138.197.161.221","node_port":9707,"services":["VALIDATOR"]},"dest":"4PS3EDQ3dW1tci1Bp6543CfuuebjFrg36kLAUcskGfaA"},"metadata":{"from":"TWwCRQRZ2ZHMJFn9TzLp7W"},"type":"0"},"txnMetadata":{"seqNo":4,"txnId":"aa5e817d7cc626170eca175822029339a444eb0ee8f0bd20d3b0b76e566fb008"},"ver":"1"}`,
};
const { idUnionKey } = config().agent;
export const NYM_URL = {
ID_UNION: `https://endorser.idunion.org/api/dids?apiKey=${idUnionKey}`,
BCOVRIN_TEST: 'http://test.bcovrin.vonx.io/register',
ID_UNION: 'https://indy-test.bosch-digital.de/register',
GREEN_LIGHT: 'http://greenlight.bcovrin.vonx.io/register',
};
......@@ -25,7 +31,8 @@ export type LedgerIds = keyof typeof LEDGER_GENESIS;
export type LedgerInfo = {
id: string;
genesisTransactions: string;
genesisTransactions?: string;
genesisPath?: any;
isProduction: boolean;
};
......
......@@ -19,6 +19,8 @@ import { ClientsModule, Transport } from '@nestjs/microservices';
import { NATSServices } from '@common/constants';
import config from '@config/config';
import axios from 'axios';
import LedgerRegistationBody from '@src/didComm/entities/LedgerRegistrationBody';
import { logAxiosError } from './agentUtils/helperFunctions';
export const AGENT = 'agent';
......@@ -45,8 +47,21 @@ const agentFactory = {
const endpoints = [`${host}${peerPort}${path}`];
if (!ledgerIds || ledgerIds.length < 1 || ledgerIds[0] === '') {
throw new Error(
'Agent could not start, please provide a ledger environment variable.',
);
}
const indyLedgers: LedgerInfo[] = ledgerIds.map((id: LedgerIds) => {
const ledgerId: LedgerIds = id || 'BCOVRIN_TEST';
const ledgerId: LedgerIds = id;
if (!LEDGER_GENESIS?.[ledgerId]) {
throw new Error(
`No pool transaction genesis provided for ledger ${ledgerId}`,
);
}
const ledger: LedgerInfo = {
id: `${ledgerId}_Genesis`,
genesisTransactions: LEDGER_GENESIS?.[ledgerId],
......@@ -83,19 +98,31 @@ const agentFactory = {
await subscribe(agent, natsClient);
if (agent.isInitialized) {
ledgerIds.forEach((id: LedgerIds) => {
axios
.post(NYM_URL[id], {
role: 'ENDORSER',
alias: name,
ledgerIds.map(async (id: LedgerIds) => {
let body: LedgerRegistationBody = {
role: 'ENDORSER',
alias: name,
did: agent.publicDid?.did,
verkey: agent.publicDid?.verkey,
};
if (id === 'ID_UNION') {
body = {
did: agent.publicDid?.did,
verkey: agent.publicDid?.verkey,
})
};
}
await axios
.post(NYM_URL[id], body)
.then((res: any) => {
logger.info(JSON.stringify(res.data));
if (res.data) {
logger.info('Agent DID registered.');
}
})
.catch((err: any) => {
logger.error(err);
// if did is already registered on IdUnion it will catch 500, but it's ok
logAxiosError(err);
});
});
}
......
export interface LedgerRegistationBody {
role?: string;
alias?: string;
did?: string;
verkey?: string;
}
export default LedgerRegistationBody;
......@@ -7,171 +7,168 @@ export interface CheckType {
}
export interface GenericParams {
property:
| 'connections'
| 'proofs'
| 'basicMessages'
| 'ledger'
| 'credentials'
| 'mediationRecipient'
| 'mediator'
| 'discovery'
| 'wallet';
property: // | 'connections'
// | 'proofs'
// | 'basicMessages'
// | 'ledger'
// | 'credentials'
// | 'mediationRecipient'
// | 'mediator'
// | 'discovery'
'wallet';
method:
| 'createConnection'
| 'receiveInvitation'
| 'receiveInvitationFromUrl'
| 'acceptInvitation'
| 'acceptRequest'
| 'acceptResponse'
| 'returnWhenIsConnected'
| 'getAll'
| 'getById'
| 'findById'
| 'deleteById'
| 'findByVerkey'
| 'findByTheirKey'
| 'findByInvitationKey'
| 'getByThreadId'
| 'proposeProof'
| 'acceptProposal'
| 'requestProof'
| 'createOutOfBandRequest'
| 'acceptRequest'
| 'declineRequest'
| 'acceptPresentation'
| 'getRequestedCredentialsForProofRequest'
| 'autoSelectCredentialsForProofRequest'
| 'sendProblemReport'
| 'sendMessage'
| 'findAllByQuery'
| 'registerPublicDid'
| 'getPublicDid'
| 'registerSchema'
| 'getSchema'
| 'registerCredentialDefinition'
| 'getCredentialDefinition'
| 'proposeCredential'
| 'acceptProposal'
| 'negotiateProposal'
| 'offerCredential'
| 'createOutOfBandOffer'
| 'acceptOffer'
| 'declineOffer'
| 'negotiateOffer'
| 'acceptCredential'
| 'initiateMessagePickup'
| 'pickupMessages'
| 'setDefaultMediator'
| 'notifyKeylistUpdate'
| 'findDefaultMediatorConnection'
| 'discoverMediation'
| 'requestMediation'
| 'findByConnectionId'
| 'getMediators'
| 'findDefaultMediator'
| 'requestAndAwaitGrant'
| 'provision'
| 'queueMessage'
| 'grantRequestedMediation'
| 'queryFeatures'
| 'initialize'
| 'create'
| 'open'
| 'close'
| 'delete'
| 'initPublicDid'
| 'createDid'
| 'pack'
| 'unpack'
| 'sign'
| 'verify'
| 'generateNonce';
method: // | 'createConnection'
// | 'receiveInvitation'
// | 'receiveInvitationFromUrl'
// | 'acceptInvitation'
// | 'acceptRequest'
// | 'acceptResponse'
// | 'returnWhenIsConnected'
// | 'getAll'
// | 'getById'
// | 'findById'
// | 'deleteById'
// | 'findByVerkey'
// | 'findByTheirKey'
// | 'findByInvitationKey'
// | 'getByThreadId'
// | 'proposeProof'
// | 'acceptProposal'
// | 'requestProof'
// | 'createOutOfBandRequest'
// | 'acceptRequest'
// | 'declineRequest'
// | 'acceptPresentation'
// | 'getRequestedCredentialsForProofRequest'
// | 'autoSelectCredentialsForProofRequest'
// | 'sendProblemReport'
// | 'sendMessage'
// | 'findAllByQuery'
// | 'registerPublicDid'
// | 'getPublicDid'
// | 'registerSchema'
// | 'getSchema'
// | 'registerCredentialDefinition'
// | 'getCredentialDefinition'
// | 'proposeCredential'
// | 'acceptProposal'
// | 'negotiateProposal'
// | 'offerCredential'
// | 'createOutOfBandOffer'
// | 'acceptOffer'
// | 'declineOffer'
// | 'negotiateOffer'
// | 'acceptCredential'
// | 'initiateMessagePickup'
// | 'pickupMessages'
// | 'setDefaultMediator'
// | 'notifyKeylistUpdate'
// | 'findDefaultMediatorConnection'
// | 'discoverMediation'
// | 'requestMediation'
// | 'findByConnectionId'
// | 'getMediators'
// | 'findDefaultMediator'
// | 'requestAndAwaitGrant'
// | 'provision'
// | 'queueMessage'
// | 'grantRequestedMediation'
// | 'queryFeatures'
// | 'initialize'
// | 'create'
// | 'open'
// | 'close'
// | 'delete'
// | 'initPublicDid'
// | 'createDid'
// | 'pack'
// | 'unpack'
'sign' | 'verify';
// | 'generateNonce';
}
export const propertiesList = [
'connections',
'proofs',
'basicMessages',
'ledger',
'credentials',
'mediationRecipient',
'mediator',
'discovery',
// 'connections',
// 'proofs',
// 'basicMessages',
// 'ledger',
// 'credentials',
// 'mediationRecipient',
// 'mediator',
// 'discovery',
'wallet',
];
export const methodsList = [
'createConnection',
'receiveInvitation',
'receiveInvitationFromUrl',
'acceptInvitation',
'acceptRequest',
'acceptResponse',
'returnWhenIsConnected',
'getAll',
'getById',
'findById',
'deleteById',
'findByVerkey',
'findByTheirKey',
'findByInvitationKey',
'getByThreadId',
'proposeProof',
'acceptProposal',
'requestProof',
'createOutOfBandRequest',
'acceptRequest',
'declineRequest',
'acceptPresentation',
'getRequestedCredentialsForProofRequest',
'autoSelectCredentialsForProofRequest',
'sendProblemReport',
'sendMessage',
'findAllByQuery',
'registerPublicDid',
'getPublicDid',
'registerSchema',
'getSchema',
'registerCredentialDefinition',
'getCredentialDefinition',
'proposeCredential',
'acceptProposal',
'negotiateProposal',
'offerCredential',
'createOutOfBandOffer',
'acceptOffer',
'declineOffer',
'negotiateOffer',
'acceptCredential',
'initiateMessagePickup',
'pickupMessages',
'setDefaultMediator',
'notifyKeylistUpdate',
'findDefaultMediatorConnection',
'discoverMediation',
'requestMediation',
'findByConnectionId',
'getMediators',
'findDefaultMediator',
'requestAndAwaitGrant',
'provision',
'queueMessage',
'grantRequestedMediation',
'queryFeatures',
'initialize',
'create',
'open',
'close',
'delete',
'initPublicDid',
'createDid',
'pack',
'unpack',
// 'createConnection',
// 'receiveInvitation',
// 'receiveInvitationFromUrl',
// 'acceptInvitation',
// 'acceptRequest',
// 'acceptResponse',
// 'returnWhenIsConnected',
// 'getAll',
// 'getById',
// 'findById',
// 'deleteById',
// 'findByVerkey',
// 'findByTheirKey',
// 'findByInvitationKey',
// 'getByThreadId',
// 'proposeProof',
// 'acceptProposal',
// 'requestProof',
// 'createOutOfBandRequest',
// 'acceptRequest',
// 'declineRequest',
// 'acceptPresentation',
// 'getRequestedCredentialsForProofRequest',
// 'autoSelectCredentialsForProofRequest',
// 'sendProblemReport',
// 'sendMessage',
// 'findAllByQuery',
// 'registerPublicDid',
// 'getPublicDid',
// 'registerSchema',
// 'getSchema',
// 'registerCredentialDefinition',
// 'getCredentialDefinition',
// 'proposeCredential',
// 'acceptProposal',
// 'negotiateProposal',
// 'offerCredential',
// 'createOutOfBandOffer',
// 'acceptOffer',
// 'declineOffer',
// 'negotiateOffer',
// 'acceptCredential',
// 'initiateMessagePickup',
// 'pickupMessages',
// 'setDefaultMediator',
// 'notifyKeylistUpdate',
// 'findDefaultMediatorConnection',
// 'discoverMediation',
// 'requestMediation',
// 'findByConnectionId',
// 'getMediators',
// 'findDefaultMediator',
// 'requestAndAwaitGrant',
// 'provision',
// 'queueMessage',
// 'grantRequestedMediation',
// 'queryFeatures',
// 'initialize',
// 'create',
// 'open',
// 'close',
// 'delete',
// 'initPublicDid',
// 'createDid',
// 'pack',
// 'unpack',
'sign',
'verify',
'generateNonce',
// 'generateNonce',
];
export const subMethodsList = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment