{"id":21280831,"url":"https://github.com/consensysmesh/live-libs","last_synced_at":"2025-07-11T10:32:55.399Z","repository":{"id":42016292,"uuid":"58148379","full_name":"ConsenSysMesh/live-libs","owner":"ConsenSysMesh","description":"Providing reusable Solidity libraries that are live on the Ethereum blockchain.","archived":false,"fork":false,"pushed_at":"2022-01-10T15:41:51.000Z","size":106,"stargazers_count":87,"open_issues_count":1,"forks_count":18,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-11-01T15:17:31.667Z","etag":null,"topics":[],"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/ConsenSysMesh.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":"2016-05-05T17:24:45.000Z","updated_at":"2024-05-17T16:44:40.000Z","dependencies_parsed_at":"2022-08-20T04:50:33.019Z","dependency_job_id":null,"html_url":"https://github.com/ConsenSysMesh/live-libs","commit_stats":null,"previous_names":["consensys/live-libs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConsenSysMesh%2Flive-libs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConsenSysMesh%2Flive-libs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConsenSysMesh%2Flive-libs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConsenSysMesh%2Flive-libs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ConsenSysMesh","download_url":"https://codeload.github.com/ConsenSysMesh/live-libs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225715945,"owners_count":17512908,"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":"2024-11-21T10:41:19.029Z","updated_at":"2024-11-21T10:41:19.581Z","avatar_url":"https://github.com/ConsenSysMesh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Live Libs for Solidity\n\nProviding reusable Solidity libraries that are live on the Ethereum blockchain.\n\n## Install\n\n    $ npm install -g live-libs\n\n## Setting up your environment\n\nYou will need to be connected to an Ethereum network (testrpc, morden, mainnet, etc) when interacting with live-libs. Follow [these instructions](https://ethereum.gitbooks.io/frontier-guide/content/getting_a_client.html) to install an Ethereum node. The live-libs command line interface defaults to `http://localhost:8545` to reach the Ethereum node's RPC interface. You can override this with `--rpcurl https://example:8765`.\n\n## Getting a library's information\n\nIt's important to note that live-libs does not store source code, but it does store a library's [ABI](https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI). In order to compile contracts that use live-libs, you'll need to provide the [library interface](https://github.com/ethereum/wiki/wiki/Solidity-Features#interface-contracts) to the compiler.\n\n__Note__: If you don't specify the version, the latest version of the library is used.\n\nFrom the command line:\n\n    $ live-libs get LibName [--version 3.5.8]\n    Version:\n    3.5.8\n\n    Address:\n    0x3f4845...\n\n    ABI:\n    [{\"constant\":false,\"inputs\":...}]\n\n    Abstract source:\n    library LibName {...}\n\nVia Javascript:\n\n    var web3 = ... // setup web3 object\n\n    var LiveLibs = require('live-libs');\n    var liveLibs = new LiveLibs(web3);\n    var libName = \"Foo\";\n    var version = \"3.5.8\"; // optional\n    liveLibs.get(libName, version).then(function(libInfo) {\n      console.log(libInfo.version);\n      console.log(libInfo.address);\n      console.log(libInfo.abi);\n      console.log(libInfo.abstractSource());\n      console.log(libInfo.docURL);\n      console.log(libInfo.sourceURL);\n    });\n\n## Getting a library's event log\n\nFrom the command line:\n\n    $ live-libs log LibName\n    Event log for Foo...\n    2016-04-17T12:34:56Z NewLib! Registered by owner: 0x28bc5a7226a82053aa29c0806c380cfb6a82bb0c\n    2016-04-17T12:34:56Z NewVersion! 0.0.1\n    2016-05-17T17:27:37Z NewVersion! 0.0.2\n\nVia Javascript:\n\n    liveLibs.log(libName).then(function(events) {\n      events.forEach(function(event) {\n        console.log(event.type);\n        console.log(event.time);\n        console.log(event.args);\n      });\n    });\n\n## Working with accounts\n\n`get` and `log` do not require a transaction, so those calls require no account nor cost any gas. (They use [eth_call](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_call).) `register` and `contribute` require a transaction, costing you gas, and therefore require an unlocked account. (These commands use [eth_sendTransaction](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendtransaction)).\n\nIf not specified via `--account` on the command line, `web3.eth.coinbase` will be used as your account. Also, you will need to unlock the account in order to use it to spend Ether on transactions. For the command line, you can read the [geth docs](https://github.com/ethereum/go-ethereum/wiki/Managing-your-accounts). For JavaScript, assuming you've started geth with `--rpcapi \"eth,web3,personal\"`, you can call `web3.eth.personal.unlockAccount(address, password, durationSeconds)` to unlock it. ([source](https://github.com/ethereum/web3.js/blob/master/lib/web3/methods/personal.js))\n\n## How to register a live library\n\nFrom the command line:\n\n    $ live-libs register YourLibName --version 3.5.8 --address 0x45e2... --abi '[...]' \\\n    [--resourceuri docs=http://example.com/docs] [--resourceuri source=http://example.com/source/lib.sol]\n\n__Warning:__ There is no way to remove your library. Once it's live, it's live forever.\n\n__Warning:__ This software is under active development and the live-libs registries (morden and mainnet) will be abandoned without warning. (Other than this warning.)\n\n## Setting up your testrpc environment\n\nRunning your tests against [testrpc](https://github.com/ethereumjs/testrpc) is a standard way to speed up your development process. In order to execute the live-libs libraries on your testrpc node, you'll need to deploy the live-libs contract(s) and import the live-libs data. This will require a two-step process:\n\n1. Download the live-libs data from morden (you will need to run a node that connects to that network).\n2. Deploy the live-libs contract(s) and data to testrpc.\n\nFrom the command line:\n\n    $ # running a morden node\n    $ live-libs download\n    $ # switch to testrpc\n    $ live-libs deploy\n\n__Note__: If you restart your testrpc server, you'll need to re-deploy live-libs, but you won't need to re-download the data.\n\n## Funding your library\n\nLibrary authors can receive ether for registering their libraries with live-libs. When an author registers a library, they can optionally pass in a `--unlockat` flag, followed by a number of wei. This will \"lock\" the specified version of the library until the specified amount of wei has been contributed. For example:\n\n    $ live-libs register YourLibName --version 3.5.8 --address 0x45e2... --abi '[...]' --unlockat 10000000\n\nThis will register `YourLibName 3.5.8` in live-libs, but when you look it up, it will not be available. To unlock it, people need to contribute ether, which gets immediatly redirected to the Ethereum account that registered this version.\n\nIf someone wants to contribute ether in order to unlock a version of a library, they can:\n\n    $ live-libs contribute LibName --version 3.5.8 --wei 200000\n\n__Note__: The idea for this came from Vitalik's story at 2:30 of [this podcast](http://futurethinkers.org/vitalik-buterin-ethereum-decentralized-future/).\n\n## Where is this headed?\n\n* [TODO](https://github.com/ConsenSys/live-libs/blob/master/TODO.md): a few weeks out\n* [Roadmap](https://github.com/ConsenSys/live-libs/wiki/Roadmap): a few months out\n\n## Author\n\nDave Hoover \u003cdave.hoover@consensys.net\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsensysmesh%2Flive-libs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconsensysmesh%2Flive-libs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsensysmesh%2Flive-libs/lists"}