Author

Topic: NXT :: descendant of Bitcoin - Updated Information - page 814. (Read 2761629 times)

legendary
Activity: 2142
Merit: 1010
Newbie
We did the work you guys asked for at the Miami Bitcoin Conference, now it's time to give the companies exactly what they want from us. So far we have:

- Large marketing budget
- Green (socially responsible)
- New code -- any case a flaw is found in Bitcoin
- Extremely low transaction fees
- Marketing team willing to work with merchants

** For example, we could organize a 30 day swarm push to help attract merchants to the payment processor. Now, that would be a benefit.

What else? What makes us business friendly? What do ** WE ** bring to the table for a payment processor?  Why would it be a mistake NOT to add us?

Cfb just mentioned all POS would die except NXT because NXT can resist 90% attack.

That was a troll post with a reference to a paper full of BS. Don't worry about other PoS-coins.
legendary
Activity: 1176
Merit: 1134
Whoever has testnet acct 8045498363545361273, I am seeing the pings on my server. You are probably running ubuntu?
It seems there are some problems with Windows and maybe even Mac.
OK, it was a server side problem. I got it working on Mac, but I cant test on windows. I was seeing the same error on the Mac, so maybe it works on Windows now. I am not sure how many requests the server side can handle, it was designed for LAN, not for large number of simultaneous connections. If it dies while I am sleeping, as long as the nodeminer is running, you wont lose the nodecoins.

James

Edit: I am seeing 13997163105778396158 and 8045498363545361273 now. Can either of you test to see if you get the nodecoin Asset after sending in 1 NXT to the nodecoin server acct 18232225178877143084. Please report if you get the coins. It will happen on the next block after the block with the payment
full member
Activity: 168
Merit: 100
Brilliant idea James. Like the concept very much!
legendary
Activity: 1176
Merit: 1134
Whoever has testnet acct 8045498363545361273, I am seeing the pings on my server. You are probably running ubuntu?
It seems there are some problems with Windows and maybe even Mac.
full member
Activity: 224
Merit: 100
Code:
		for (w = 0, i = 0; i < 32; i++)
w |= v[i] = tmp1[i];

Is my pascal version correct?

Code:
w:=0;
for i:=0 to 31 do
begin
  v[i]:= tmp1[i];
  w:=w OR v[i];
end;


What exactly is the "if (i==0) { i=0;}" supposed to do???


looks fine, but are you sure your Pascal compiler supports 0 as an array index?
(Can't remember if the starting index could be set ...)


Quote
What exactly is the "if (i==0) { i=0;}" supposed to do???


that looks like a place for a "conditional" breakpoint for debugging ...  unless someone had wanted to adjust some timing in the loop Wink


Thanks for the review!

Yes, pascal arrays are 0-based. :-)
full member
Activity: 224
Merit: 100
do you need nrs open in order to use solaris??

Yes, you need access to a running instance of NRS, either locally or a trusted (its sends account secrets over http(s)) NRS on a remote server.
full member
Activity: 224
Merit: 100
CfB,

Is there a definition of the bytes in a transaction? I am trying to figure out which ones are AM and which ones are not.
I thought maybe doing a getTransaction call would return what type of transaction it is, but it doesnt seem to.

Where can we get a reference on decoding the bytes of a getTransactionBytes API call?  And is there anyway to get the bytes for an entire block?  Id really like to learn more about the bits/bytes of NXT, can someone point me in the right direction as far as decoding the blockchain?

I don't know where this is in the Java code, but minusbalancer C# implementation has this here:

https://bitbucket.org/minusbalancer/dotnxt-core/src/13e9648c7cdba58cd8eef673375e117598d2dc34/Transaction.cs?at=master

Search for GetBytes() and you'll see how the different fields of a transaction make up the binary representation.
legendary
Activity: 1176
Merit: 1134
[TEST RELEASE OF NODECOIN MINER]

I did a quick proof of concept NXTcoin today. The coin is actually a NXT AE Asset called "nodecoin", there are 1 billion nodecoins. I made a nodeminer that has been tested on Mac and Linux, no guarantees on Windows. It is is pretty portable C in a self-contained file, so there is a decent chance it will compile under Windows. Let me know if you get it ported to Windows.

