Pages:
Author

Topic: Simple CPU stratum miner Implementation - page 2. (Read 3986 times)

newbie
Activity: 13
Merit: 0
November 27, 2015, 10:40:45 AM
#7
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?
full member
Activity: 140
Merit: 100
November 27, 2015, 10:12:42 AM
#6
kano i think you are right
newbie
Activity: 13
Merit: 0
November 27, 2015, 08:43:44 AM
#5
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.
legendary
Activity: 4466
Merit: 1798
Linux since 1997 RedHat 4
November 27, 2015, 02:53:18 AM
#4
botnet ...
newbie
Activity: 13
Merit: 0
November 25, 2015, 07:47:10 PM
#3
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:


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);
        }
    }
}
newbie
Activity: 41
Merit: 0
November 25, 2015, 07:04:25 PM
#2
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?
newbie
Activity: 13
Merit: 0
November 25, 2015, 06:28:36 PM
#1
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!
Pages:
Jump to: