{"id":15160575,"url":"https://github.com/rp01/fabric-sdk-kvs-vault","last_synced_at":"2025-10-24T18:30:41.295Z","repository":{"id":48029342,"uuid":"151809559","full_name":"rp01/fabric-sdk-kvs-vault","owner":"rp01","description":"Key value store for fabric-sdk-node using Hashicorp's Vault","archived":false,"fork":false,"pushed_at":"2022-12-08T02:55:12.000Z","size":109,"stargazers_count":6,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-27T23:01:40.986Z","etag":null,"topics":["fabric","fabric-sdk-node","hashicorp-vault","kvs-vault","vault"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rp01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-06T05:55:47.000Z","updated_at":"2023-03-29T07:12:11.000Z","dependencies_parsed_at":"2023-01-24T21:15:41.417Z","dependency_job_id":null,"html_url":"https://github.com/rp01/fabric-sdk-kvs-vault","commit_stats":null,"previous_names":["rp01/fabric-sdk-kvs-vault","ramanandapanda/fabric-sdk-kvs-vault"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rp01%2Ffabric-sdk-kvs-vault","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rp01%2Ffabric-sdk-kvs-vault/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rp01%2Ffabric-sdk-kvs-vault/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rp01%2Ffabric-sdk-kvs-vault/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rp01","download_url":"https://codeload.github.com/rp01/fabric-sdk-kvs-vault/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219868214,"owners_count":16555876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fabric","fabric-sdk-node","hashicorp-vault","kvs-vault","vault"],"created_at":"2024-09-26T23:02:12.176Z","updated_at":"2025-10-24T18:30:40.959Z","avatar_url":"https://github.com/rp01.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fabric-sdk-kvs-vault\n\nKey value store for fabric-sdk-node using Hashicorp's Vault\n\n## Install\n\n```bash\nnpm i fabric-sdk-kvs-vault\n```\n\n## Config\n\n1. config your network definition to use vault credentialStore\n\n```yaml\n# your network.yaml\ncredentialStore:\n    # [Optional]. Specific to FileKeyValueStore.js or similar implementations in other SDKs. Can be others\n    # if using an alternative impl. For instance, CouchDBKeyValueStore.js would require an object\n    # here for properties like url, db name, etc.\n    # path: \"./fabric-client-kv-org1\"\n    endpoint: \"http://127.0.0.1:8200\"\n    token: \"\u003cVAULT_TOKEN\u003e\" # or can be set from env as VAULT_TOKEN\n    apiVersion: \"v1\"\n\n    # [Optional]. Specific to the CryptoSuite implementation. Software-based implementations like\n    # CryptoSuite_ECDSA_AES.js in node SDK requires a key store. PKCS#11 based implementations does\n    # not.\n    cryptoStore:\n      # Specific to the underlying KeyValueStore that backs the crypto key store.\n      # path: \"/tmp/fabric-client-kv-org1\"\n      endpoint: \"http://127.0.0.1:8200\"\n      token: \"\u003cVAULT_TOKEN\u003e\" # or can be set from env as VAULT_TOKEN\n      apiVersion: \"v1\"\n```\n\n2. config fabric-sdk-node to use fabric-ca-kvs-vault \n\n```javascript\nconst Client = require('fabric-client');\n\n// this code config the fabric-sdk-node to use fabric-sdk-kvs-vault\nClient.setConfigSetting('key-value-store', 'fabric-sdk-kvs-vault');\n\n// this load the network.yaml from step 1\nconst client = Client.loadFromConfig('\u003csome-path-to-your-network.yaml\u003e');\n\n// init credential stores\nawait client.initCredentialStores();\n\n// then it's done.\n\n// Next time you just need to load this use again from state store\nconst user = await client.loadUserFromStateStore(username);\nawait client.setUserContext(user);\n\n// do some invoke/query with this user's identity\n// Enjoy!\n```\n\n## setting VAULT_TOKEN\n\n1. Windows powershell\n\n```powershell\n$env:VAULT_TOKEN=\"\u003cVAULT_TOKEN\u003e\"\n```\n\n2. Linux bash\n\n```bash\nexport VAULT_TOKEN=\u003cVAULT_TOKEN\u003e\n```\n\n## How to fix error with secrets engine\n\nSome Times you may get status 404 even in setting values.\njust open another terminal tab/window run:\n\n```bash\nexport VAULT_TOKEN=\u003cTOKEN\u003e \nexport VAULT_ADDRESS='http(s)://\u003cHOST\u003e:\u003cPORT\u003e'\n```\nThen run the following command:\n\n```bash\nvault secrets disable secret\nvault secrets enable -version=1 -path=secret kv\n```\n\n## How to cheeck stored data in vault\n\n```bash\nvault kv get secret/\u003cPREVIOUSLY_SET_KEY\u003e\n```\n\n## To enable debuging\n\nrun:\n```node\nprocess.env.DEBUG = 'VaultKVS';\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frp01%2Ffabric-sdk-kvs-vault","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frp01%2Ffabric-sdk-kvs-vault","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frp01%2Ffabric-sdk-kvs-vault/lists"}