Bitcoin Forum
September 18, 2019, 03:01:51 PM *
News: If you like a topic and you see an orange "bump" link, click it. More info.
 
   Home   Help Search Login Register More  
Pages: « 1 ... 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 [1752] 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 ... 2567 »
  Print  
Author Topic: NXT :: descendant of Bitcoin - Updated Information  (Read 2756162 times)
ChuckOne
Sr. Member
****
Offline Offline

Activity: 364
Merit: 250

☕ NXT-4BTE-8Y4K-CDS2-6TB82


View Profile
February 18, 2014, 09:28:52 AM
 #35021

- does it mean, then if your node fell into fork, it will automatically recover to the correct chain in 720 blocks time?

No.

It means after 720 blocks a node will never recover!
1568818911
Hero Member
*
Offline Offline

Posts: 1568818911

View Profile Personal Message (Offline)

Ignore
1568818911
Reply with quote  #2

1568818911
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1568818911
Hero Member
*
Offline Offline

Posts: 1568818911

View Profile Personal Message (Offline)

Ignore
1568818911
Reply with quote  #2

1568818911
Report to moderator
1568818911
Hero Member
*
Offline Offline

Posts: 1568818911

View Profile Personal Message (Offline)

Ignore
1568818911
Reply with quote  #2

1568818911
Report to moderator
pandaisftw
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
February 18, 2014, 09:29:05 AM
 #35022

Back to problems with my public node. Today I see all blocks, which appears in blockchain and in recents blocks are not accepted in my public node with the error "DEBUG: Block XXXXXXXXXXXXXXXXXXXX not accepted. Previous block id doesn't match".

What is going on? Do I need to shutdown my node?

Public node http://217.17.88.5:7874/ It shows correct blockchain blocks, it is not on fork.

It just means other nodes are generating incorrect blocks (perhaps on a fork). Don't worry about it if you aren't on a fork.

It says debug, not error Wink

NXT: 13095091276527367030
wesleyh
Sr. Member
****
Offline Offline

Activity: 308
Merit: 250


View Profile
February 18, 2014, 09:29:57 AM
 #35023


Cool to see another web client, however it seems to be using api calls that will be removed soon (getInitialData / processNewData)
mcjavar
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


View Profile
February 18, 2014, 09:48:21 AM
 #35024

