# Clayop's Creditcoin Miner's Commandline

**URL:** <https://community.creditcoin.org/t/clayops-creditcoin-miners-commandline/59>\
**Category:** Mining\
**Created:** [October 13, 2020, 2:25am UTC](https://community.creditcoin.org/t/clayops-creditcoin-miners-commandline/59 "2020-10-13T02:25:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pringles](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.creditcoin.org/pringles/32/64_2.png) [@pringles](https://community.creditcoin.org/u/pringles)\
**Post date:** [October 13, 2020, 2:25am UTC](https://community.creditcoin.org/t/clayops-creditcoin-miners-commandline/59/1 "2020-10-13T02:25:51Z")

</div>

I want that to be reflected in the next patch. When someone who wants to mine runs the ./start\_creditcoin.sh file, the process until the start of mining is automated.

I think there will be no problem if only the command to install when netcat and docker-compose do not exist in the source code written now is added.

raw sourcecode

> **[Creditcoin Miner's Commandline - Pastebin.com](https://pastebin.com/TMpfvBN4)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

```
# Install Docker
sudo apt-get -y update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo docker run hello-world

# Install Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo docker-compose --version

# Copy files
git clone https://github.com/gluwa/CreditcoinDocs-Mainnet
cd CreditcoinDocs-Mainnet

# Configuration
nano ./CreditcoinDocs-Mainnet/Server/gatewayConfig.json
# Replace <ethereum rpc node> with RPC
nano ./CreditcoinDocs-Mainnet/Server/creditcoin-with-gateway.yaml
# Replace <insert.your.ip> with your IP
# settings-tp:
# image: hyperledger/sawtooth-settings-tp:1.2
# rest-api:
# image: hyperledger/sawtooth-rest-api:1.2

# Pull updates and First run
sudo docker-compose -f ./CreditcoinDocs-Mainnet/Server/creditcoin-with-gateway.yaml pull
sudo docker-compose -f ./CreditcoinDocs-Mainnet/Server/creditcoin-with-gateway.yaml up
# <Ctrl+C>
#sudo docker-compose -f Server/creditcoin-with-gateway.yaml down

# Download and install snapshot
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1LYvErTJIhaOpmwc853_uSEios-K-VXGn' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1LYvErTJIhaOpmwc853_uSEios-K-VXGn" -O creditcoin-block-volume.tar.gz && rm -rf /tmp/cookies.txt

sudo bash -c "rm /var/lib/docker/volumes/server_validator-block-volume/_data/*"
sudo tar -xzvf ./creditcoin-block-volume.tar.gz -C /var/lib/docker/volumes/server_validator-block-volume/

# Open screen and run
screen -S creditcoin
sudo docker-compose -f ./CreditcoinDocs-Mainnet/Server/creditcoin-with-gateway.yaml up
# <Ctrl+A, D> to exit
# screen -r creditcoin to re-enter

# Setup client
sudo docker exec sawtooth-validator-default cat /etc/sawtooth/keys/validator.priv
# Copy key
nano ./CreditcoinDocs-Mainnet/Client/clientConfig.json
# Replace <256_bit_key_secp256k1_ECDSA> with the key

# Run client
screen -S ccclient
sudo docker-compose -f ./CreditcoinDocs-Mainnet/Client/creditcoin-client.yaml up -d
sudo docker exec -it creditcoin-client bash
## Check sighash
./ccclient sighash
## Check block height
./ccclient tip
# <Ctrl+A, D> to exit
# screen -r ccclient to re-enter
# To stop, sudo docker-compose -f Client/creditcoin-client.yaml down

# Change sighash
sudo docker exec -it sawtooth-validator-default bash
echo 'MYPRIVATEKEY' > /etc/sawtooth/keys/validator.priv
# MYPRIVTEKEY from "sudo docker exec sawtooth-validator-default cat /etc/sawtooth/keys/validator.priv"
exit
```

---

<div class="post-metadata">

**Author:** ![anon7085849](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anon7085849](https://community.creditcoin.org/u/anon7085849)\
**Post date:** [October 13, 2020, 3:11am UTC](https://community.creditcoin.org/t/clayops-creditcoin-miners-commandline/59/2 "2020-10-13T03:11:14Z")

</div>

Are you asking for these steps to be included in the shell script start\_creditcoin.sh ?

---

<div class="post-metadata">

**Author:** ![pringles](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.creditcoin.org/pringles/32/64_2.png) [@pringles](https://community.creditcoin.org/u/pringles)\
**Post date:** [October 13, 2020, 3:44am UTC](https://community.creditcoin.org/t/clayops-creditcoin-miners-commandline/59/3 "2020-10-13T03:44:59Z")

</div>

Adding everything in the whole seems cumbersome and difficult because a lot of code needs to be fixed. If there are no necessary programs such as docker-compose and netcat, I think the user experience will be improved if the installation part is added.

---

<div class="post-metadata">

**Author:** ![anon7085849](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anon7085849](https://community.creditcoin.org/u/anon7085849)\
**Post date:** [October 13, 2020, 4:39pm UTC](https://community.creditcoin.org/t/clayops-creditcoin-miners-commandline/59/4 "2020-10-13T16:39:15Z")

</div>

Ultimately we should combine the best of all script sources and evolve a single version. The scripts are open source, anyway.

---

<div class="post-metadata">

**Author:** ![ctcboom](https://avatars.discourse-cdn.com/v4/letter/c/41988e/32.png) [@ctcboom](https://community.creditcoin.org/u/ctcboom)\
**Post date:** [October 15, 2020, 7:06am UTC](https://community.creditcoin.org/t/clayops-creditcoin-miners-commandline/59/5 "2020-10-15T07:06:00Z")

</div>

이게 들어가면 정말 큰 도움 되겠습니다.

---

<div class="post-metadata">

**Author:** ![anon7085849](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@anon7085849](https://community.creditcoin.org/u/anon7085849)\
**Post date:** [October 17, 2020, 5:19pm UTC](https://community.creditcoin.org/t/clayops-creditcoin-miners-commandline/59/6 "2020-10-17T17:19:18Z")

</div>

I will incorporate some of [pringles](https://community.creditcoin.org/u/pringles) work at [https://pastebin.com/TMpfvBN4](https://pastebin.com/TMpfvBN4)  
in Gluwa’s shell scripts.

---

<div class="post-metadata">

**Author:** ![pringles](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.creditcoin.org/pringles/32/64_2.png) [@pringles](https://community.creditcoin.org/u/pringles)\
**Post date:** [October 18, 2020, 5:38pm UTC](https://community.creditcoin.org/t/clayops-creditcoin-miners-commandline/59/7 "2020-10-18T17:38:07Z")

</div>

it’s clayop’s work. thx glenn!
