{"id":27871319,"url":"https://github.com/uniquid/uidcore-js","last_synced_at":"2025-06-16T11:37:20.818Z","repository":{"id":94341833,"uuid":"123895143","full_name":"uniquid/uidcore-js","owner":"uniquid","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-16T07:59:43.000Z","size":1117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-04T23:38:23.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/uniquid.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-05T09:21:27.000Z","updated_at":"2019-04-12T10:16:30.000Z","dependencies_parsed_at":"2023-03-22T21:50:11.971Z","dependency_job_id":null,"html_url":"https://github.com/uniquid/uidcore-js","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/uniquid/uidcore-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uniquid%2Fuidcore-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uniquid%2Fuidcore-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uniquid%2Fuidcore-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uniquid%2Fuidcore-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uniquid","download_url":"https://codeload.github.com/uniquid/uidcore-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uniquid%2Fuidcore-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260151253,"owners_count":22966476,"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":[],"created_at":"2025-05-04T23:36:24.699Z","updated_at":"2025-06-16T11:37:20.803Z","avatar_url":"https://github.com/uniquid.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Uniquid JS Library\r\n\r\n## Requirements\r\n- Node 8\r\n\r\n## Getting started\r\ninstall dependecy\r\n`npm i -S git+https://github.com/uniquid/uidcore-js.git`\r\n\r\nsample code:\r\n\r\n```javascript\r\nimport { standardUQNodeFactory } from '@uniquid/uidcore/lib'\r\n\r\n// create some handlers for bitmask rpc over mqtt\r\nconst RPC_METHOD_ECHO = 34\r\nconst rpcHandlers  = [\r\n {\r\n   m: RPC_METHOD_ECHO,  // the bit number associated to method\r\n   h: (params /*string*/) =\u003e `ECHO: ${params}`  // function to call when bitmask method is invoked\r\n }\r\n]\r\n\r\n// Use standard UQ node factory to create an UQ Node:\r\nstandardUQNodeFactory({\r\n  home, // {string} path to the home folder for data persistence (folder must exist)\r\n  mqttHost, // {string} url of the mqtt broker host (e.g. tcp://192.168.0.108:1883)\r\n  bcSeeds, // {string[]} array of string ips\r\n  registryUrl, // {string} the url of the UQ registry (e.g. http://192.168.0.108:8080)\r\n  requestTimeout, // {number} millis to wait before an RPC request times out\r\n  rpcHandlers, // an array of handlers object\r\n  bcLogLevel, // {string} log level for the underlying LCoin process can be \"error\" | \"warning\" | \"info\" | \"debug\" | \"spam\"\r\n  network, // {string} choose bc network \"uqregtest\" | \"main\" | \"testnet\"\r\n  nodenamePrefix: 'My-Node-'\r\n})\r\n.then(uq =\u003e {\r\n  // as a User make a request to a Provider bound by a UQ contract\r\n  uq.msgs.request(\r\n    userAddress, // string : BC adrress of node user\r\n    providerName, // string : provider's unique name\r\n    method, // number : method number\r\n    params // string : serialized params for rpc\r\n  ).then(\r\n    responseString =\u003e {\r\n      // manage response\r\n    },\r\n    error =\u003e {\r\n      // manage error\r\n    })\r\n\r\n},\r\nerror =\u003e {\r\n  // initialization error\r\n})\r\n\r\n```\r\n\r\n### ltc-backup CLI tool\r\n\r\n`ltc-backup` CLI tool will help you speed up development and UQ node startup time, downloading a LTC header's backup from UniquId's servers and injecting it for UniquId node usage.\r\n\r\nIt will be available in any package that installs `@uniquid/uidcore`\r\n\r\nPerform it using `npx ltc-backup [options] [command]`\r\n\r\nCheckout helps in CLI\r\n\r\n```\r\n$ npx ltc-backup --help\r\n$ npx ltc-backup download --help\r\n$ npx ltc-backup inject --help\r\n$ npx ltc-backup install --help\r\n```\r\n\r\n#### Intro\r\nStarting up a blockchain node is a time-consuming task, the newly created node requires to download the whole header chain from the network.\r\n\r\nFor speeding up this task in test and development environment it is possible to inject a pre-populated DB into the node's home directory\r\n\r\nWhen Node start it is configured with a node home directory for node persistency\r\n\r\nthe process structures the directory this way:\r\n```\r\n\u003cnode_home\u003e/\r\n    CEV/\r\n        chain.db.ldb/ \u003c-- this is the blockchain headers (leveldb)DB directory\r\n    ID/\r\n    DB/\r\n```\r\n\r\nIf the process finds some resources present in the directory, it will use them.\r\n\r\nSo, letting the node find a valid and pre-populated CEV/chain.db.ldb into its home directory will let the node use it and start syncing from there, as long as the node and the DB-backup refer to the same network.\r\n\r\nAny chain.db.ldb created with any UQ node is valid and can be imported in any other node, as it is not bound to node's identity.\r\n\r\n#### Uniquid Chain DB Backups repo\r\n\r\nUniquid currently provides a set of CEV/chain.db.ldb backups for speeding up development, test, and evaluation.\r\n\r\nDownload of DB backup TARs is possible at url:\r\n\r\nhttp://dbs-ltc-testnet.uniquid.co/{network_name}_db_latest.tar\r\nalong with a checksum file\r\nhttp://dbs-ltc-testnet.uniquid.co/{network_name}_db_latest.tar_md5\r\nfor checksum verification\r\n\r\ni.e.  http://dbs-ltc-testnet.uniquid.co/testnet_db_latest.tar and http://dbs-ltc-testnet.uniquid.co/testnet_db_latest.tar_md5\r\n\r\nPrevious backups are also present in http://dbs-ltc-testnet.uniquid.co/{network_name}/db_{block_number}.tar\r\n\r\ni.e. http://dbs-ltc-testnet.uniquid.co/testnet/db_000700000.tar and http://dbs-ltc-testnet.uniquid.co/testnet/db_000700000.tar_md5\r\n\r\nFeel free to navigate with your browser to http://dbs-ltc-testnet.uniquid.co and checkout contents\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funiquid%2Fuidcore-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funiquid%2Fuidcore-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funiquid%2Fuidcore-js/lists"}