Dherf (OP)
Newbie
Offline
Activity: 13
Merit: 0
|
|
November 25, 2015, 10:28:36 PM Last edit: November 27, 2015, 03:26:45 AM by -ck |
|
Hi to all, for a school project I'll love to implement a simple C# CPU startum miner that connect with a real pool.
Actually I know C# 4.0
Also, here are some details: Port:3333 JASON-RPC
Anyone can help me? I'm stuck at the connection, using a simple TCP doesn't work at all.
Thanks to all!
|
|
|
|
deltalima
Newbie
Offline
Activity: 41
Merit: 0
|
|
November 25, 2015, 11:04:25 PM |
|
Hi to all, for a school project I'll love to implement a simple C# CPU startum miner that connect with a real pool.
Actually I know C# 4.0
Also, here are some details: Port:3333 JASON-RPC
Anyone can help me? I'm stuck at the connection, using a simple TCP doesn't work at all.
Thanks to all!
Would you like to show us some examples of how far you have progressed with this project or would it be easier for you if we just did the project for you and posted the code for you to submit as your own work?
|
|
|
|
Dherf (OP)
Newbie
Offline
Activity: 13
Merit: 0
|
|
November 25, 2015, 11:47:10 PM |
|
Here I post what I have done from now on. I prefer is someone helps me, like, we make it together, so, to make it simple. The main objective is that I can learn how a miner work creating one. the code: using System; using System.IO; using System.Text; using System.Net.Sockets; using System.Security.Cryptography; namespace BitcoinMiner { class MainClass { static internal string user, pass, pool, poolPort, id, extraNonce1, extraNonce2; static internal TcpClient tcp= new TcpClient();
public static void Main() { if (!File.Exists("conf.txt")) { Console.WriteLine("FILE DI CONFIGURAZIONE MANCANTE!"); Console.ReadLine(); return; } else Carica(); Invia("connessione"); Console.ReadLine(); } static internal void Carica() { StreamReader sr = new StreamReader("conf.txt"); pool = sr.ReadLine(); poolPort = sr.ReadLine(); user = sr.ReadLine(); pass = sr.ReadLine(); sr.Close(); ScriviLog("Configurazione caricata correttamente."); } static internal void Invia(string tipo) { NetworkStream stream; switch (tipo) { case "connessione": {//TCP non funziona!!!! forse serve il sistema delle richieste HTTP!!!!!!!!!!!! ScriviLog("connessione in corso..."); tcp.Connect(pool, Convert.ToInt32(poolPort)); stream = tcp.GetStream(); byte[] a = Encoding.UTF8.GetBytes("{\"id\": 1, \"method\": \"mining.subscribe\", \"params\": []}\\n"); stream.Write(a, 0, a.Length); byte[] d = new byte[tcp.ReceiveBufferSize]; stream.Read(d, 0, (int)tcp.ReceiveBufferSize); ScriviLog(Encoding.UTF8.GetString(d)); stream.Close(); break; } } } static internal void ScriviLog(string log) { Console.WriteLine("[" + DateTime.Now + "] " + log); } } }
|
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
|
November 27, 2015, 06:53:18 AM |
|
botnet ...
|
|
|
|
Dherf (OP)
Newbie
Offline
Activity: 13
Merit: 0
|
|
November 27, 2015, 12:43:44 PM |
|
Why I want to create a botnet for a school project? This make no sense, also, I'll be the first to make this project for school, and I was looking for something different and interesting.
I'm not one of these that want to create botnet or what else.
it's a simple cpu miner, I'm asking for help, so, if anyone want to help me, I'm glad for it.
So, thanks to who'll help me doing this little project.
|
|
|
|
enthus
|
|
November 27, 2015, 02:12:42 PM |
|
kano i think you are right
|
|
|
|
Dherf (OP)
Newbie
Offline
Activity: 13
Merit: 0
|
|
November 27, 2015, 02:40:45 PM |
|
It's happy to see that I'm seen like a criminal when I ask for simple help.
Yeah... a very helping place isn't it?
|
|
|
|
nepaluz
Newbie
Offline
Activity: 22
Merit: 0
|
|
November 28, 2015, 12:39:41 AM |
|
How is this question a botnet? Some people are just foolishness itself!
Your code is not complete as you will need to connect to a remote pool with your socket, or you'll need to interface with getblocktemplate if you are running a local node.
|
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
|
November 28, 2015, 11:43:53 AM |
|
How is this question a botnet? Some people are just foolishness itself!
Your code is not complete as you will need to connect to a remote pool with your socket, or you'll need to interface with getblocktemplate if you are running a local node.
Why would anyone write a CPU miner on windows? It's pointless except to make a botnet. (though a botnet would require probably 50,000 computers just to equal a 1TH miner) I even had someone come to my pool channel yesterday saying he had a botnet ot 143,000 computers and where can he get a CPU miner. Of course I kicked him and banned him (he was using a vpn so there was no point trying to work out where he was from) Seriously, an obvious question with an obvious reason. Since it has no use whatsoever, write an ASIC miner that uses a $2 USB miner and see if you can get that to work.
|
|
|
|
Dherf (OP)
Newbie
Offline
Activity: 13
Merit: 0
|
|
November 28, 2015, 12:11:50 PM |
|
I'm only at the second year of programming, it's the first time I use the socket and net dll.
And, before yesterday I don't know what a botnet was.
it's only a project for school, I need a good vote as I'm a bit low on this school subject.
I know that a CPU miner is unuseful for bitcoin, but it's the best project I cna think of to try and take the best mark form my teacher.
I have only 1 week left before I have to send the work.
Also, for a botnet, it should be more comfortable to write right into the code the link, port etc to connect to the pool, and not using an external file!
I any case, I don't use any vpn, or whatever to hide form where I'm, if you want I tell you too, it's not a problem for me.
Just please, I'll not make any trouble, I just need a good mark for it, please, I'm only asking for some help, nothing more.
If there is anything I cna do to prove that it's a botnet, or any kind of similar thing, just tell me, I'll prove that it's a simple school project, nothing more nothing less, promise.
|
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
|
November 28, 2015, 01:27:00 PM |
|
... Since it has no use whatsoever, write an ASIC miner that uses a $2 USB miner and see if you can get that to work.
|
|
|
|
Dherf (OP)
Newbie
Offline
Activity: 13
Merit: 0
|
|
November 28, 2015, 09:24:03 PM Last edit: November 28, 2015, 10:57:50 PM by Dherf |
|
Yeah, so, I bring an ASCI miner to school and say that I did it? The best way to have the worst mark...
|
|
|
|
os2sam
Legendary
Offline
Activity: 3582
Merit: 1094
Think for yourself
|
|
November 28, 2015, 11:28:51 PM |
|
Yeah, so, I bring an ASCI miner to school and say that I did it? The best way to have the worst mark...
Maybe you should be doing your own homework instead of asking others to do it for you. I can't believe that a fledgling programmer is incapable of reading the plethora of source code available to do just what you are asking. You should be asking for sources of information, not how to do something, it kind of defeats the purpose of education, in my opinion.
|
A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?
|
|
|
Dherf (OP)
Newbie
Offline
Activity: 13
Merit: 0
|
|
November 30, 2015, 03:16:17 PM |
|
In fact, I'm NOT asking others to do it for me.
I'm asking others how I can connect in first, because I didn't understand it right, as the server, simply close the connection.
I read on how it works, all say TCP, but TCP doens't connect, so I'm confused.
The education works fine too if somebody tells me where I'm doing wrong, I'll be able to learn it quickier and do it right, or I'm wrong?
So, I remember, I'm asking for help with a problem into the code, not for a program just completed by others!
|
|
|
|
kano
Legendary
Offline
Activity: 4592
Merit: 1851
Linux since 1997 RedHat 4
|
|
November 30, 2015, 03:23:35 PM |
|
Yeah, so, I bring an ASCI miner to school and say that I did it? The best way to have the worst mark...
You clearly do not understand at all how a USB asic miner works ... so much so since your comment is completely wrong.
|
|
|
|
nepaluz
Newbie
Offline
Activity: 22
Merit: 0
|
|
November 30, 2015, 06:34:06 PM |
|
Honestly, if the question asked is so far off the mark why bother to answer or even post a response? It is as though asking a question that may fit anyone's incongruent pre-concenceptions warrants snide remarks. Guys, spare us your frustrations, if you can not or do not want to answer, do not answer at all.
|
|
|
|
Dherf (OP)
Newbie
Offline
Activity: 13
Merit: 0
|
|
December 01, 2015, 04:23:57 PM |
|
Well, if I'm wrong on something, why then you don't simple tell me where I'm wrong without saying it like I'm a completely ignorant? I'm pretty new to all of this, and never read about ASCI before, it was obvious, I write it at the beginning that I was new, or not?
In every case, stop with all this complaning about everything I say or did, if somebody want to help me, just did it here or with a PM, I have only a few days left, and I need to hurry.
I wasted too much time for complains.
Also, thank for saying it nepaluz.
|
|
|
|
morantis
|
|
December 01, 2015, 04:27:18 PM |
|
I suggest that you download the source for stratum-proxy and start picking through the source to see how to interact with the network.
|
|
|
|
Dherf (OP)
Newbie
Offline
Activity: 13
Merit: 0
|
|
December 01, 2015, 09:04:12 PM |
|
It's a good suggestion, thanks, but I only know the C# language so far, that is the real problem, I didn't find a C# proxy for now. Did you know one?
|
|
|
|
Rabinovitch
Legendary
Offline
Activity: 2030
Merit: 1076
BTCLife.global participant
|
|
December 03, 2015, 12:04:33 PM |
|
botnet ...
Personally I would like to run such a miner under Windows at my work during working day (after end of working day my laptop crunches BOINC projects).
|
|
|
|
|