Btcd port to peercoin

There is now ongoing bounty to port btcd to Peercoin.
Since info on bounty is very scarce and lacks any specific information I will start this thread so we can compile list on what exactly needs to be done. My goal is to provide detailed job info to person who is going to accept this challenge.

Source of info:

https://blog.conformal.com/btcd-not-your-moms-bitcoin-daemon/

What is btcd?

Btcd is an alternative full-node implementation of the bitcoin protocol written in Go.
It properly downloads, validates, and serves the block chain using the exact rules (including bugs) for block acceptance as Bitcoin Core.
It also relays newly mined blocks, maintains a transaction pool, and relays individual transactions that have not yet made it into a block. It ensures all transactions admitted to the pool follow the rules required by the block chain and also includes the same checks which filter transactions based on miner requirements ("standard" transactions) as Bitcoin Core.
One key difference between btcd and Bitcoin Core is that[u] btcd does NOT include wallet functionality [/u]and this was a very intentional design decision.

So it is program compatible with Bitcoin network, specialized for running a node. Thus lacking wallet capability and using somewhat different API.

UPDATE:

OT developers confirmed that it is best to port btcd to peercoin in long term.

So, mably has forked btcd git repo:

[size=12pt]mably (François) · GitHub
[/size]
There is also a Peer4commit project that supports this repo: [size=12pt]http://peer4commit.com/projects/130[/size]

mably:

I had to fork 8 projects from Conformal to make it compile.

They are available in my GitHub account: mably (François) · GitHub

I also renamed the btcd project to ppcd.

To start working on it you need a git and a mercurial client, and install and configure the Go SDK.

And then it’s as easy as running: go get -u -v GitHub - mably/ppcd: An alternative full node peercoin implementation written in Go (golang)

You can verify that it was built correctly by running: ppcd --testnet -u rpcuser -P rpcpass (should be in the go bin directory).

Haven’t found the bounty on peer4commit, could you provide a link?

btcd is written in Go, a new high level programming language from Google, which is very powerful and specifically designed for multi-process coding.

btcd code is highly modular and well documented, shoudn’t be to hard to try something from it for Peercoin.

Using a btcd/btcwallet fork as a backend for projects like Peerunity could help many developers to get in the train.

And quoting Justus Ranvier from the Open Transactions (OT) project, we’ll need at least to add “a btcd-compatible websocket interface” to Peercoin to be able to integrate it with OT easily.

Some of the websocket extensions available in btcd might be needed: https://github.com/conformal/btcd/wiki/JSON-RPC-API

We definitely need to build a stronger developer community if we want Peercoin to survive the alt-coins war, or it might be left behind.

Ok, sorry, looks like the bounty have been canceled: http://www.peercointalk.org/index.php?topic=3143.0

I have personally been able to download, compile and run the btcd daemon and a few test examples on my laptop pretty easily.

It might be a bit early for an “OT integration bounty” but I think it’s perfectly fine to have a “btcd port bounty” going, even if btcd is still in beta.

So mably, would you maintain btcd branch repo?(repos actually - it’s sooo modularized that there are 3 or more repos to fork)
Their code looks lovely.

[quote=“kac-, post:4, topic:2671”]So mably, would you maintain btcd branch repo?(repos actually - it’s sooo modularized that there are 3 or more repos to fork)
Their code looks lovely.[/quote]

I can help with that.

Maybe make organization repo on github so everything (every forked repo) is one place?

[quote=“peerchemist, post:5, topic:2671”][quote=“kac-, post:4, topic:2671”]So mably, would you maintain btcd branch repo?(repos actually - it’s sooo modularized that there are 3 or more repos to fork)
Their code looks lovely.[/quote]

I can help with that.

Maybe make organization repo on github so everything (every forked repo) is one place?[/quote]

Would be really happy to help.

I think we need some experienced developper who knows perfectly the inner workings of Peercoin to mentor the project.

Sadly, it’s not my case, I’m willing to learn though.

peerchemist idk if we need an org repo, it can be on your account but make it your way.
conformal/btcwire is first to bite into imo.

I had to fork 8 projects from Conformal to make it compile.

They are available in my GitHub account: https://github.com/mably

I also renamed the btcd project to ppcd.

To start working on it you need a git and a mercurial client, and install and configure the Go SDK.

And then it’s as easy as running: [tt]go get -u -v github.com/mably/ppcd/…[/tt]

You can verify that it was built correctly by running: [tt]ppcd --testnet -u rpcuser -P rpcpass[/tt] (should be in the go bin directory).

But sadly it’s still only a bitcoin server.

We now need some Peercoin gurus to chime in to help, kac-?

@mably
btcwire done, tests ok
pull request: https://github.com/mably/btcwire/pull/1

damn, it should be done in two commits, core and tests separately, moment

here, https://github.com/mably/btcwire/pull/2
checkpoint messages not implemented - lets ignore checkpoints, it’ll make code nicer and easier to fork

Merged.

That first PR was quick :slight_smile:

Thanx a lot kac-

Awesome! Like I wrote in the OT-topic, I think long-term Peercoin implemented on btcd is much better than on Bitcoin Core.

Very interesting topic :slight_smile:

@mably: I took a look on Peer4Commit to see if this project was up there, but I didn’t see a listing for it yet. If you’d like to create one, I’ll be happy to chip in peercoins to help get it started.

Bounty created: http://peer4commit.com/projects/130

For those who want to easily play with blkindex.dat
[size=18pt]CTxDB block index in CSV blkindex.csv.zip[/size]
Cheers

[quote=“kac-, post:15, topic:2671”]For those who want to easily play with blkindex.dat
CTxDB block index in CSV blkindex.csv.zip
Cheers[/quote]

Thanx kac-, you’re doing an awesome job on the btcd port project!

Thanks mably, trying my best.
Could someone mine block#3 again? I’ve tried on massive ec2 cpu instance but no success. I need it for btcd test code.

224 bits… I need 215!

Sir mably is going like a lightning over PoS part, this code is on [size=14pt]FIRE![/size]

Looks like we have a first version of ppcd syncing the whole peercoin blockchain:

Many thanks to all who are supporting this project!

Wow! Great work! That sure was fast ;D