OK, so nodecoin was a great idea from Mises_77 yesterday. It inspired me to do some programming and I took a lot of shortcuts. No complaining about lack of features, it is less than 12 hours old!

How does it work? You simply run nodeminer from the command line with your NXT acct id. It does not needs your passkey. For now it is hardcoded to testnet and has a very fast cycle time of 10 seconds. Every 10 seconds that you are forging, 1 nodecoin is "created". However, I was lazy and didnt bother to keep track of who forged which coins, and I certainly didnt database the incoming info. I just add up everyone's total into unclaimed nodecoins. If you are forging, you will be able to see the total unclaimed nodecoins.

Now comes the fun part. ANYBODY can claim all the unclaimed nodecoins by sending in 1 NXT!!

Of course, if there is more than 1 bidder, then the highest bidder wins. I would like to test higher load scenarios, so the more people that test it, the better.

There will be a contest. The one who has the most nodecoins in about 48 hours, will win a 1000 NXT bounty.  Please report any fatal bugs.

build with: gcc -o nodeminer nodeminer.c -lcurl
run with: ./nodeminder

James

Code:
// Totally self-cointained nodecoin miner: nodeminer.c
// by jl777




James, output from windows...

not sure if it is working as expected...
I think I messed up the running version when compiling new versions. I am getting same error. Let me fix it.

legendary
Activity: 1176
Merit: 1134
[TEST RELEASE OF NODECOIN MINER]

Any solutions for those not comfortable compiling, using command line tools etc?

edit: I ask because I just discovered Xcode 5 no longer includes GCC.
it should work with most compilers, but I made compiled versions:

Ubuntu version: http://209.126.71.170/ubuntu/nodeminer md5 e5e7b827e86b92168a28d33fcb6ea1ce
Mac version http://209.126.71.170/mac/nodeminer md5 b5f52738f6b42378d76f90a8a1902253
full member
Activity: 189
Merit: 100
[TEST RELEASE OF NODECOIN MINER]

I did a quick proof of concept NXTcoin today. The coin is actually a NXT AE Asset called "nodecoin", there are 1 billion nodecoins. I made a nodeminer that has been tested on Mac and Linux, no guarantees on Windows. It is is pretty portable C in a self-contained file, so there is a decent chance it will compile under Windows. Let me know if you get it ported to Windows.

OK, so nodecoin was a great idea from Mises_77 yesterday. It inspired me to do some programming and I took a lot of shortcuts. No complaining about lack of features, it is less than 12 hours old!

How does it work? You simply run nodeminer from the command line with your NXT acct id. It does not needs your passkey. For now it is hardcoded to testnet and has a very fast cycle time of 10 seconds. Every 10 seconds that you are forging, 1 nodecoin is "created". However, I was lazy and didnt bother to keep track of who forged which coins, and I certainly didnt database the incoming info. I just add up everyone's total into unclaimed nodecoins. If you are forging, you will be able to see the total unclaimed nodecoins.

Now comes the fun part. ANYBODY can claim all the unclaimed nodecoins by sending in 1 NXT!!

Of course, if there is more than 1 bidder, then the highest bidder wins. I would like to test higher load scenarios, so the more people that test it, the better.

There will be a contest. The one who has the most nodecoins in about 48 hours, will win a 1000 NXT bounty.  Please report any fatal bugs.

build with: gcc -o nodeminer nodeminer.c -lcurl
run with: ./nodeminder

James

Code:
// Totally self-cointained nodecoin miner: nodeminer.c
// by jl777




James, output from windows...

not sure if it is working as expected...
newbie
Activity: 39
Merit: 0


Okay, I will wait for that then. Is it only possible to buy NXTs with Bitcoins at the moment?


Yes.  There are multiple exchanges listed on the first post of the thread.  Dgex.com and Bter.com have the most liquidity.

You can buy Nxt on Bter using CNY.
full member
Activity: 350
Merit: 100
[TEST RELEASE OF NODECOIN MINER]

Any solutions for those not comfortable compiling, using command line tools etc?

