crisadamo / gochain Goto Github PK
View Code? Open in Web Editor NEWA basic implementation of Blockchain
A basic implementation of Blockchain
Hi,
Nice project. Was working on a Go Blockchain implementation myself and noticed that your hashing always returns the same hash, throughout the entire chain.
The thing is that you are trying to hash a block with binary.Write(&buf, binary.BigEndian, block)
which gives you an error you don't handle. The data for binary.Write
must be a fixed-size value, your Block contains a string which isn't fixed size.
I've made a workaround by marshalling the block first, that way the binary.Write
succeeds and your hashing the chain properly. It is a bit slow though, if you'll find a better solution, drop me a line.
You can see it here, feel free to use it:
https://github.com/Grrrben/gocoin/blob/master/blockchain.go#L55
Cheers.
Switch form HTTP too RPC to increase the performance of every request and you get a lot of additional features which HTTP don't have.
This project seems pretty interesting. I can offer you my help to speed up the development process.
contact me anytime ;)
Looks like you're not supplying the previous hash when mining?
Line 100 in fc3aa97
Awesome work - this is a really useful resource!
Hi there,
I was going through your code. However , i am not able to run the go code.
When i run : go build -o gochain
ERROR:
main.go:6:5: cannot find package "github.com/crisadamo/gochain" in any of:
/usr/local/go/src/github.com/crisadamo/gochain (from $GOROOT)
($GOPATH not set
Please mind that i have just started with this technology. Kindly Help.
Good Day!
Hi Cristian,
I get the following error when I build.
Thank you for clue.
gochain/cmd(master*) » go build -o gobuild
main.go:6:5: cannot find package "github.com/crisadamo/gochain" in any of:
/usr/local/Cellar/go/1.8.1/libexec/src/github.com/crisadamo/gochain (from $GOROOT)
/Users/eos/go/src/github.com/crisadamo/gochain (from $GOPATH)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.