[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 <NXT ACCT NUMBER>

James


I can´t understand how it supposed to work..?
Everyone is mining, but the coins  go to the guy who claims them?
Emule
Full Member
***
Offline Offline

Activity: 168
Merit: 100


View Profile
February 18, 2014, 09:50:00 AM
 #35025

[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

when you finally going to stop wasting time, money and resources on all them useless side projects of yours.

STOP BURNING COMMUNITY NXT on useless marketing and side project with 0 result

stick to BCNext his plan.
Damelon
Legendary
*
Offline Offline

Activity: 1092
Merit: 1001



View Profile
February 18, 2014, 09:52:59 AM
 #35026


Cool to see another web client, however it seems to be using api calls that will be removed soon (getInitialData / processNewData)

Who made this? Smiley

Member of the Nxt Foundation | Donations: NXT-D6K7-MLY6-98FM-FLL5T
Join Nxt Slack! https://nxtchat.herokuapp.com/
Founder of Blockchain Workspace | Personal Site & Blog
pandaisftw
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
February 18, 2014, 09:57:03 AM
 #35027

[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

when you finally going to stop wasting time, money and resources on all them useless side projects of yours.

STOP BURNING COMMUNITY NXT on useless marketing and side project with 0 result

stick to BCNext his plan.

Huh, since when were you so concerned about NXT? If I remember correctly... something something, you dumping, and the price goes up over 50%.

FYI, James is doing great work. He just implemented the first working coin on top of NXT (although obviously in the testnet, this is new territory).

NXT: 13095091276527367030
landomata
Legendary
*
Offline Offline

Activity: 1834
Merit: 1000


View Profile WWW
February 18, 2014, 10:04:24 AM
 #35028


when you finally going to stop wasting time, money and resources on all them useless side projects of yours.

STOP BURNING COMMUNITY NXT on useless marketing and side project with 0 result

stick to BCNext his plan.

 Shocked

allwelder
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000



View Profile
February 18, 2014, 10:05:40 AM
 #35029

any detailed info of test on WIN?

What is WIN?
Sorry for my mistake,I mean how to test nodecoin on windows system?

You need compile yourself, I guess
got it ,thanks.
abctc
Legendary
*
Offline Offline

Activity: 1666
Merit: 1004



View Profile
February 18, 2014, 10:05:45 AM
 #35030

...  If it doesn't recover by itself, you will need to delete the nxt_db folder and redownload the blockchain.
What is wrong with the consensus mechanism?
- yes, it would be nice to hear the answer. How can it happens, that node "doesn't recover by itself" ?  If so, that it is definitely something wrong with the consensus mechanism ...
Only 720 block depth for autorecovery is allowed.
- does it mean, then if your node fell into fork, it will automatically recover to the correct chain in 720 blocks time?
No.
- so, it is definitely something wrong with the consensus mechanism now ...  because you need to manually recover your nodes from the fork.

█████████████████████████████████████████████████
███████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
██████████████████████████████████████████████████████
█████
█████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████
███████████████████████████████████████████████████████
█████████████████████████████████████████████████████████████
███████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████
   
, the Next platform.  Magis quam Moneta (More than a Coin)
JKBtCn
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
February 18, 2014, 10:08:34 AM
 #35031

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

Thanks!

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.

I've been trying to learn more about forging (transparent forging) and you raise the exact issue I am looking to resolve as a recent investor. You make it sound like 100,000 NXT is not enough to forge.

I am a miner at heart and like the idea of forging but the more I read about NXT, it seems that only the original stakeholders (or those with a huge number of NXT) are the ones who can successfully forge (gain/accumulate NXT)? How many NXT are needed to forge and what returns could one expect from say 500,000 NXT? Does the chance to forge change over time, i.e. what variables other than my account holdings and online status as a node affect forging success?

This issue has been difficult to get my head around as a recent adopter. I have not forged any NXT since opening my account (20,000 NXT) a few weeks ago and it sounds like from your response that this number is a laughing matter...I will never forge with that amount. Could some one provide some insight or a link to where forging and returns are discussed?


NXT-XFAH-7N9C-6AS6-B3GLZ                BTC: 1MMzqYNNqQMMhY524Z9ThuQrRQW2whCmGk
NHZ: 8709719431783299770                 QORA | 2ND GEN | NEW SOURCE CODE | Qi24ssRqmEo3Wepv9pgdmqNuTDKQByiEfd
Mises_77
Member
**
Offline Offline

Activity: 111
Merit: 10


View Profile
February 18, 2014, 10:13:44 AM
 #35032

[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 <NXT ACCT NUMBER>

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 <NXT ACCT NUMBER> &
//
// 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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include <stdarg.h>
#include <ctype.h>
#include <pthread.h>
#include <curl/curl.h>
#include <curl/easy.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>


#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<len; 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();
}




This is awesome James! I am very happy to have inspired you with the idea. I had a feeling that you were up to something yesterday Wink  I wish I was a coder as I would be in the trenches with you trying to figure this all out with you. I think this really has the potential to help strengthen the NXT network. When I get settled in at my Debian box I will have to check this out further. Very cool.

Mises
LiQio
Legendary
*
Offline Offline

Activity: 1176
Merit: 1002



View Profile
February 18, 2014, 10:16:14 AM
 #35033

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

Thanks!

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.

I've been trying to learn more about forging (transparent forging) and you raise the exact issue I am looking to resolve as a recent investor. You make it sound like 100,000 NXT is not enough to forge.

I am a miner at heart and like the idea of forging but the more I read about NXT, it seems that only the original stakeholders (or those with a huge number of NXT) are the ones who can successfully forge (gain/accumulate NXT)? How many NXT are needed to forge and what returns could one expect from say 500,000 NXT? Does the chance to forge change over time, i.e. what variables other than my account holdings and online status as a node affect forging success?

This issue has been difficult to get my head around as a recent adopter. I have not forged any NXT since opening my account (20,000 NXT) a few weeks ago and it sounds like from your response that this number is a laughing matter...I will never forge with that amount. Could some one provide some insight or a link to where forging and returns are discussed?



http://wiki.nxtcrypto.org/wiki/FAQ#Forging

with 100k you'll forge a block every couple of days - but NXT is not about forging
ChuckOne
Sr. Member
****
Offline Offline

Activity: 364
Merit: 250

☕ NXT-4BTE-8Y4K-CDS2-6TB82


View Profile
February 18, 2014, 10:23:49 AM
 #35034

- so, it is definitely something wrong with the consensus mechanism now ...  because you need to manually recover your nodes from the fork.
I agree.
antanst
Sr. Member
****
Offline Offline

Activity: 294
Merit: 260


View Profile
February 18, 2014, 10:35:17 AM
 #35035


Just tested it, check it out. It's an alternative style for the web client:


This interface is so much an improvement from the default one that should definitely replace it. Scalable icons, various usability enhancements, more serious look.

McDoxy
Member
**
Offline Offline

Activity: 96
Merit: 10


View Profile
February 18, 2014, 10:39:04 AM
 #35036


when you finally going to stop wasting time, money and resources on all them useless side projects of yours.

STOP BURNING COMMUNITY NXT on useless marketing and side project with 0 result

stick to BCNext his plan.

Oh look, it's Mr. 'professional investor - Nxt is gonna fail - I'm gonna dump millions of coins' full of shit and probably still living with his mother cry baby again.
igmaca
Full Member
***
Offline Offline

Activity: 168
Merit: 100


View Profile
February 18, 2014, 10:44:41 AM
Last edit: February 18, 2014, 11:12:42 AM by igmaca
 #35037

Quote

Activity: 70


View Profile  WWW  Personal Message (Offline)
Trust: 0: -0 / +0(0)
Ignore
   
Re: NXT :: descendant of Bitcoin - Updated Information
February 17, 2014, 01:37:11 AM
Reply with quote  #35839
Quote from: bitcoinpaul on February 16, 2014, 11:06:41 PM
Quote from: bitmadaboutcoin on February 16, 2014, 10:58:30 PM
but isnt part of bcexts plan to lower fees and stop greedy hoard and forge? makin it not worth while?


His idea. We don't have to follow it.
I am following BCNext's plan! He is clearly much smarter than me, who am I to second guess his recommendations.
In any case it makes a lot of sense to me that NXT itself should be as close to free to use as possible. Think how much it costs to use the Internet, or normal cash. If using the internet had a per minute fee (like Compuserve did), it would never have become what it is. Most people dont seem to under stand this. Elasticity of price demand, eg. lower cost -> more volumes.

I suggest that everybody just IGNORE any amount that comes in from forging. If it comes in, great, if not, dont worry. NXT is about building an economy. What sort of economy would it be if everybody just sat around waiting and staring at their money waiting for it to magically and spontaneously spit out more money?? The fact that NXT actually does this every once in a while is fantastic, but it is NOT the reason to own NXT. [answer to my rhetorical question is "massive economic depression"]

The reason to own NXT is to be able to build a livelihood around it. Create a product like Anon's silver bars, create a service like many people have already done. You have to do something to get something. Its not really that strange that it works this way is it?

Unless you have 100 BTC and can buy 1 million NXT, you gotta work. Even if you have 1 million NXT, it would be much better if you invested in the best ideas and allow others to make a living.

I am in the process of coming up with ways normal people can make a living by building stuff on top of NXT, but the more people that contribute such ideas the better. I cant be the only one who has ideas on how to make money with NXT.

Let's play a game. post a way you can think of that somebody can make money with NXT, using the tech that is currently being developed. The best idea as measured by (estimated revenues divided by estimated costs to implement) will win 500 NXT bounty. If there is no consensus as to what idea has the best revenue/cost ratio, i will flip a coin and pick the one I like the best.

Deadline is before I sign off tonight, probably 6 to 8 hrs

James

At the dawn of electricity in the late nineteenth century was Thomas Edison envisioned a decentralized system with many small companies competing for generators installed near the point of consumption. Since the electricity distribution cables were still rare , the Edison Electric Lighting Company focused most of his first business in installing generators in small factories, shops, hotels and homes .
In 1888 , Edison had installed 1,700 small plants . In the early twentieth century , more than half of U.S. electricity It was self-produced by industries that took advantage of the waste heat and excess electricity sold to nearby customers.

Quote
Would it be possible to implement Nxt platform under the distributed energy market or better distributed green energy market ?


Is a market where producers and consumers of energy would cross their sales orders and purchase orders simultaneously.

Today a small community of neighbors or landowners can generate and sell energy through solar PV , mini wind power, etc. .

For example an owner decide to install in his home to energy consumption solar pv but at certain times of day to spare and is now selling the excess energy in the Nxt platform.

At one point he needs same energy and buys his deficit in the Nxt platform.

both buyer and seller should obviously pay transport costs to distribution companies but the market for the generation and consumption of energy would peer ( peer to peer) .

This would link with the colored coins and the contract system like Ethereum .

Does anyone dare with the idea ?

If anyone dares I'm interested to collaborate .




I might have to start riding a subforum within nxt  and capture programming experts, renewable energy experts (Here you may include me) experts on markets, marketing, etc. and start brainstorming.

Quote
Nxt I think will make sense when it is full of content.

I'm thinking about the war that was with standard video players as they left. There was a video player launched by Philips that was technically the best but in the end won the battle Sony with beta system because it was the first to incorporate all hollywood movies in their system.

Quote
in substance filled it with contents

I propose to create a thread for every idea that the community is considered feasible and start brainstorming.  Roll Eyes
pandaisftw
Full Member
***
Offline Offline

Activity: 224
Merit: 100


View Profile
February 18, 2014, 10:47:59 AM
 #35038

Just thought of this, another strength of NXT over Bitcoin (@JustABit):

Bitcoin is only successful as a store of value because it currently commands the highest market cap by a large margin, leading people to believe that no alt-coin can ever catch up, preserving the idea of economic scarcity. People sometimes refer to Bitcoin as "digital gold" because only so many can be mined. However, if an Bitcoin clone (aka no new features, just a new name) ever comes close to Bitcoin's market cap, it will prove that Bitcoin's scarcity is artificial - that it can simply be cloned, and be equally successful. Thus, Bitcoin's long-term economic success forever depends solely on the failure of all other cryptocurrencies.

The NXT ecosystem is the exact opposite. Not only can it do everything Bitcoin can do (but cheaper and faster), it actively encourages new coins to be built on top of it. Because NXT provides an economic platform, it does not require artificial scarcity, as the potential for innovation in the ecosystem is unlimited. The value of NXT is in what can be built on top of the ecosystem. Businesses, services, etc. will not disappear if people perceive NXT as not-scarce. The value these businesses and services add to the network can never be diminished, and will only encourage a positive feed-back loop that a healthy economy commands.

In summary, Bitcoin is only valuable because of it's perceived scarcity. NXT is valuable because of the economic platform it provides.

So for a payment processor, it would be in their interest to add NXT because it adds to the value of the NXT economy, stimulating a chain-reaction. Additionally, it may be in their interest to establish themselves as a major player early on (like bitpay and coinbase for Bitcoin) and secure a loyal customer-base. Later, it may be much harder for them to become established, as other payment processors are sure to want to join in.

NXT: 13095091276527367030
xyzzyx
Sr. Member
****
Offline Offline

Activity: 490
Merit: 250


I don't really come from outer space.


View Profile
February 18, 2014, 10:49:29 AM
 #35039

- so, it is definitely something wrong with the consensus mechanism now ...  because you need to manually recover your nodes from the fork.
I agree.

AFAIK, it was always this way.

https://bitcointalk.org/index.php?topic=303898.msg3375569#msg3375569

"An awful lot of code is being written ... in languages that aren't very good by people who don't know what they're doing." -- Barbara Liskov
xcn
Newbie
*
Offline Offline

Activity: 51
Merit: 0


View Profile
February 18, 2014, 10:49:44 AM
 #35040


when you finally going to stop wasting time, money and resources on all them useless side projects of yours.

STOP BURNING COMMUNITY NXT on useless marketing and side project with 0 result

stick to BCNext his plan.

Oh look, it's Mr. 'professional investor - Nxt is gonna fail - I'm gonna dump millions of coins' full of shit and probably still living with his mother cry baby again.

Do not even speak with him, please.
Pages: « 1 ... 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 [1752] 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 ... 2567 »
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!