edit: I ask because I just discovered Xcode 5 no longer includes GCC (Apple apparently switched to clang).

member
Activity: 98
Merit: 10
Now comes the fun part. ANYBODY can claim all the unclaimed nodecoins by sending in 1 NXT!!

Of course, if there is more than 1 bidder, then the highest bidder wins. I would like to test higher load scenarios, so the more people that test it, the better.

There will be a contest. The one who has the most nodecoins in about 48 hours, will win a 1000 NXT bounty.  Please report any fatal bugs.

This is brilliant! * goes to pop some corn *
newbie
Activity: 5
Merit: 0
Hey guys, how much NXT do I actually need to forge some blocks?

I currently have 10, yes ten, no not 10K, and it says that I can generate a block in 22429 days... Is this for real?  Huh

Can anyone pls to top me up, so that I would not need to wait for several centuries 1762953482260651997  Roll Eyes

Thanks!

That sounds about right.  Account control is being implemented which will allow you to lease your Nxt's forging power to a pool.  This will allow smaller forgers to get consistent fees in relation to their Nxt holdings.

Okay, I will wait for that then. Is it only possible to buy NXTs with Bitcoins at the moment?


Yes.  There are multiple exchanges listed on the first post of the thread.  Dgex.com and Bter.com have the most liquidity.

Oh, I see. I'll have to mine something else and change it to Bitcoin prior to exchanging it to NXTs then...
sr. member
Activity: 476
Merit: 500
legendary
Activity: 1176
Merit: 1134
[TEST RELEASE OF NODECOIN MINER]

I did a quick proof of concept NXTcoin today. The coin is actually a NXT AE Asset called "nodecoin", there are 1 billion nodecoins. I made a nodeminer that has been tested on Mac and Linux, no guarantees on Windows. It is is pretty portable C in a self-contained file, so there is a decent chance it will compile under Windows. Let me know if you get it ported to Windows.

OK, so nodecoin was a great idea from Mises_77 yesterday. It inspired me to do some programming and I took a lot of shortcuts. No complaining about lack of features, it is less than 12 hours old!

How does it work? You simply run nodeminer from the command line with your NXT acct id. It does not needs your passkey. For now it is hardcoded to testnet and has a very fast cycle time of 10 seconds. Every 10 seconds that you are forging, 1 nodecoin is "created". However, I was lazy and didnt bother to keep track of who forged which coins, and I certainly didnt database the incoming info. I just add up everyone's total into unclaimed nodecoins. If you are forging, you will be able to see the total unclaimed nodecoins.

Now comes the fun part. ANYBODY can claim all the unclaimed nodecoins by sending in 1 NXT!!

Of course, if there is more than 1 bidder, then the highest bidder wins. I would like to test higher load scenarios, so the more people that test it, the better.

There will be a contest. The one who has the most nodecoins in about 48 hours, will win a 1000 NXT bounty.  Please report any fatal bugs.

build with: gcc -o nodeminer nodeminer.c -lcurl
run with: ./nodeminder

James

Code:
// Totally self-cointained nodecoin miner: nodeminer.c
// by jl777
// MIT License
//
// build with: gcc -o nodeminer nodeminer.c -lcurl
// run with: nohup ./nodeminder &
//
// It will print out the combined nodecoins earned, the highest bidder in a block will receive all the nodecoins
// Just send NXT to testnet acct 18232225178877143084 to bid for the unclaimed nodecoins



#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include


#define NODESERVER 0

#define SERVER_NAME "209.126.71.170"
#define SERVER_PORT 3005
#define SERVER_PORTSTR "3005"
#define SERVER_VARIANT 0
struct server_request
{
    unsigned long total_minutes;
int forged_minutes,variant,retsize,argsize __attribute__ ((packed));
    char acctid[32];
};

// mainnet
//#define NXTACCT "10154506025773104943"
//#define NXTSERVER "http://localhost:7874/nxt?requestType"

// testnet
char NXTACCT[64] = { "18232225178877143084" };
#define NXTSERVER "https://holms.cloudapp.net:6875/nxt?requestType"
#define NODECOIN "11323329337007086322"
#define NODESLEEP 1
#define NODEBATCH 10
int Forged_minutes,Total_minutes;


