Bitcoin Forum
November 19, 2024, 03:17:34 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 25, 2016, 08:03:29 AM
HI,

I see some seemingly contradiction in the code and documentation in the develope reference of bitcoin

https://bitcoin.org/en/developer-reference#data-messages

The currently-available type identifiers are:
Type IdentifierNameDescription
1MSG_TXThe hash is a TXID
2MSG_BLOCKThe hash is of a block header.
3MSG_FILTERED_BLOCKThe hash is of a block header; identical to MSG_BLOCK. When used in a getdata message, this indicates the response should be a merkleblock message rather than a block message (but this only works if a bloom filter was previously configured). Only for use in getdata messages.
Type identifier zero and type identifiers greater than three are reserved for future implementations. Bitcoin Core ignores all inventories with one of these unknown types.


Now if we look at code we see that type (3) is not mentioned in the code, when processing "inv" command.  (module brd.c)

 switch (inv->type) {
                case MSG_TX: strcpy(typestr, "tx"); break;
                case MSG_BLOCK: strcpy(typestr, "block"); break;
                default: sprintf(typestr, "unknown 0x%x", inv->type); break;
                }

Why does the brd.c not use MSG_FILTERED_BLOCK??  I am trying to understand the code with the bitcoin dev wiki.
Thanks for any answers you may give.
2  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 23, 2016, 08:30:56 PM
I added some logging to make the comminication more clear in brd
[20:27:53   GMT-23/04/2016][nc_conn_start][:818], connect start to:88.112.146.73
[20:27:54   GMT-23/04/2016][nc_conn_send][:315], attempting to send:[version] to 88.112.146.73
[20:27:55   GMT-23/04/2016][nc_conn_message][:665], version command received from 88.112.146.73.
[20:27:55   GMT-23/04/2016][nc_conn_send][:315], attempting to send:[verack] to 88.112.146.73
[20:27:56   GMT-23/04/2016][nc_conn_message][:678], verack command received from 88.112.146.73.
[20:27:56   GMT-23/04/2016][nc_conn_send][:315], attempting to send:[getaddr] to 88.112.146.73
[20:27:56   GMT-23/04/2016][nc_conn_send][:315], attempting to send:[getblocks] to 88.112.146.73
[20:27:56   GMT-23/04/2016][nc_conn_message][:691], addr command received from 88.112.146.73.
[20:27:57   GMT-23/04/2016][nc_conn_message][:697], inv command received from 88.112.146.73.
[20:28:03   GMT-23/04/2016][nc_conn_message][:697], inv command received from 88.112.146.73.
[20:28:03   GMT-23/04/2016][nc_conn_send][:315], attempting to send:[getdata] to 88.112.146.73
[20:28:03   GMT-23/04/2016][nc_conn_message][:697], inv command received from 88.112.146.73.
[20:28:04   GMT-23/04/2016][nc_conn_message][:697], inv command received from 88.112.146.73.
[20:28:04   GMT-23/04/2016][nc_conn_message][:697], inv command received from 88.112.146.73.
[20:28:16   GMT-23/04/2016][nc_conn_message][:691], addr command received from 88.112.146.73.
[20:28:16   GMT-23/04/2016][nc_conn_message][:697], inv command received from 88.112.146.73.
[20:28:16   GMT-23/04/2016][nc_conn_message][:697], inv command received from 88.112.146.73.
[20:28:16   GMT-23/04/2016][nc_conn_message][:697], inv command received from 88.112.146.73.
[20:28:16   GMT-23/04/2016][nc_conn_message][:703], block command received from 88.112.146.73.
brd: blkdb add fail  (havent figured this out why this happens)
blocks: process-block failed

3  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 23, 2016, 04:32:38 PM
Hi can some-one please confirm message sequence below?

Hi I am trying to understand the message sequence of BRD deamon, when initial connection is established

From the code i can see  (P1 initiates connection to P2)

P1 ---> connect--> P2
P1 --> sends 'version'  --> P2
P1 <--  reply 'version' -- P2   , in the code i see if the first received message is not "version" its an error
P1 --> sends verack -->P2   ,
P1 <-- reply verack <-- P2  , in code i see this must be the second message received
P1 -->request "getaddr" --> P2
P1 --> request "getblocks" --> P2

Is this correct so far? Thanks

4  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 22, 2016, 11:32:46 PM
questions questions questions

First i see that a new event (libevent) is created with when a "connect" is made with a socket, the event type is  EV_WRITE.  why not EV_READ aswell, Huh

 /* add to our list of monitored event sources */
                conn->ev = event_new(nci->eb, conn->fd, EV_WRITE,
                                     nc_conn_evt_connected, conn);


5  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 22, 2016, 10:15:23 PM
function "nc_conn_group_active" is a "dud" function?  I see it is called from "nc_conns_open"

Can someone explain the rational, you want to limit the number on a "group classification" basis?
.
.
   /* are we already connected to this network group? */
                if (nc_conn_group_active(nci, &conn->peer)) {
                        fprintf(plog, "net: already grouped to %s\n",
                                conn->addr_str);
                        goto err_loop;
                }

