Clayop's Creditcoin Miner's Commandline

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

# 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
2 Likes

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

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.

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

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

I will incorporate some of pringles work at https://pastebin.com/TMpfvBN4
in Gluwa’s shell scripts.

1 Like

it’s clayop’s work. thx glenn!