typedef void *(*funcp)(char *field,char *arg,char *keyname);
typedef char * (*blockiterator)(char *blockidstr);
struct MemoryStruct { char *memory; size_t size; };

static size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
{
    size_t realsize = size * nmemb;
    struct MemoryStruct *mem = (struct MemoryStruct *)data;
   
    mem->memory = realloc(mem->memory, mem->size + realsize + 1);
    if (mem->memory) {
        memcpy(&(mem->memory[mem->size]), ptr, realsize);
        mem->size += realsize;
        mem->memory[mem->size] = 0;
    }
    return realsize;
}

char *issue_curl(char *arg)
{
    CURL *curl_handle;
    CURLcode res;
    // from http://curl.haxx.se/libcurl/c/getinmemory.html
    struct MemoryStruct chunk;
    chunk.memory = malloc(1);  // will be grown as needed by the realloc above
    chunk.size = 0;    // no data at this point
    curl_global_init(CURL_GLOBAL_ALL); //init the curl session
    curl_handle = curl_easy_init();
    curl_easy_setopt(curl_handle,CURLOPT_SSL_VERIFYHOST,0);
    curl_easy_setopt(curl_handle,CURLOPT_SSL_VERIFYPEER,0);
    curl_easy_setopt(curl_handle, CURLOPT_URL, arg); // specify URL to get
    curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); // send all data to this function
    curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk); // we pass our 'chunk' struct to the callback function
    curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); // some servers don't like requests that are made without a user-agent field, so we provide one
    res = curl_easy_perform(curl_handle);
    if ( res != CURLE_OK )
        fprintf(stderr, "curl_easy_perform() failed: %s\n",curl_easy_strerror(res));
    else
    {
        // printf("%lu bytes retrieved [%s]\n", (long)chunk.size,chunk.memory);
    }
    curl_easy_cleanup(curl_handle);
    return(chunk.memory);
}

