Docker compose image for Emercoin core
Docker allows you to create an isolated container with an Emercoin wallet inside and a separate storage (volume: blockhain_data) for the blockchain. This makes it cross-platform (you can run it on any OS where you can install Docker), the ability to update versions of the Emercoin wallet in one click. Use the wallet functionality in your projects through the RPC JSON interface.
Core - the classic version, just an Emercoin wallet in a container. It takes time to sync with the network.
Install Git Install Docker and docker-compose
Clone the repository and go to the project folder:
git clone https://github.com/emercoin/docker emer_docker_wallet && cd emer_docker_wallet
Rename emercoin.conf.example
to emercoin.conf
Start building a container with Emercoin:
for regular version Core
docker-compose up --build -d
The container is launched, it takes time to download the blockchain (~ 3-5 hours), but some data can be obtained right now. By default, port 6662 is used to connect to the container.
- address: 127.0.0.1
- user: emcrpc
- password: emcpass
- method: POST request body example
{"method": "getinfo"}
Change the password in the container:
docker-compose exec emc bash changepass.sh
docker-compose restart emc
Need to send POST (using Postman, for example)
to the address http://emcrpc:emcpass@127.0.0.1:6662
, request body {"method":"getinfo"}
Python:
import requests
url = "emcrpc:emcpass@127.0.0.1:6662"
payload = {"method": "getinfo"}
headers = { 'Content-Type': 'application/json' }
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json())
On the command line using Curl: (sudo apt-get update && sudo apt-get install curl) - если Curl не установлен
curl --location --request POST 'emcrpc:emcpass@127.0.0.1:6662' \
--header 'Content-Type: application/json' \
--data-raw '{"method": "getinfo" }'
if everything is ok, the response will be in JSON format:
{
"result": {
"fullversion": "v0.7.10emc",
"version": 71000,
"protocolversion": 70015,
"walletversion": 130000,
"balance": 0.000000,
...
Stop container:
docker-compose stop emc
Remove containers:
docker-compose down
In this case, the blockchain database, wallet.dat and emercoin.conf are not deleted. It remains in volume docker_emercoin_data.
Delete blockchain database
docker volume rm emer_data
Attention! this command also deletes wallet.dat