Title: testnet4 in a container Post by: mocacinno on May 15, 2024, 07:46:39 AM I decided to completely re-design the containers to make them (even more) safe and to make them easyer to maintain. In order not to clutter this discussion and focus on the new container images, i started a new thread: https://bitcointalk.org/index.php?topic=5501093
If you have any questions about this old discussion that isn't solved in the new thread, shoot me a PM or switch to the new thread instead! Hi guys, tought i would share my work (in progress) ;D I was part of this discussion: https://bitcointalk.org/index.php?topic=5496329.0 It was about a potential switch to testnet4... I quickly pointed out how to merge the pull request for testnet4, but last night i started to think: i want to do this in a reproducible way... So i created a docker image you could easily run yourself... Code: FROM ubuntu:22.04 AS builder you can either build the image yourself (should be reproducible), or you can use the image i built: https://hub.docker.com/r/mocacinno/btc_testnet4 Afterwards, create a simple docker-compose.yml Code: version: '3' Ofcourse, change the volume path to a path that exists on your host, and change the rpc user and pass :) Then it's just a matter of "docker-compose up -d" to pull the image and start bitcoind. Connect to the running container and create a wallet: Code: docker exec -it bitcoind /bin/bash a (testnet4) tipping address: tb1qumlhr8tn9gsdyujy464jkk4c5r488u8kxteyx5 (only send testnet4 tBTC!!!) :P Title: Re: testnet4 in a container Post by: mocacinno on May 15, 2024, 08:29:44 AM I have tried to put a "mining" image together aswell:
Code: FROM ubuntu:22.04 AS miner you can build it yourself, or get if from dockerhub mocacinno/btc_testnet4:cpuminer if you use this docker-compose.yml to start: Code: version: '3' you can afterwards log in to the running container like this: Code: docker exec -it bitcoind /bin/bash and start cpu mining like this (replace my address by yours offcourse) Code: cpuminer -a sha256d -o http://127.0.0.1:5000 -O demo:demo --coinbase-addr=tb1qumlhr8tn9gsdyujy464jkk4c5r488u8kxteyx5 the problem is the only vps i currently have is slooooooooooooooow (it's a small vps from hostnamaste and they seem to have overloaded their hosts. Logging in takes about 2 minutes, let alone running a cpu miner)... I barely get 20 Mhashes per second (really, not kidding......). I have no idear if the mining actually works, since at this hashrate i will not find anything. update it seems like somebody is running an asic on the testnet4... hashrate is 425 Th, so my 22Mh is < 1/19.000.000 of the current network hashrate... On average, i'd hit one block every >300 years. I just hope this asic-miner turns off his asic from time to time to give the cpuminers a chance... Maybe i have to dust off my old geccoscience compaq... If i remember correctly it hashed somewhere at the 50 Gh range??? At least i'd have 1/8500 of the total network hashrate, and i would be able to mine a block every couple of months... ~sigh~ Title: Re: testnet4 in a container Post by: DaveF on May 15, 2024, 01:22:23 PM the problem is the only vps i currently have is slooooooooooooooow (it's a small vps from hostnamaste and they seem to have overloaded their hosts. Logging in takes about 2 minutes, let alone running a cpu miner)... I barely get 20 Mhashes per second (really, not kidding......). I have no idear if the mining actually works, since at this hashrate i will not find anything. update it seems like somebody is running an asic on the testnet4... hashrate is 425 Th, so my 22Mh is < 1/19.000.000 of the current network hashrate... On average, i'd hit one block every >300 years. I just hope this asic-miner turns off his asic from time to time to give the cpuminers a chance... Maybe i have to dust off my old geccoscience compaq... If i remember correctly it hashed somewhere at the 50 Gh range??? At least i'd have 1/8500 of the total network hashrate, and i would be able to mine a block every couple of months... ~sigh~ That will continue to be an issue forever with anything that is 'low use' and has a mining algo that has asics for it. There are so many 2 or 3 gen out miners that are just sitting there that it's not a big deal to mine something worthless with it. The difference in loss for the cost of power between something that has $0 value and the potential profit of mining BTC (or LTC or whatever) that has value but a difficulty that is that high is just about nothing. Back to this, has anyone been able to compile this for windows? I tried last night and got a bunch of errors. Was exhausted and doing it remotely and just went to bed. Didn't even record the errors. -Dave Title: Re: testnet4 in a container Post by: seoincorporation on May 15, 2024, 03:55:31 PM Great job mocacinno, you automate the full process. Now people can start working with Testnet 4 in an easy way.
And it would be if user could mine with CPU, but as you say, 1 modern iner would kill that option for all. It would be fun to include a rule on the node setting a limit for miners. But i know that's not possible because that would not only affect the big engines, but would affect the pools too. This gives me the idea of opening a mining pool for tBTC 4, that way even if users do not have the hardware, they could get a small piece of the cake with their CPU. But tBTC4 is still green, let's give it some time to mature. And again, thanks for the apport. Title: Re: testnet4 in a container Post by: mocacinno on May 24, 2024, 01:36:07 PM I built (yet another) image that is including c-lighting + a simple walktrouh
I've updated the info on dockerhub: https://hub.docker.com/repository/docker/mocacinno/btc_testnet4/general If anybody is interested, i'm running two bitcoin nodes on testnet4, and two testnet4 lightning nodes on top of my bitcoin testnet4 node... I'll be AFK during the weekend, but when i get back on monday, i'll see if there are people interested in connecting to my testnet4 lightning node, creating some funded channels and creating some invoices :) the Dockerfile itself is as follows: Code: FROM ubuntu:22.04 AS lightning Title: Re: testnet4 in a container Post by: baryonlee on May 27, 2024, 12:30:52 PM Thank you very much. I am launching the testnet4 docker container in live.
Great work! 🔴 [Live] The Note block explorer is currently syncing with the BTC Testnet4. We've throttled the speed to one block per second so you can observe this process in real-time. Check it out here: https://testnet4.noteprotocol.org (https://testnet4.noteprotocol.org) And For the main network https://explorer.noteprotocol.org (https://explorer.noteprotocol.org) Title: Re: testnet4 in a container Post by: mocacinno on June 12, 2024, 11:40:32 AM new image available: mocacinno/btc_testnet4:ckpool
you can either pull this image, or build your own... The Dockerfile is available from my git repo: https://github.com/mocacinno/btc_testnet4/tree/ckpool currently running @ my vps IN SOLO MINING MODE with 2% donation... example cpuminer command to mine on this testnet4 pool: Code: cpuminer -o stratum+tcp://173.46.81.70:3334 -u tb1qumlhr8tn9gsdyujy464jkk4c5r488u8kxteyx5 -p x -a sha256d or if you prefer minerd: Code: minerd -a sha256d -o stratum+tcp://173.46.81.70:3334 -O tb1qumlhr8tn9gsdyujy464jkk4c5r488u8kxteyx5:x offcourse, exchange my testnet addy by yours :) i give no guarantee whatsoever, not even that i configured this pool correctly... It's testnet guys... The pool will run untill the vps crashes (i rented this vps for the sole purpose of testnet4 containerisation, so when my work is done, i'll no longer pay for it). no user interface or stats available... you either trust me to run the pool, or you run your own (which is really easy using the container image provided). Title: Re: testnet4 in a container Post by: garlonicon on June 12, 2024, 05:20:44 PM Quote example cpuminer command to mine on this testnet4 pool Is there an option to always get block headers with minimal difficulty? Or maybe you use just the default settings, and those CPU miners are trying to compete with ASICs, and their difficulty?Edit: If you use just the default settings, then I guess manual adjustment of time and difficulty would work, and would form a proper share, right? The main question is: if I would fetch some 80-byte header, and change those two fields, to make it CPU-mineable, and submit a share at difficulty one, then it would be accepted or not? Title: Re: testnet4 in a container Post by: mocacinno on June 13, 2024, 05:58:56 AM Quote example cpuminer command to mine on this testnet4 pool Is there an option to always get block headers with minimal difficulty? Or maybe you use just the default settings, and those CPU miners are trying to compete with ASICs, and their difficulty?Edit: If you use just the default settings, then I guess manual adjustment of time and difficulty would work, and would form a proper share, right? The main question is: if I would fetch some 80-byte header, and change those two fields, to make it CPU-mineable, and submit a share at difficulty one, then it would be accepted or not? I'm not completely sure about the inner workings of ckpool to be honest... I did set the minimum share diff to 1, aswell as the starting diff. I'm cpu mining myself, and every share i've sent was valid if it had a diff of >= 1. I did solve two blocks whilst solo mining with my cpu on my own solo pool, but by the time they got relayed they were already stale. If no block is found for 20 minutes on the testnet, the diff resets to 1, and you have a very brief window before one of those ASIC miners solves and relays a block at diff 1. It's a longshot tough, and so far my 2 "solved" blocks did not make it into the blockchain. Title: Re: testnet4 in a container Post by: garlonicon on June 13, 2024, 06:29:32 AM Quote and you have a very brief window before one of those ASIC miners solves and relays a block at diff 1 The window to mine it is quite wide. The window to broadcast it is shorter, but only if the network is two hours in the future, like testnet3. For testnet4, as long as you don't see blocks from the future, you can safely submit them, and get them confirmed, even if you mine them on your CPU.Example modification in Bitcoin Core, that could help mining blocks on CPU: Quote Code: $ git diff 86fea43762 5ffd95377b Title: Re: testnet4 in a container Post by: LoyceV on June 13, 2024, 07:50:54 AM ELI5 for me garlonicon: does this mean you're always mining at difficulty 1, so you have a block ready the moment the difficulty drops after 20 minutes without a block?
Title: Re: testnet4 in a container Post by: garlonicon on June 13, 2024, 08:55:19 AM Quote does this mean you're always mining at difficulty 1, so you have a block ready the moment the difficulty drops after 20 minutes without a block? Yes. Because if you have a field in the block header called "difficulty", then you have to put something there. And you have a choice: putting the real difficulty, or the minimal one. If you have an ASIC, you can put the real one. But: if you mine for example a half-baked block with your ASIC, then you cannot submit "the best header you did", because it does not meet the network difficulty. After 20 minutes, even if you have ASIC, you have to switch to the minimal difficulty, and mine it separately.So, the conclusion is: all is left to the network propagation. Both CPU and ASIC miners have their blocks with minimal difficulty, prepared in advance. And then, the winner is not the one, who can mine it faster. The winner is the one, who can propagate it faster. And for that reason, you can compete with ASICs, and mine some blocks even on your CPU. But obviously, this method is not bulletproof. First, if you have some ASIC, then you can decide to reorg all CPU-mined blocks, and nobody will stop you. Second, you have to mine and propagate a block. Serious miners are well-connected, so if your propagation is worse, then you will get a block, but it will be stale. Edit: One more thing: obviously, if someone is mining with CPU-only difficulty, then the time of the block is set to 20 minutes. But the real difficulty is set to 10 minutes. So, it is normal to have ASICs in-between. Another observation is that mining on top of some ASIC block is the easiest thing to do, because ASICs usually set the real time in their blocks, while CPU miners are working on the future, for example one or two hours forward (so after some ASIC block, there is a wider room for propagating new CPU blocks). Title: Re: testnet4 in a container Post by: mocacinno on June 14, 2024, 07:44:29 AM I'm searching for a guinea pig...
I just upgraded lightning core from 24.02.2 to 24.05 in my development container image... However... I'm already renting 2 VPS's right now with the sole purpose of testnet4 containerisations and they're both running a container image i modified and not yet saved, so i'm unable to test the new version out without renting yet another vps (unless i start messing with ports, which is a hassle) On dockerhub, i'm keeping the stable versions, so if you pull from dockerhub, you should always get a working setup. On github, i have a CI/CD pipeline that automatically builds when i commit to my master branch. So on github, i have the "unstable/untested" versions (like the latest version containing the core lightning upgrade). Is there anybody willing to pull v0.0.3 from github and test core lightning? The build process is completely transparent and automatic, so you can verify i didn't mess with the image
Offcourse, you're welcome to just take the dockerfile and build it yourself. Basically, i'm looking for somebody to follow the following walktrough: https://github.com/mocacinno/btc_testnet4/tree/lightning, but when the step "edit the docker-compose.yml file" is suggested, also replace the image on dockerhub by ghcr.io/mocacinno/btc_testnet4:latest On my modified node, i also have core lightning 24.02.2, so i only need one person to test out the new image, since the "guinea pig" can just connect to my node to open a channel. Offcourse, i'll send some tBTC (testnet4) to cover channel creation to whoever volunteers :) I'm going to Susecon in Germany for most of next week, so i'll be AFK starting this evening up untill next thursday. If i cannot find a volunteer by this evening, i'll have to postpone the testing untill friday the 21st of june. Title: Re: testnet4 in a container Post by: mocacinno on June 26, 2024, 07:55:25 AM I decided to completely re-design the containers to make them (even more) safe and to make them easyer to maintain. In order not to clutter this discussion and focus on the new container images, i started a new thread: https://bitcointalk.org/index.php?topic=5501093
If you have any questions about this old discussion that isn't solved in the new thread, shoot me a PM or switch to the new thread instead! |