{"id":13564772,"url":"https://github.com/strangelove-ventures/lens","last_synced_at":"2025-04-03T21:31:34.855Z","repository":{"id":37849215,"uuid":"433691315","full_name":"strangelove-ventures/lens","owner":"strangelove-ventures","description":"⚛️❤️👁 Brought to you by the LensCrafters","archived":true,"fork":false,"pushed_at":"2023-07-05T21:39:35.000Z","size":19315,"stargazers_count":167,"open_issues_count":37,"forks_count":85,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-04-13T02:15:37.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strangelove-ventures.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}},"created_at":"2021-12-01T05:10:38.000Z","updated_at":"2024-02-23T17:09:02.000Z","dependencies_parsed_at":"2024-01-03T05:33:40.472Z","dependency_job_id":null,"html_url":"https://github.com/strangelove-ventures/lens","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strangelove-ventures%2Flens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strangelove-ventures%2Flens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strangelove-ventures%2Flens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strangelove-ventures%2Flens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strangelove-ventures","download_url":"https://codeload.github.com/strangelove-ventures/lens/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247083493,"owners_count":20880851,"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-08-01T13:01:35.673Z","updated_at":"2025-04-03T21:31:33.724Z","avatar_url":"https://github.com/strangelove-ventures.png","language":"Go","funding_links":[],"categories":["Tools","Go"],"sub_categories":["CLI"],"readme":"# `lens`\n\n## Inactive :\n\nThis repository is now inactive. It will be kept open (non-archived) but will no longer be actively developed by Strangelove.\n\n\n**Lens provides a command line tool to  interact with any cosmos chain supporting the core [Cosmos-SDK modules](https://github.com/cosmos/cosmos-sdk/tree/master/x).**\n\n**Lens is meant to be imported as a library in other repos and projects to easily navigate and interact with the Cosmos Hub along with IBC chains.**\n\n---\n\n`lens` is your lens to view the Cosmos :atom:. `lens` packs all the best practices in golang cosmos client development into one place and provides a simple and easy to use APIs provided by standard Cosmos chains. The `cmd` package implements the `lens` command line tool while the `client` package contains all the building blocks to build your own, complex, feature rich, Cosmos client in go.\n\nIntended use cases:\n- Trading Bots\n- Server side query integrations for alerting or other automation\n- Indexers and search engines\n- Transaction automation (`x/authz` for security) for farming applications\n- ...:atom::rocket::moon:\n\nThis is the start of ideas around how to implement the cosmos client libraries in a seperate repo.\n\n## **--INSTALL--**\n---\n```bash\ngit clone https://github.com/strangelove-ventures/lens.git\n\ncd lens\n\nmake install\n```\nNow run:\n```bash\nlens\n```\nYou should see:\n\n```\n❯ lens            \nThis is my lens, there are many like it, but this one is mine.\n\nUsage:\n  lens [command]\n\nAvailable Commands:\n  chains      manage local chain configurations\n  keys        manage keys held by the relayer for each chain\n  query       query things about a chain\n  tendermint  all tendermint query commands\n  tx          query things about a chain\n  help        Help about any command\n\nFlags:\n      --chain string   override default chain\n  -d, --debug          debug output\n  -h, --help           help for lens\n      --home string    set home directory (default \"/Users/lenscrafters/.lens\")\n\nUse \"lens [command] --help\" for more information about a command.\n```\n\n## **--CONFIG--**\n---\nThe config file describes how lens will interact with blockchains. This is where information such as grpc addresses and chain-ids are held.\n\n**Config File Location:** `~/.lens/config.yaml` \n\n\u003e NOTE: The config file is not created at install, it is created the first time lens needs to query your config. Just to get it created, you can run something like:\n\u003e```\n\u003elens chains show-default\n\u003e```\n\n### **CHAINS**\nLens comes with two default chains. Cosmos Hub and Osmosis.\n\nTo interact with other chains, you need to add them to your config. To do this, run:\n\n```\nlens chains add \u003cchain_name\u003e\n#Example:\nlens chains add juno\n```\n\nTo view all possible chain names, run:\n```\nlens chains registry-list\n```\n\u003e NOTE: These two commands check the chain registry located [here](https://github.com/cosmos/chain-registry), for the requested chain.\n\nWhen running a command, it will run the command for the defaulted chain.\n\nTo view your default chain, run:\n\n```\n lens chains show-default\n```\n\nTo change your default, run: \n\n``` \nlens chains set-default \u003cchain_name\u003e\n```\n\n### **Keys**\nLens uses the keyring from the Cosmos-sdk. There is more information about it [here](https://github.com/cosmos/cosmos-sdk/blob/master/crypto/keyring/doc.go). \n\nTo add a key to lens you have two options:\n\n* `lens keys add` - This will add a key to you default chain and name it \"default\". You can optionally add a name as an argument. \n* `lens keys restore \u003cname\u003e` - This will restore a key to your default chain. Replace '\\\u003cname\\\u003e' with a key name. This command will THEN ask for your mnemonic which is needed to restore and use it to boradcast transactions. \n\n\u003e❗️ NOTE: IF you name your key anything other than \"default\", you will need to manually change the `key:` value in your config to link key with chain.  \n\u003e```bash\n\u003edefault_chain: cosmoshub\n\u003echains:\n\u003e  cosmoshub:\n\u003e    key: default #CHANGE THIS NAME\n\u003e    chain-id: cosmoshub-4\n\u003e    rpc-addr: https://cosmoshub-4.technofractal.com:443\n\u003e    ...\n\u003e```\n\nAfter generating or restoring a key, it should appear in your list by running: `lens keys list`, by default it will show the Cosmos Hub address. \n\nTo see the key encoded for use on other chains run `lens keys enumerate \u003ckey_name\u003e`. \n\n\n## --EXAMPLES--\nFind examples of using Lens as a Go module in our [Examples Repository](https://github.com/strangelove-ventures/lens-examples)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrangelove-ventures%2Flens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrangelove-ventures%2Flens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrangelove-ventures%2Flens/lists"}