.
.


-- FUNCTION  nc_conn_group_active

static bool nc_conn_group_active(struct net_child_info *nci,
                                 const struct peer *peer)

{
        // FIXME
        return false;

        unsigned int group_len = peer->group_len;
        unsigned int i;
        for (i = 0; i < nci->conns->len; i++) {
                struct nc_conn *conn;

                conn = parr_idx(nci->conns, i);
                if ((group_len == conn->peer.group_len) &&
                    !memcmp(peer->group, conn->peer.group, group_len))
                        return true;
        }

        return false;
}
6  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 22, 2016, 03:40:14 AM
comment on my prev question

normally I use static linkage  

noinst_LIBRARIES = xxxxx.a

xxxxx_a_SOURCES = ... list of sources


The picocoin/lib/makefile.am uses LT and it iseems to install the binaries in .libs

Not worked much with the LIBTOOL as i mostly build static libs

lib_LTLIBRARIES..mmm time to break out the autotools book)
7  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 22, 2016, 03:10:25 AM
picocoin and brd are NOT BINARY executables?


#! /bin/sh

# picocoin - temporary wrapper script for .libs/picocoin
# Generated by libtool (GNU libtool) 2.4.2
#
# The picocoin program cannot be directly executed until all the libtool
# libraries that it depends on are installed.

#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.

# Sed substitution that helps us do robust quoting.  It backslashifies
# metacharacters that are still active within double-quoted strings.



PS: I have libtool installed!!

sudo yum install libtool
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.mirror.root.lu
 * epel: mirro[Suspicious link removed]t-systems.com
 * extras: centos.mirror.root.lu
 * ius: mirrors.ircam.fr
 * nux-dextop: mirror.li.nux.ro
 * rpmforge: miroir.univ-paris13.fr
 * updates: mirror.23media.de
Package libtool-2.4.2-21.el7_2.x86_64 already installed and latest version
Nothing to do


 

8  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 20, 2016, 09:45:44 AM
sorry, 2a is a question..... forget '?'  ))
9  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 20, 2016, 09:24:52 AM
Hi,

couple of things

1) I want to use argp in all executables (brd and picocoin doesnt use them). this would be nice because we can put documentation in   <exe> --help.
2) I want to put the origin of a peer (from which seeds it comes from, as defined in dns.c  "dns_seeds" array ) into the bp_address structure( char *pointer). Part of a bunch of statistics I want to reveil in my frontend.
   a) Peers only come from the dns_seeds and are not discovered by being forwarded through other peers ( aka bitorrent)

3) Make an option to only to get ipv4 addresses from bootstrap nodes; default ipv6

If you want i will do the work.


Regards,
10  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 20, 2016, 12:28:57 AM
Hi  Lucifer333,

Is it possible to enable IPv6 on your compu/ ISP?

Maybe we can make it configurable with a command line option (default would be ivp6)?
11  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 19, 2016, 11:21:17 PM
Hi  Lucifer333,

Is it possible to enable IPv6 on your compu/ ISP?

My adsl modem doesnt understand ipv6, I think many ppl still have the old hardware
12  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 19, 2016, 10:58:55 PM
Hi , would it be possible to prevent the seeds from returning IPV6, My compu/ ISP fails all ipv6 addresses.

clist *bu_dns_lookup(clist *l, const char *seedname, unsigned int def_port)
{
        struct addrinfo hints, *res;

        memset(&hints, 0, sizeof(hints));
        /*hints.ai_family = AF_UNSPEC;*/   
        hints.ai_family = AF_INET;

        hints.ai_socktype = SOCK_STREAM;
        hints.ai_flags = AI_CANONNAME;

        if (getaddrinfo(seedname, NULL, &hints, &res))
                return l;

        struct addrinfo *rp;
        printf("canon-name:%s\n", res->ai_canonname);
        for (rp = res; rp != NULL; rp = rp->ai_next){
                l = add_seed_addr(l, rp, def_port);
        }

        freeaddrinfo(res);

        return l;
}
13  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 19, 2016, 09:45:10 PM
Hi Lucifer333,

This and other commits made to picocoin around this date may answer your question :


https://github.com/jgarzik/picocoin/commit/691534ece434ece9315aaca73dfb3974681970a4

Thanks) its very clear

14  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 19, 2016, 09:34:22 PM
HI i found this in brd.c

The "parr" suite of functions and parr structure is to replace the dependency on glibc??

Thanks

static void init_nci(struct net_child_info *nci)
{
        memset(nci, 0, sizeof(*nci));
        nci->read_fd = -1;
        nci->write_fd = -1;
        init_peers(nci);
        nci->conns = parr_new(NC_MAX_CONN, NULL); <----
        nci->eb = event_base_new();
}
15  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: April 19, 2016, 07:39:44 PM
I am trying to learn picocoin/bitcoin by looking at network communication and messaging between bitcoin clients.

picocoin netsync debug=true, doesnt show anything, why?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!