long stripstr(char *buf,long len)
{
    int i,j;
    for (i=j=0; i    {
        buf[j] = buf[i];
        if ( buf[j] != ' ' && buf[j] != '\n' && buf[j] != '\r' && buf[j] != '\t' )
            j++;
    }
    buf[j] = 0;
    return(j);
}

int normal_parse(double *amountp,char *buf,int j)
{
    int i,isfloat = 0;
    char *token,str[512];
    if ( buf[j] >= '0' && buf[j] <= '9' )
    {
        for (i=0; i<1000; i++)
        {
            str[i] = buf[j+i];
            if ( buf[j+i] == '.' )
            {
                isfloat = 1;
                continue;
            }
            if ( buf[j+i] < '0' || buf[j+i] > '9' )
                break;
        }
        str[i] = 0;
        //if ( isfloat != 0 )
        *amountp = atof(str);
        //else *amountp = atol(str);
        //printf("naked number (%f) <- (%s).%d i.%d j.%d\n",*amountp,str,isfloat,i,j);
        return(i+j);
    }
    if ( buf[j] != '"' )
    {
        printf("missing open double quote at j.%d (%s)\n",j,buf);
        return(-1);
    }
    j++;
    token = buf+j;
    for (i=0; i<1000; i++)
        if ( buf[j+i] == '"' )
            break;
    if ( buf[j+i] != '"' )
    {
        token[100] = 0;
        printf("missing terminating double quote at j.%d [%s]\n",j,token);
        return(-1);
    }
    else
    {
        buf[j+i] = 0;
        j += i + 1;
        *amountp = atof(token);
    }
    return(j);
}

char *decode_json(char **tokenp,char *buf)  // returns ptr to "value"
{
    int j;
    double amount;
    j = 0;
    *tokenp = 0;
    if ( buf[j] == '{' )
    {
        j++;
        if ( buf[j] == '}' )
            return(0);
        else if ( buf[j] == '"' )
        {
            (*tokenp) = buf+j+1;
            j = normal_parse(&amount,buf,j);
            if ( j <= 0 )
            {
                printf("decode_json error (%s)\n",buf);
                return(0);
            }
            return(buf + j);
        }
    }
    else if ( buf[j] == '"' )
    {
        *tokenp = buf+j+1;
        j = normal_parse(&amount,buf,j);
        if ( j <= 0 )
        {
            printf("decode_json error2 (%s)\n",buf);
            return(0);
        }
        return(buf + j);
    }
    return(0);
}

void *results_processor(char *field,char *arg,char *keyname)
{
    static int successflag,amount;
    static char *resultstr;
    int i,isforging;
    char *retstr = 0;
    char argstr[512];
    if ( arg != 0 )
    {
        for (i=0; i<511; i++)
        {
            if ( arg[i] == 0 )
                break;
            if ( (argstr[i]= arg[i]) == ',' || arg[i] == '"' )
                break;
        }
    } else i = 0;
    argstr[i] = 0;
    if ( field == 0 )
    {
        //printf("successflag.%d amount.%d resultstr.%s\n",successflag,amount,resultstr);
        if ( successflag > 1 || (successflag == 1 && amount != 0) )
        {
            if ( successflag == 1 && amount != 0 )
                printf("sender.%s amount.%d\n",resultstr,amount);
            retstr = resultstr;
        }
        resultstr = 0;
        amount = 0;
        successflag = 0;
        return(retstr);
    }
    else if ( strcmp(keyname,field) == 0 )
    {
        resultstr = arg;
        if ( strcmp(keyname,"lastBlock") == 0 )
            successflag = 2;
    }
    else if ( strcmp(field,"recipient") == 0 && strcmp(NXTACCT,argstr) == 0 )
        successflag = 1;
    else if ( strcmp(field,"amount") == 0 )
        amount = atoi(argstr);
    {
#if NODESERVER == 0
        if ( strcmp("numberOfUnlockedAccounts",field) == 0 )
        {
            isforging = atoi(argstr);
            if ( isforging > 0 )
            {
                Forged_minutes++;
                printf("FORGING.%d ",Forged_minutes);
            }
        }
        //printf("[%s %s] success.%d\n",field,argstr,successflag);
#endif
    }
    return(retstr);
}

char *finalize_processor(funcp processor)
{
    int n;
    char *resultstr,*token;
    resultstr = (*processor)(0,0,0);
    if ( resultstr != 0 )
    {
        n = (int)strlen(resultstr);
        if ( n > 0 )
        {
            token = malloc(n+1);
            memcpy(token,resultstr,n);
            token[n] = 0;
            printf("blockid (%s)\n",token);
        }
        else token = 0;
        return(token);
    }
    else return(0);
}

char *parse_NXTresults(blockiterator iterator,char *keyname,char *arrayfield,funcp processor,char *results,long len)
{
    int j,n;
    double amount;
    char *token,*valuestr,*field,*fieldvalue,*blockidstr;
    if ( results == 0 )
        return(0);
    (*processor)(0,0,0);
    len = stripstr(results,len);
    if ( len == 0 )
        return(0);
    else if ( results[0] == '{' )
        valuestr = results+1;
    else valuestr = results;
    n = 0;
    fieldvalue = valuestr;
    while ( valuestr[0] != 0 && valuestr[0] != '}' )
    {
        fieldvalue = decode_json(&field,valuestr);
        if ( fieldvalue == 0 || field == 0 )
        {
            printf("field error.%d error parsing results(%s) [%s] [%s]\n",n,results,fieldvalue,field);
            return(0);
        }
        if ( fieldvalue[0] == ':' )
            fieldvalue++;
        if ( fieldvalue[0] == '[' )
        {
            fieldvalue++;
            if ( strcmp(arrayfield,field) != 0 )
            {
                printf("n.%d unexpected nested fieldvalue0 %s for field %s\n",n,fieldvalue,field);
                return(0);
            }
            while ( fieldvalue[0] != ']' )
            {
                //j = parse_tx_json(processor,fieldvalue);
                j = normal_parse(&amount,fieldvalue,0);
                if ( j <= 0 )
                {
                    printf("decode_json error (%s)\n",fieldvalue);
                    return(0);
                }
                if ( strcmp(arrayfield,"transactions") == 0 && iterator != 0 )
                {
                    char argstr[64],i,j;
                    i = 0;
                    if ( fieldvalue[i] == '"' )
                        i++;
                    for (j=0; i<64; i++)
                        if ( (argstr[j++]= fieldvalue[i]) == ',' || fieldvalue[i] == '"' )
                            break;
                    argstr[j] = 0;
                    blockidstr = fieldvalue + (fieldvalue[0]=='"'?1:0);
                    (*iterator)(blockidstr);
                    printf("(%s.%d %s)\n",field,n,blockidstr);
                }
                fieldvalue += j;
                if ( fieldvalue[0] == ',' )
                    fieldvalue++;
                n++;
            }
            valuestr = ++fieldvalue;
            if ( valuestr[0] == ',' )
                valuestr++;
            //printf("<%s> ",valuestr);
        }
        else
        {
            if ( (j= normal_parse(&amount,fieldvalue,0)) < 0 )
            {
                printf("n.%d error processing field %s value %s j.%d\n",n,field,fieldvalue,j);
                return(0);
            }
            if ( fieldvalue[0] == '"' )
                token = fieldvalue+1;
            else token = fieldvalue;
            (*processor)(field,token,keyname);
            fieldvalue++;
            valuestr = &fieldvalue[j];
        }
        n++;
    }
    return(finalize_processor(processor));
}

char *issue_getState()
{
    char cmd[512],*jsonstr,*retstr = 0;
    sprintf(cmd,"%s=getState",NXTSERVER);
    jsonstr = issue_curl(cmd);
    if ( jsonstr != 0 )
    {
        //printf("\ngetState.(%s)\n\n",jsonstr);
        retstr = parse_NXTresults(0,"lastBlock","",results_processor,jsonstr,strlen(jsonstr));
        free(jsonstr);
    }
    return(retstr);
}

int wait_for_serverdata(int *sockp,char *buffer,int len)
{
int total,rc,sock = *sockp;
#ifdef __APPLE__
if ( 0 && setsockopt(sock, SOL_SOCKET, SO_RCVLOWAT,(char *)&len,sizeof(len)) < 0 )
{
printf("setsockopt(SO_RCVLOWAT) failed\n");
close(sock);
*sockp = -1;
return(-1);
}
#endif
    //printf("wait for %d\n",len);
total = 0;
while ( total < len )
{
rc = (int)recv(sock,&buffer[total],len - total, 0);
if ( rc <= 0 )
{
if ( rc < 0 )
printf("recv() failed\n");
else printf("The server closed the connection\n");
close(sock);
*sockp = -1;
return(-1);
}
total += rc;
}
return(total);
}

int issue_server_request(struct server_request *req,int variant)
{
static int sds[200];
int rc,i;
char server[128];
char servport[16] = SERVER_PORTSTR;
struct in6_addr serveraddr;
struct addrinfo hints, *res=NULL;
if ( sds[0] == 0 )
{
for (i=0; i<200; i++)
sds[i] = -1;
}
sprintf(servport,"%d",SERVER_PORT+variant);
if ( sds[variant] < 0 )
{
strcpy(server, SERVER_NAME);
memset(&hints, 0x00, sizeof(hints));
hints.ai_flags    = AI_NUMERICSERV;
hints.ai_family   = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
/********************************************************************/
/* Check if we were provided the address of the server using        */
/* inet_pton() to convert the text form of the address to binary    */
/* form. If it is numeric then we want to prevent getaddrinfo()     */
/* from doing any name resolution.                                  */
/********************************************************************/
rc = inet_pton(AF_INET, server, &serveraddr);
if (rc == 1)    /* valid IPv4 text address? */
{
hints.ai_family = AF_INET;
hints.ai_flags |= AI_NUMERICHOST;
}
else
{
rc = inet_pton(AF_INET6, server, &serveraddr);
if ( rc == 1 ) /* valid IPv6 text address? */
{
hints.ai_family = AF_INET6;
hints.ai_flags |= AI_NUMERICHOST;
}
}
/********************************************************************/
/* Get the address information for the server using getaddrinfo().  */
/********************************************************************/
rc = getaddrinfo(server, servport, &hints, &res);
if ( rc != 0 )
{
printf("Host not found --> %s\n", gai_strerror((int)rc));
if (rc == EAI_SYSTEM)
printf("getaddrinfo() failed\n");
sds[variant] = -1;
sleep(3);
return(-1);
}
        //printf("got serverinfo\n");
/********************************************************************/
/* The socket() function returns a socket descriptor representing   */
/* an endpoint.  The statement also identifies the address family,  */
/* socket type, and protocol using the information returned from    */
/* getaddrinfo().                                                   */
/********************************************************************/
sds[variant] = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
if (sds[variant] < 0)
{
printf("socket() failed\n");
sds[variant] = -1;
sleep(3);
return(-1);
}
        //printf("socket created\n");
/********************************************************************/
/* Use the connect() function to establish a connection to the      */
/* server.                                                          */
/********************************************************************/
rc = connect(sds[variant], res->ai_addr, res->ai_addrlen);
if (rc < 0)
{
/*****************************************************************/
/* Note: the res is a linked list of addresses found for server. */
/* If the connect() fails to the first one, subsequent addresses */
/* (if any) in the list could be tried if desired.               */
/*****************************************************************/
perror("connect() failed");
printf("connection variant.%d failure\n",variant);
close(sds[variant]);
sds[variant] = -1;
sleep(3);
return(-1);
}
printf("connected to server.%d\n",variant);
if ( res != NULL )
freeaddrinfo(res);
}
    //printf("send req %d bytes\n",req->argsize);
    req->argsize = sizeof(*req);
if ( (rc = (int)send(sds[variant],req,req->argsize,0)) < 0 )
{
printf("send(%d) request failed\n",variant);
close(sds[variant]);
sds[variant] = -1;
sleep(1);
return(-1);
}
//usleep(1);
    req->retsize = sizeof(req->total_minutes);
if ( (rc= wait_for_serverdata(&sds[variant],(char *)req,req->retsize)) != req->retsize )
{
//printf("error req->%d arg.%x\n",req->datatype,req->dataarg);
return(-1);
}
return(rc);
}

void mine_nodecoins(char *acctid)
{
    struct server_request REQ;
    int variant = 0;
    char *blockidstr;
    while ( 1 )
    {
        blockidstr = issue_getState();
        if ( blockidstr != 0 )
        {
            //issue_getBlock(blockidstr);
            free(blockidstr);
        }
        sleep(NODESLEEP);
        if ( Forged_minutes > NODEBATCH )
        {
            memset(&REQ,0,sizeof(REQ));
            REQ.forged_minutes = Forged_minutes;
            REQ.variant = variant;
            strcpy(REQ.acctid,acctid);
            if ( issue_server_request(&REQ,variant) == sizeof(REQ.total_minutes) )
            {
                printf("Total unclaimed nodecoins %.1f\n",(double)REQ.total_minutes/NODEBATCH);
                Forged_minutes = 0;
            }
        }
    }
}

int main(int argc, const char * argv[])
{
    if ( argc > 1 && strlen(argv[1]) > 5 )
        strcpy(NXTACCT,argv[1]);
    printf("nodeminer starting for NXT.%s\n",NXTACCT);
    mine_nodecoins(NXTACCT);
    curl_global_cleanup();
}


sr. member
Activity: 644
Merit: 250
Hey guys, how much NXT do I actually need to forge some blocks?

I currently have 10, yes ten, no not 10K, and it says that I can generate a block in 22429 days... Is this for real?  Huh

Can anyone pls to top me up, so that I would not need to wait for several centuries 1762953482260651997  Roll Eyes

Thanks!

That sounds about right.  Account control is being implemented which will allow you to lease your Nxt's forging power to a pool.  This will allow smaller forgers to get consistent fees in relation to their Nxt holdings.

Okay, I will wait for that then. Is it only possible to buy NXTs with Bitcoins at the moment?


Yes.  There are multiple exchanges listed on the first post of the thread.  Dgex.com and Bter.com have the most liquidity.
newbie
Activity: 5
Merit: 0
Hey guys, how much NXT do I actually need to forge some blocks?

I currently have 10, yes ten, no not 10K, and it says that I can generate a block in 22429 days... Is this for real?  Huh

Can anyone pls to top me up, so that I would not need to wait for several centuries 1762953482260651997  Roll Eyes

Thanks!

That sounds about right.  Account control is being implemented which will allow you to lease your Nxt's forging power to a pool.  This will allow smaller forgers to get consistent fees in relation to their Nxt holdings.

Okay, I will wait for that then. Is it only possible to buy NXTs with Bitcoins at the moment?

Hey guys, how much NXT do I actually need to forge some blocks?

I currently have 10, yes ten, no not 10K, and it says that I can generate a block in 22429 days... Is this for real?  Huh

Can anyone pls to top me up, so that I would not need to wait for several centuries 1762953482260651997  Roll Eyes

Thanks!

No begging please. This is not Dogecoin. Buy some nxt at an exchange. If you don't have money wash cars, walk dogs, shovel snow, do anything to buy as much as possible it will be worth it. Even with 100k nxt you will not make any money forging so get that mentality out of your head from the start and welcome to the beginning of the rest of your life. Or you can mine any alt coin and miss out on being rich and being a part of the new economy.   Cheesy

That's not really begging, but whatever you say. Thanks for giving me the rough idea of the quantity of NXTs I should have to start forging.
newbie
Activity: 56
Merit: 0
Dear supporters,

 I want to talk with you about the future of Nxt.org. I'm working with Passion_ltc together to make this website the center for the whole Nxt ecosystem.

We have many great ideas for the website, but before we start we need to talk about something inconvenient: the money.

I paid 157,000 NXT and 6 BTC for the domain. A few guys maybe are thinking that this is far too much, but I don't think so. With Nxt.org we finally have a quality domain for a quality product, and if we consider that Nxt will be the future of money then the money was well spent!

2Kool4Skewl asked on nextcoin.org about acquiring the domain. And I'm pretty sure that someone said there was a bounty for this domain.

So I want to ask you if someone knows more about the bounty. Maybe I could get a nice sum of the money back though this?

Thank you very much!

Greetings,
BitVenturer

Quote
According to my calculations if each one of this account (http://87.230.14.1/nxt/nxt.cgi?action=34)
will pay at least 30K nxt from his balance, it will be 1.8M NXT, I think its a fair price

Just give the community the domain for 157,000 NXT and 6 BTC. Maybe a little premium on top. But that's it.

The community didn't appreciate the fact that I got the name, my effort and resources...
You think that the name doesn't cost 1.8M ?
"Community" != "Customer"

I'll give you 250k and donate the domain back to the community.

1.8M Nxt is 172.8 Btc.  That's a high markup that I don't think the community can afford for one domain name.

Let's assume that Nxt is 0.00007 Btc, which was probably approximately the rate Nxt was trading for around the time you purchased the domain.

You spent 6 Btc and 157,000 Nxt for the domain.  6 Btc / 0.00007 Btc per Nxt = 85714.28 Nxt + 157,000 Nxt = 242,715 Nxt

So, you spent approximately 243k Nxt on the domain name.  You would like 1,800,000 Nxt.  I can appreciate the fact that you would like to be rewarded for getting the domain, but I think a 7400% markup is too much.

If everyone can agree on an amount, I'm sure the community would have no problem giving you a bounty for registering the domain.  You would have to transfer control of the domain over to opticalc.
We have lots of domains already, why should we spent so much money to buy another one?
sr. member
Activity: 316
Merit: 250
Simcoin Puny Humans Communicator
Is anyone noticing less forging with 0.7.5?

I have enough to forge every 30 hours or so, but lately the targets are SO LOW, that it's been days since I hit a block. Tonight it got down to 30 minutes, but nothing seems to have happened, nothing in the blockchain explorer, and no alert from mynxt.info and now its back to 4.5 days.

seems weird, dunno.

I have a similar amount and was thinking the same thing.
Jump to: