{"id":22096544,"url":"https://github.com/uphold/docker-litecoin-core","last_synced_at":"2025-04-09T23:10:20.922Z","repository":{"id":41827568,"uuid":"55712342","full_name":"uphold/docker-litecoin-core","owner":"uphold","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-21T17:22:18.000Z","size":42,"stargazers_count":54,"open_issues_count":6,"forks_count":44,"subscribers_count":59,"default_branch":"master","last_synced_at":"2025-03-24T00:57:41.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/uphold.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-07T16:59:05.000Z","updated_at":"2025-01-30T22:52:27.000Z","dependencies_parsed_at":"2024-02-19T18:36:07.937Z","dependency_job_id":"f8ef4716-022f-4cf9-bc2b-ac09558cc422","html_url":"https://github.com/uphold/docker-litecoin-core","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Fdocker-litecoin-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Fdocker-litecoin-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Fdocker-litecoin-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uphold%2Fdocker-litecoin-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uphold","download_url":"https://codeload.github.com/uphold/docker-litecoin-core/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125613,"owners_count":21051770,"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-12-01T04:11:34.158Z","updated_at":"2025-04-09T23:10:20.900Z","avatar_url":"https://github.com/uphold.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uphold/litecoin-core\n\nA Litecoin Core docker image.\n\n[![uphold/litecoin-core][docker-pulls-image]][docker-hub-url] [![uphold/litecoin-core][docker-stars-image]][docker-hub-url] [![uphold/litecoin-core][docker-size-image]][docker-hub-url] [![uphold/litecoin-core][docker-layers-image]][docker-hub-url]\n\n## Tags\n\n- `0.21.2.2`, `0.21`, `latest` ([0.21/Dockerfile](https://github.com/uphold/docker-litecoin-core/blob/master/0.21/Dockerfile))\n- `0.18.1`, `0.18` ([0.18/Dockerfile](https://github.com/uphold/docker-litecoin-core/blob/master/0.18/Dockerfile))\n- `0.17.1`, `0.17` ([0.17/Dockerfile](https://github.com/uphold/docker-litecoin-core/blob/master/0.17/Dockerfile))\n- `0.16.3`, `0.16` ([0.16/Dockerfile](https://github.com/uphold/docker-litecoin-core/blob/master/0.16/Dockerfile))\n- `0.15.1`, `0.15` ([0.15/Dockerfile](https://github.com/uphold/docker-litecoin-core/blob/master/0.15/Dockerfile))\n- `0.14.2`, `0.14` ([0.14/Dockerfile](https://github.com/uphold/docker-litecoin-core/blob/master/0.14/Dockerfile))\n\n**Picking the right tag**\n\n- `uphold/litecoin-core:latest`: points to the latest stable release available of Litecoin Core. Use this only if you know what you're doing as upgrading Litecoin Core blindly is a risky procedure.\n- `uphold/litecoin-core:\u003cversion\u003e`: based on a slim Debian image, points to a specific version branch or release of Litecoin Core. Uses the pre-compiled binaries which are fully tested by the Litecoin Core team.\n\n## What is Litecoin Core?\n\nLitecoin Core is the Litecoin reference client and contains all the protocol rules required for the Litecoin network to function. This client is used by mining pools, merchants and services all over the world for its rock solid stability, feature set and security. Learn more about [Litecoin Core](https://litecoincore.org/).\n\n## Usage\n\n### How to use this image\n\nThis image contains the main binaries from the Litecoin Core project - `litecoind`, `litecoin-cli` and `litecoin-tx`. It behaves like a binary, so you can pass any arguments to the image and they will be forwarded to the `litecoind` binary:\n\n```sh\n❯ docker run --rm uphold/litecoin-core \\\n  -printtoconsole \\\n  -regtest=1 \\\n  -rpcallowip=172.17.0.0/16 \\\n  -rpcauth='foo:1e72f95158becf7170f3bac8d9224$957a46166672d61d3218c167a223ed5290389e9990cc57397d24c979b4853f8e'\n```\n\nBy default, `litecoind` will run as user `litecoin` for security reasons and with its default data dir (`~/.litecoin`). If you'd like to customize where `litecoind` stores its data, you must use the `LITECOIN_DATA` environment variable. The directory will be automatically created with the correct permissions for the `litecoin` user and `litecoind` automatically configured to use it.\n\n```sh\n❯ docker run -e LITECOIN_DATA=/var/lib/litecoind --rm uphold/litecoin-core \\\n  -printtoconsole \\\n  -regtest=1\n```\n\nYou can also mount a directory in a volume under `/home/litecoin/.litecoin` in case you want to access it on the host:\n\n```sh\n❯ docker run -v ${PWD}/data:/home/litecoin/.litecoin --rm uphold/litecoin-core \\\n  -printtoconsole \\\n  -regtest=1\n```\n\nYou can optionally create a service using `docker-compose`:\n\n```yml\nlitecoin-core:\n  image: uphold/litecoin-core\n  command:\n    -printtoconsole\n    -regtest=1\n```\n\n### Using RPC to interact with the daemon\n\nThere are two communications methods to interact with a running Litecoin Core daemon.\n\nThe first one is using a cookie-based local authentication. It doesn't require any special authentication information as running a process locally under the same user that was used to launch the Litecoin Core daemon allows it to read the cookie file previously generated by the daemon for clients. The downside of this method is that it requires local machine access.\n\nThe second option is making a remote procedure call using a username and password combination. This has the advantage of not requiring local machine access, but in order to keep your credentials safe you should use the newer `rpcauth` authentication mechanism.\n\n#### Using cookie-based local authentication\n\nStart by launch the Litecoin Core daemon:\n\n```sh\n❯ docker run --rm --name litecoin-server -it uphold/litecoin-core \\\n  -printtoconsole \\\n  -regtest=1\n```\n\nThen, inside the running `litecoin-server` container, locally execute the query to the daemon using `litecoin-cli`:\n\n```sh\n❯ docker exec --user litecoin litecoin-server litecoin-cli -regtest getmininginfo\n\n{\n  \"blocks\": 0,\n  \"currentblocksize\": 0,\n  \"currentblockweight\": 0,\n  \"currentblocktx\": 0,\n  \"difficulty\": 4.656542373906925e-10,\n  \"errors\": \"\",\n  \"networkhashps\": 0,\n  \"pooledtx\": 0,\n  \"chain\": \"regtest\"\n}\n```\n\nIn the background, `litecoin-cli` read the information automatically from `/home/litecoin/.litecoin/regtest/.cookie`. In production, the path would not contain the regtest part.\n\n#### Using rpcauth for remote authentication\n\nBefore setting up remote authentication, you will need to generate the `rpcauth` line that will hold the credentials for the Litecoin Core daemon. You can either do this yourself by constructing the line with the format `\u003cuser\u003e:\u003csalt\u003e$\u003chash\u003e` or use the official `rpcauth.py` script to generate this line for you, including a random password that is printed to the console.\n\nExample:\n\n```sh\n❯ curl -sSL https://raw.githubusercontent.com/litecoin-project/litecoin/master/share/rpcauth/rpcauth.py | python - \u003cusername\u003e\n\nString to be appended to litecoin.conf:\nrpcauth=foo:1e72f95158becf7170f3bac8d9224$957a46166672d61d3218c167a223ed5290389e9990cc57397d24c979b4853f8e\nYour password:\n-ngju1uqGUmAJIQDBCgYbatzhcJon_YGU23t313388g=\n```\n\nNote that for each run, even if the username remains the same, the output will be always different as a new salt and password are generated.\n\nNow that you have your credentials, you need to start the Litecoin Core daemon with the `-rpcauth` option. Alternatively, you could append the line to a `litecoin.conf` file and mount it on the container.\n\nLet's opt for the Docker way:\n\n```sh\n❯ docker run --rm --name litecoin-server -it uphold/litecoin-core \\\n  -printtoconsole \\\n  -regtest=1 \\\n  -rpcallowip=172.17.0.0/16 \\\n  -rpcauth='foo:1e72f95158becf7170f3bac8d9224$957a46166672d61d3218c167a223ed5290389e9990cc57397d24c979b4853f8e'\n```\n\nTwo important notes:\n\n1. Some shells require escaping the rpcauth line (e.g. zsh), as shown above.\n2. It is now perfectly fine to pass the rpcauth line as a command line argument. Unlike `-rpcpassword`, the content is hashed so even if the arguments would be exposed, they would not allow the attacker to get the actual password.\n\nYou can now connect via `litecoin-cli` or any other [compatible client](https://github.com/ruimarinho/bitcoin-core). You will still have to define a username and password when connecting to the Litecoin Core RPC server.\n\nTo avoid any confusion about whether or not a remote call is being made, let's spin up another container to execute `litecoin-cli` and connect it via the Docker network using the password generated above:\n\n```sh\n❯ docker run --link litecoin-server --rm uphold/litecoin-core \\\n  litecoin-cli \\\n  -rpcconnect=litecoin-server \\\n  -regtest \\\n  -rpcuser=foo \\\n  -rpcpassword='-ngju1uqGUmAJIQDBCgYbatzhcJon_YGU23t313388g=' \\\n  getmininginfo\n\n{\n  \"blocks\": 0,\n  \"currentblocksize\": 0,\n  \"currentblockweight\": 0,\n  \"currentblocktx\": 0,\n  \"difficulty\": 4.656542373906925e-10,\n  \"errors\": \"\",\n  \"networkhashps\": 0,\n  \"pooledtx\": 0,\n  \"chain\": \"regtest\"\n}\n```\n\n### Exposing Ports\n\nDepending on the network (mode) the Litecoin Core daemon is running as well as the chosen runtime flags, several default ports may be available for mapping.\n\nPorts can be exposed by mapping all of the available ones (using `-P` and based on what `EXPOSE` documents) or individually by adding `-p`. This mode allows assigning a dynamic port on the host (`-p \u003cport\u003e`) or assigning a fixed port `-p \u003chostPort\u003e:\u003ccontainerPort\u003e`.\n\nExample for running a node in `regtest` mode mapping JSON-RPC/REST and P2P ports:\n\n```sh\ndocker run --rm -it \\\n  -p 19332:19332 \\\n  -p 19444:19444 \\\n  uphold/litecoin-core \\\n  -printtoconsole \\\n  -regtest=1 \\\n  -rpcallowip=172.17.0.0/16 \\\n  -rpcauth='foo:1e72f95158becf7170f3bac8d9224$957a46166672d61d3218c167a223ed5290389e9990cc57397d24c979b4853f8e'\n```\n\nTo test that mapping worked, you can send a JSON-RPC curl request to the host port:\n\n```\ncurl --data-binary '{\"jsonrpc\":\"1.0\",\"id\":\"1\",\"method\":\"getnetworkinfo\",\"params\":[]}' http://foo:-ngju1uqGUmAJIQDBCgYbatzhcJon_YGU23t313388g=@127.0.0.1:19332/\n```\n\n#### Mainnet\n\n- JSON-RPC/REST: 9332\n- P2P: 9333\n\n#### Testnet\n\n- JSON-RPC: 19332\n- P2P: 19333\n\n#### Regtest\n\n- JSON-RPC/REST: 19332\n- P2P: 19444\n\n## Archived tags\n\nFor historical reasons, the following tags are still available and automatically updated when the underlying base image is updated as well:\n\n- `0.13.2`, `0.13` ([0.13/Dockerfile](https://github.com/uphold/docker-litecoin-core/blob/master/0.13/Dockerfile))\n- `0.10.4`, `0.10` ([0.10/Dockerfile](https://github.com/uphold/docker-litecoin-core/blob/master/0.10/Dockerfile))\n\n## Supported Docker versions\n\nThis image is officially supported on Docker version 17.09, with support for older versions provided on a best-effort basis.\n\n## License\n\nThe [uphold/litecoin-core][docker-hub-url] docker project is under MIT license.\n\n[docker-hub-url]: https://hub.docker.com/r/uphold/litecoin-core\n[docker-layers-image]: https://img.shields.io/microbadger/layers/uphold/litecoin-core/latest.svg?style=flat-square\n[docker-pulls-image]: https://img.shields.io/docker/pulls/uphold/litecoin-core.svg?style=flat-square\n[docker-size-image]: https://img.shields.io/microbadger/image-size/uphold/litecoin-core/latest.svg?style=flat-square\n[docker-stars-image]: https://img.shields.io/docker/stars/uphold/litecoin-core.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuphold%2Fdocker-litecoin-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuphold%2Fdocker-litecoin-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuphold%2Fdocker-litecoin-core/lists"}