Bitcoin Forum
September 20, 2018, 01:53:12 PM *
News: ♦♦ Bitcoin Core users must update to 0.16.3 [Torrent]. More info.
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 3 4 5 [6] 7 »  All
  Print  
Author Topic: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client  (Read 30246 times)
cloudboy
Hero Member
*****
Offline Offline

Activity: 689
Merit: 500


View Profile
February 16, 2016, 07:40:08 AM
 #101

seems nobody is interested in adding documentation to this project Sad

too bad, could have gotten some usage

Yeah I agree, it's an interesting project.
1537451592
Hero Member
*
Offline Offline

Posts: 1537451592

View Profile Personal Message (Offline)

Ignore
1537451592
Reply with quote  #2

1537451592
Report to moderator
1537451592
Hero Member
*
Offline Offline

Posts: 1537451592

View Profile Personal Message (Offline)

Ignore
1537451592
Reply with quote  #2

1537451592
Report to moderator
1537451592
Hero Member
*
Offline Offline

Posts: 1537451592

View Profile Personal Message (Offline)

Ignore
1537451592
Reply with quote  #2

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

Activity: 14
Merit: 0


View Profile
April 19, 2016, 07:39:44 PM
 #102

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?
Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 19, 2016, 09:34:22 PM
 #103

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();
}
Aido
Sr. Member
****
Offline Offline

Activity: 249
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
April 19, 2016, 09:43:01 PM
 #104

Hi Lucifer333,

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


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

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 19, 2016, 09:45:10 PM
 #105

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

Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 19, 2016, 10:58:55 PM
 #106

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;
}
Aido
Sr. Member
****
Offline Offline

Activity: 249
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
April 19, 2016, 11:19:55 PM
 #107

Hi  Lucifer333,

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

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 19, 2016, 11:21:17 PM
 #108

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
Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 20, 2016, 12:28:57 AM
 #109

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)?
Aido
Sr. Member
****
Offline Offline

Activity: 249
Merit: 250


1. Collect underpants 2. ? 3. Profit


View Profile
April 20, 2016, 12:36:49 AM
 #110

Yes, this would be doable.

Interesting Bash command line, try it Wink:
bitcoin-cli sendtoaddress 1Aidan4r4rqoCBprfp2dVZeYosZ5ryVqH6 `bitcoin-cli getbalance`
Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 20, 2016, 09:24:52 AM
 #111

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,
Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 20, 2016, 09:45:44 AM
 #112

sorry, 2a is a question..... forget '?'  ))
Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 22, 2016, 03:10:25 AM
 #113

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


 

Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 22, 2016, 03:40:14 AM
 #114

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)
Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 22, 2016, 10:15:23 PM
 #115

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;
}
Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 22, 2016, 11:32:46 PM
 #116

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);


Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 23, 2016, 04:32:38 PM
 #117

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

Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 23, 2016, 08:30:56 PM
 #118

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

Lucifer333
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
April 25, 2016, 08:03:29 AM
 #119

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.
marcopal
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
September 30, 2016, 03:06:11 PM
 #120

I am trying to run picocoin (bitsy) as an SPV client.
I create a wallet and then I run the netsync command.
I always get an empty picocoin.blkdb file.
am I doing anythin wrong?
Pages: « 1 2 3 4 5 [6] 7 »  All
  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!