levias
March 26, 2022, 6:48pm
1
I’m new to creditcoin mining. I know that creditcoin2.0 has came out, it’s a big move. I tried to set up my node by following this article
# Creditcoin Mining Node Setup
## Prerequisites
- Working [Docker](https://www.docker.com) installation
## Setup Steps
1) In order to receive mining rewards you will need an account on the Creditcoin network. Each account has an address and a balance associated with it. The account is backed by a keypair. You can use an existing ECDSA keypair (e.g. from pre-Creditcoin 2.0) or you can generate a new keypair. You can use [subkey](https://docs.substrate.io/v3/tools/subkey/) to retrieve the account address from an existing private key (e.g. from pre-Creditcoin 2.0) or to generate a new keypair.
- Using an existing ECDSA keypair:
- Your private key should be formatted as hex and start with `0x`, for example `0x3351b11eca7b5c78c0f55c681d9a2e8a0630bcc7a95a35a4a87615c916771774`
- Note: if your existing private key starts with `00`, remove the leading `00` first.
- Run `docker run -it docker.io/parity/subkey inspect --scheme Ecdsa <private key>` which will display the account information fot the keypair. For example:
```
Secret Key URI `0x3351b11eca7b5c78c0f55c681d9a2e8a0630bcc7a95a35a4a87615c916771774` is account:
Secret seed: 0x3351b11eca7b5c78c0f55c681d9a2e8a0630bcc7a95a35a4a87615c916771774
Public key (hex): 0x02abf7befd96f80ce3a27772e7903f45a930c54ede2f0b9e052bfb21e90e0a4b40
Account ID: 0xe37a568057962e95990cbba46c68f8d5b0d0d614abc8bc9f4e46af3e7aa8880c
This file has been truncated. show original
Because I’m not familiar with docker so I messed up everything. Would you mind to share the script you are using? I’m very appreciated for your help guys. Thanks a lot
4 Likes
ccrpt
March 27, 2022, 12:11am
2
Here’s my shell script.
Step 1) Make a ‘data’ folder where you want.
Step 2) Make a ‘start_docker.sh’ file where you want.
Step 3) Copy & paste the below script into ‘start_docker.sh’.
Step 4) Replace <path to data folder>, <your node name>, <your SS58 mining key>.
Step 5) Run ‘sudo chmod 755 start_docker.sh’ to give the script execution permission.
Step 6) Run ‘./start_docker.sh’ to start mining.
Step 7) Find your node in telemetry.
Telemetry link: Polkadot Telemetry
Explorer link: Polkadot/Substrate Portal
Shell script:
#!/bin/sh
image_name=gluwa/creditcoin:latest
container_name="creditcoin-node"
public_ipv4_address=`curl -m 60 https://checkip.amazonaws.com 2>/dev/null`
ext_port=30333
local_port=30333
local_data_path=<path to data folder>
nodename=<your node name>
sudo docker run --name $container_name -d -p $local_port:$local_port -v $local_data_path:/data $image_name \
--validator \
--name $nodename \
--prometheus-external \
--telemetry-url "wss://telemetry.polkadot.io/submit/ 0" \
--bootnodes "/dns4/bootnode.creditcoin.network/tcp/30333/p2p/12D3KooWAEgDL126EUFxFfdQKiUhmx3BJPdszQHu9PsYsLCuavhb" "/dns4/bootnode2.creditcoin.network/tcp/30333/p2p/12D3KooWRubm6c4bViYyvTKnSjMicC35F1jZNrzt3MKC9Hev5vbG" "/dns4/bootnode3.creditcoin.network/tcp/30333/p2p/12D3KooWSdzZaqoDAncrQmMUi34Nr29TayCr4xPvqcJQc5J434tZ" \
--public-addr "/dns4/$public_ipv4_address/tcp/$ext_port" \
--chain mainnet \
--mining-key <your SS58 mining key> \
--base-path /data \
--port $local_port
5 Likes
levias
March 27, 2022, 2:01am
3
Thank you so so much. It’s really helpful tbh.
3 Likes
levias
March 27, 2022, 2:52am
4
pardon me, sir. I finished the final step then it showed a single line like that
It seems everything ok but then how can I check my miner are working or not? thank you
1 Like
ccrpt
March 27, 2022, 9:51am
5
If you find your node in the telemetry then it works.
Or,
run ‘sudo docker stats’ and find ‘creditcoin-node’ container.
Or,
run ‘top’ or ‘htop’ and find thread ‘/bin/creditcoin-node’.
1 Like
levias
March 27, 2022, 10:50am
6
thank you a lot I finally see it on telemetry. But how can I know my node win a block or not? is there a way that allows me to monitor my node performance?
1 Like
ccrpt
March 27, 2022, 11:28am
7
There is no performance monitor currently.
You can add your SS58 address to address book and can find your balance in the explorer.
Address book of the explorer link: Polkadot/Substrate Portal
2 Likes
levias
March 27, 2022, 12:30pm
8
thank you, sir.
Do you know what minium spec requires for mining? I just realize I have no idea about it
1 Like
ccrpt
March 27, 2022, 6:16pm
9
I don’t know the minimum spec required.
There’s no data. But it’s certain that recent machines can mine though.
1 Like
levias
March 27, 2022, 6:21pm
10
yepp, the only thing I know is that it requires a strong CPU. Based on your experience, can you tell me how many blocks I can expect per day/per week with i9-9900k 64gb ram?
1 Like
ccrpt
March 27, 2022, 7:09pm
11
I expect one to three blocks per day, maybe?
One block gives you 28 $CTC.
2 Likes
FYI, the network IDs for the second and third bootnodes have changed, so:
--bootnodes "/dns4/bootnode.creditcoin.network/tcp/30333/p2p/12D3KooWAEgDL126EUFxFfdQKiUhmx3BJPdszQHu9PsYsLCuavhb" "/dns4/bootnode2.creditcoin.network/tcp/30333/p2p/12D3KooWRubm6c4bViYyvTKnSjMicC35F1jZNrzt3MKC9Hev5vbG" "/dns4/bootnode3.creditcoin.network/tcp/30333/p2p/12D3KooWSdzZaqoDAncrQmMUi34Nr29TayCr4xPvqcJQc5J434tZ" \
Would become:
--bootnodes "/dns4/bootnode.creditcoin.network/tcp/30333/p2p/12D3KooWAEgDL126EUFxFfdQKiUhmx3BJPdszQHu9PsYsLCuavhb" "/dns4/bootnode2.creditcoin.network/tcp/30333/p2p/12D3KooWSQye3uN3bZQRRC4oZbpiAZXkP2o5UZh6S8pqyh24bF3k" "/dns4/bootnode3.creditcoin.network/tcp/30333/p2p/12D3KooWFrsEZ2aSfiigAxs6ir2kU6en4BewotyCXPhrJ7T1AzjN" \
bootnode2.creditcoin.network → 12D3KooWSQye3uN3bZQRRC4oZbpiAZXkP2o5UZh6S8pqyh24bF3k
bootnode3.creditcoin.network → 12D3KooWFrsEZ2aSfiigAxs6ir2kU6en4BewotyCXPhrJ7T1AzjN
3 Likes
@Alientryit This is my ID please check my work
1 Like
The most common way for a beginner to run a validator is on a cloud server running Linux. We strongly recommend using a recent Debian Linux OS. For this guide we will be using Ubuntu 22.04 , but the instructions should be similar for other platforms.
Creditcoin does not currently support Macs using Apple silicon, such as the M1 and M2
The transaction weights in Creditcoin are benchmarked on reference hardware. We ran the benchmark on a memory optimized Standard_E4as_v4
VM instance of Azure.
CPU
Storage
Memory
System
Ubuntu 22.04 (Linux Kernel 5.16 or newer)
1 Like