The source-code for: "Build a Blockchain from Scratch in Go" eBook.

The Blockchain Bar

The source-code for: "Build a Blockchain from Scratch in Go" eBook.

📚 Get the eBook from: https://gumroad.com/l/build-a-blockchain-from-scratch-in-go

book cover

Table of Contents

TBB Training Ledger

Sneak peek to Chapter 13

You will build all of this from scratch! Follow the next 4 steps and you will be connected to the TBB testing blockchain network in 30 seconds.

1/4 Check the current blockchain network status

Go ahead. Try it right now! 💘

curl https://node.tbb.web3.coach/balances/list

In case you have the JQ - CLI JSON processor formatter. installed.

curl https://node.tbb.web3.coach/balances/list | jq
{
  "block_hash": "000000a9d18730c133869d175a886d576df5675e0e73900bf072c59047b9d734",
  "balances": {
    "0x09ee50f2f37fcba1845de6fe5c762e83e65e755c": 1000095,
    "0x22ba1f80452e6220c7cc6ea2d1e3eeddac5f694a": 5
  }
}

2/4 Download the pre-compiled blockchain program

Together with all students, we will use this custom build blockchain for educational purposes.

Install

Download
Linux
wget "https://github.com/web3coach/the-blockchain-bar/releases/download/1.3.2-alpha/tbb-linux-amd64" -O /usr/local/bin/tbb
Verify the version
chmod a+x /usr/local/bin/tbb
tbb version

> Version: 1.3.2-alpha 564d63 TX Ga

3/4 Connect to the training network from localhost

tbb run --datadir=$HOME/.tbb --ip=127.0.0.1 --port=8081 --disable-ssl

Your blockchain database will synchronize with rest of the students.

Launching TBB node and its HTTP API...
Listening on: 127.0.0.1:8081
Blockchain state:
	- height: 0
	- hash: 0000000000000000000000000000000000000000000000000000000000000000

Searching for new Peers and their Blocks and Peers: 'node.tbb.web3.coach'
Found 1 new blocks from Peer node.tbb.web3.coach
Importing blocks from Peer node.tbb.web3.coach...

Persisting new Block to disk:
	{"hash":"000000a9d18730c133869d175a886d576df5675e0e73900bf072c59047b9d734","block":{"header":{"parent":"0000000000000000000000000000000000000000000000000000000000000000","number":0,"nonce":1925346453,"time":1590684713,"miner":"0x09ee50f2f37fcba1845de6fe5c762e83e65e755c"},"payload":[{"from":"0x09ee50f2f37fcba1845de6fe5c762e83e65e755c","to":"0x22ba1f80452e6220c7cc6ea2d1e3eeddac5f694a","value":5,"nonce":1,"data":"","time":1590684702,"signature":"0JE1yEoA3gwIiTj5ayanUZfo5ZnN7kHIRQPOw8/OZIRYWjbvbMA7vWdPgoqxnhFGiTH7FIbjCQJ25fQlvMvmPwA="}]}}


Searching for new Peers, Blocks: 'node.tbb.web3.coach'
Searching for new Peers, Blocks: 'node.tbb.web3.coach'

4/4 Check the current blockchain network status

This time from your OWN, fully synchronized blockchain node running directly on your computer.

curl -X GET http://127.0.0.1:8081/balances/list | jq
{
  "block_hash": "000000a9d18730c133869d175a886d576df5675e0e73900bf072c59047b9d734",
  "balances": {
    "0x09ee50f2f37fcba1845de6fe5c762e83e65e755c": 1000095,
    "0x22ba1f80452e6220c7cc6ea2d1e3eeddac5f694a": 5
  }
}

All of this and much more, you will build from scratch!

Introduction

Hi 👋 ,

With Web 3.0 and blockchain becoming more mainstream every day, do you know what blockchain is? Do you know its technical advantages and use-cases?

The goal of this tutorial is to introduce blockchain technology from a technical perspective by building one from scratch.

Forget everything you've heard about blockchain from social media. Now, you will build a blockchain system from ground zero to really understand the ins and outs of this peer-to-peer, distributed technology.

Afterwards, make your own mind up about its future, advantages and shortcomings.

Spoiler alert: you will fall in love with programming blockchain software. 😈

How?

You will follow the story of a software developer who is looking to revolutionize his local bar by implementing blockchain technology for its payment system.

Although blockchain has several undeniable use-cases, at the moment, the number one application is payments. This is because banks are still running on an inefficient, 40 year old infrastructure powered by CSV files and FTP.

The story comes with a lot of fun and intriguing facts about the overall blockchain ecosystem and different protocols such as Bitcoin, Ethereum and XRP.

What will you build?

Chapter by chapter, you will build a full peer-to-peer, autonomous training blockchain system in Go and learn all standard blockchain components!

Note: This codebase is only for educational (training, learning) purposes. Do not use this code in production.

1) You will build a peer-to-peer system from scratch

You start with 0 lines of code and end-up with 13+ branches with complete executable source-code.

PS: Don't worry if anything on the screen makes sense yet, it will once you go chapter by chapter; release by release.

peer-to-peer blockchain system in action

2) You will secure the system with a day-to-day practical cryptography

No boring theory. Only modern practices.

elliptic curve cryptography

3) You will implement Bitcoin, Ethereum and XRP backend components

From diagrams of mining algorithms to actual, implemented and working crypto wallets for storing the mined tokens and all other fundamental components that make blockchain special.

decentralized consensus

4) You will write unit tests and integration tests for all core components

You will test your cryptographic functions, a Bitcoin's like Proof of Work mining algorithm and other key components.

ethereum signature

How to use this repository

Every eBook chapter has a dedicated branch where you can experiment with the code first-hand.

git pull --all
git branch

> c1_genesis_json
> c2_db_changes_txt
> c3_state_blockchain_component
> c4_caesar_transfer
> c5_broken_trust
> c6_immutable_hash
> c7_blockchain_programming_model
> c8_transparent_db
> c9_tango
> c10_peer_sync
> c11_consensus
> c12_crypto
> c13_training_network
> c14_why_transaction_costs_gas

Installation

Open instructions.

Getting started

  1. Download the eBook from: https://gumroad.com/l/build-a-blockchain-from-scratch-in-go
  2. Open the book at Chapter 1
  3. Checkout the first chapter's branch c1_genesis_json
git pull --all

git checkout c1_genesis_json

Usage

Install

go install ./cmd/...

CLI

Show available commands and flags

tbb help

Show available run settings

tbb run --help

Launches the TBB node and its HTTP API.

Usage:
  tbb run [flags]

Flags:
      --bootstrap-account string   default bootstrap Web3Coach's Genesis account with 1M TBB tokens (default "0x09ee50f2f37fcba1845de6fe5c762e83e65e755c")
      --bootstrap-ip string        default bootstrap Web3Coach's server to interconnect peers (default "node.tbb.web3.coach")
      --bootstrap-port uint        default bootstrap Web3Coach's server port to interconnect peers (default 443)
      --datadir string             Absolute path to your node's data dir where the DB will be/is stored
      --disable-ssl                should the HTTP API SSL certificate be disabled? (default false)
  -h, --help                       help for run
      --ip string                  your node's public IP to communication with other peers (default "127.0.0.1")
      --miner string               your node's miner account to receive the block rewards (default "0x0000000000000000000000000000000000000000")
      --port uint                  your node's public HTTP port for communication with other peers (configurable if SSL is disabled) (default 443)

Run a TBB node connected to the official book's test network

If you are running the node on your localhost, disable the SSL with --disable-ssl flag.

tbb version
> Version: 1.3.2-alpha 564d63 TX Ga

tbb run --datadir=$HOME/.tbb --ip=127.0.0.1 --port=8081 --miner=0x_YOUR_WALLET_ACCOUNT --disable-ssl

Run a TBB bootstrap node in isolation, on your localhost only

tbb run --datadir=$HOME/.tbb_boostrap --ip=127.0.0.1 --port=8080 --bootstrap-ip=127.0.0.1 --bootstrap-port=8080 --disable-ssl

Run a second TBB node connecting to your first one

tbb run --datadir=$HOME/.tbb --ip=127.0.0.1 --port=8081 --bootstrap-ip=127.0.0.1 --bootstrap-port=8080 --disable-ssl

Create a new account

tbb wallet new-account --datadir=$HOME/.tbb 

Run a TBB node with SSL

The default node's HTTP port is 443. The SSL certificate is generated automatically as long as the DNS A/AAAA records point at your server.

Official Testing Bootstrap Server

Example how the official TBB bootstrap node is launched. Customize the --datadir, --miner, and --ip values to match your server.

/usr/local/bin/tbb run --datadir=/home/ec2-user/.tbb --miner=0x09ee50f2f37fcba1845de6fe5c762e83e65e755c --ip=node.tbb.web3.coach --port=443 [email protected] --bootstrap-ip=node.tbb.web3.coach --bootstrap-port=443 --bootstrap-account=0x09ee50f2f37fcba1845de6fe5c762e83e65e755c

HTTP

List all balances

curl http://localhost:8080/balances/list | jq

Send a signed TX

curl --location --request POST 'http://localhost:8080/tx/add' \
--header 'Content-Type: application/json' \
--data-raw '{
	"from": "0x22ba1f80452e6220c7cc6ea2d1e3eeddac5f694a",
	"from_pwd": "security123",
	"to": "0x6fdc0d8d15ae6b4ebf45c52fd2aafbcbb19a65c8",
	"value": 100
}'

Check node's status (latest block, known peers, pending TXs)

curl http://localhost:8080/node/status | jq

Tests

Run all tests with verbosity but one at a time, without timeout, to avoid ports collisions:

go test -v -p=1 -timeout=0 ./...

Run an individual test:

go test -timeout=0 ./node -test.v -test.run ^TestNode_Mining$

Note: Majority are integration tests and take time. Expect the test suite to finish in ~30 mins.

Start

Tutorial

📚 Get the eBook from: https://gumroad.com/l/build-a-blockchain-from-scratch-in-go

Finish

Request 1000 TBB testing tokens

Write a tweet and let me know how did you like this book! Tag me in it @Web3Coach and include your account address 0xYOUR_ADDRESS.

See you on Twitter - @Web3Coach.

License

The the-blockchain-bar library (i.e. all code outside of the cmd directory) is licensed under the GNU Lesser General Public License v3.0, also included in our repository in the COPYING.LESSER file.

The the-blockchain-bar binaries (i.e. all code inside of the cmd directory) is licensed under the GNU General Public License v3.0, also included in our repository in the COPYING file.

Owner
Lukas Lukac
Teaching Web3 at https://web3.coach
Lukas Lukac
Comments
  • Chapter 11 Branch's TestNode_Run fails with memory leak

    Chapter 11 Branch's TestNode_Run fails with memory leak

    Hi there, I am found a issue when following the book, and want to bring it to your attention here:

    How it happened

    As I got to the book's chapter 11, at page 301~304, there is this TestNode_Run test that is added, but locally, I could not make it pass.

    I struggled with it for quite some time, because i was stubborn and tried to type the code all the way to here..... So I went trough each of the files again and again trying to figure out what I was doing wrong that the test was failing..... And didn't get it

    Finally I gave up and cloned the repo, went to branch c11_consensus and.... the test failed exactly as my local hand-typed version!

    Checking out branch c12_crypto, and on, it Passes fine.

    The error

    Here is the error I get when run the go test -timeout=0 -count=1 ./node -test.v -test.run ^TestNode_Run$ command:

    --- FAIL: TestNode_Run (5.00s)
    panic: runtime error: invalid memory address or nil pointer dereference [recovered]
            panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x68f7ef]
    

    Now What

    Well, now I plan to check the diff between branches c11 and c12, hoping to figure out the problem before moving on to the next pages of the book.

    When I checked out the c12_crypto branch, and ran the test, I saw that many dependencies were added, so I figure there are lots of logic and new things going on.

    Because on the book the test passes at this point, I really want to understand what is wrong before going on the new content.

    • I created this issue because I know I will not have the will to do so after figuring out the problem....
    • But I really think it is important to mention it here, so hopefully the code or the book can be fixed.
  • Error if no tx.db file

    Error if no tx.db file

    Basically the first state is a genesis file with no transactions, the transactions need adding. So no tx.db file if you use rm database/tx.db

    I added this code:

    // Now apply the transactions in the transaction file which is a set of json messages
    txDbFilePath := filepath.Join(cwd, databaseDir, "tx.db")
    // If the file doesn't exist then create it
    _, err = os.Stat(txDbFilePath)
    if os.IsNotExist(err) {
    	_, err = os.Create(txDbFilePath)
    }
    if err != nil {
    	return nil, err
    }
    
  • TIP-2

    TIP-2

    GM 🌈 !

    This is the backend implementation of

    As a User I want to traverse database blocks, so I can see all The Blockchain Bar's users activity and what happened when.

    • Add a new API endpoint /block?height= to ./node/http_routes.go to retrieve block by number.
    • Add a new API endpoint /block?hash= to ./node/http_routes.go to retrieve block by hash.

    I haven't done the REST api version with /block/$height as I couldn't figure out how to do pattern matching without gorilla/mux. I am not sure if you guys are ok adding a dependency just for that, maybe we will need it anyway in the future? Anyway TBC, let me know.

    @web3coach

    Cheers to Andrej 🍻

  • Before running TestNode_MiningSpamTransactions the base data needs to be reset

    Before running TestNode_MiningSpamTransactions the base data needs to be reset

    If the tests are run as a whole, and not individually, this test will fail because the accounts will have values from previous tests, rather than the initial setup values.

        node_integration_test.go:618: Andrej balance is incorrect. Expected: 0. Got: 250
        node_integration_test.go:622: BabaYaga balance is incorrect. Expected: 800. Got: 600
        node_integration_test.go:626: Miner balance is incorrect. Expected: 300. Got: 250
        node_integration_test.go:629: Andrej final balance: 250 TBB
        node_integration_test.go:630: BabaYaga final balance: 600 TBB
        node_integration_test.go:631: Miner final balance: 250 TBB
    --- FAIL: TestNode_MiningSpamTransactions (480.01s)
    FAIL
    FAIL	github.com/web3coach/the-blockchain-bar/node	2262.935s
    FAIL```
  • When submitting an invalid transaction all nodes try to mine

    When submitting an invalid transaction all nodes try to mine

    Given:

    • Account with a certain balance When:
    • Transaction value is higher then value hold in balance for the account Then:
    • All nodes try to mine the block, the first successful can not add the block to the chain (as transaction is invalid), all the other nodes continue mining.

    Maybe it would be good to have some pre-mining validation of each transaction?

  • Go Modules & Book Review

    Go Modules & Book Review

    Hi Lukas,

    Just downloaded the book sample from your web3.coach website, and I will look into it.

    As I wanted to ask you on LinkedIn (but aparently you need Premium license to send a message (or it's too late in the night for me right now ... 😴), I am writing to you in this repo:

    1. Since Go 1.14 is already for available for some time, why not just start using it and Go modules, instead of keep promoting usage of the old GOPATH mode?
    2. About the book review, are you referring to what I just downloaded? Or the entire book you are planning to release in the near future? Either way, I would like to provide a review, if you are still interested.

    Thanks.

  • Adds TIP-2: The Blockchain Bar UI - Database Explorer, Faucet, Wallet.

    Adds TIP-2: The Blockchain Bar UI - Database Explorer, Faucet, Wallet.

    Use this PR as a brainstorming discussion section to suggest ideas and implementation details in the comments section below.

    Main goal: learn what goes into a simplified, standard frontend and backend blockchain development for making payments persisted into a distributed ledger.

  • Bump github.com/ethereum/go-ethereum from 1.9.25 to 1.10.10

    Bump github.com/ethereum/go-ethereum from 1.9.25 to 1.10.10

    Bumps github.com/ethereum/go-ethereum from 1.9.25 to 1.10.10.

    Release notes

    Sourced from github.com/ethereum/go-ethereum's releases.

    Sytau (v1.10.10)

    Geth v1.10.10 is another bug fix release.

    Geth changes

    • Geth is much less likely to crash during shutdown, especially when mining is active. (#23435, #21992, #22853)
    • The new --rpc.evmtimeout flag allows setting the internal timeout for eth_call. The default timeout is still 5s. (#23645)
    • The geth console supports some ECMAScript 6 features like arrow functions, typed arrays and let bindings (#23721)
    • The console no longer crashes when trying to complete on properties with value 'null' or 'undefined'. (#23701)
    • The evm debugging/testing tool now validates transaction gas limits in 't9n' mode. (#23694)

    RPC API changes

    • A regression in the JS-based call tracer is resolved. (#23667)
    • The new debug_getAccessibleState RPC method finds a block number at which full state is available. (#23646)
    • The new debug_getHeaderRlp RPC method fetches RLP-encoded headers from the database. (#23670, #23677)
    • The sender address is once again returned correctly for very old Frontier-era transactions. (#23683)

    Go library changes

    • For contract calls using accounts/abi/bind, a regression that could lead to incorrect gas estimation is fixed. (#23719)
    • Package accounts/abi now has basic support for Solidity error types. (#23161)
    • Miner stress test tools work again (they were broken in the previous release) (#23699)
    • The transaction recipient address stored in types.Transaction is now truly independent of the address pointer passed to the constructor. (#23376)
    • The Receipt type now implements encoding.BinaryMarshaler, like Transaction (#22806)
    • TxPool.Pending no longer returns an error (#23720)

    Build

    • As a workaround for tracing issues on Alpine Linux, we now set the C stack size to 8MB for release builds. (#23676)
    • Go module vendoring issues related to github.com/karalable/usb are finally resolved. (#23684)
    • This release is built with Go 1.17.2. (#23698)

    For a full rundown of the changes please consult the Geth 1.10.10 release milestone.


    As with all our previous releases, you can find the:

    Attican Beta (v1.10.9)

    Geth v1.10.9 is a maintenance release containing mostly bug fixes.

    Chain tracing has received quite a bit of attention during this release cycle. JS-based tracing now supports additional callbacks for entry and exit of contract calls, improving performance if processing individual opcodes is not needed.

    Geth command changes

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

  • Add Account/Version to Peer Status, Fix Miner

    Add Account/Version to Peer Status, Fix Miner

    In the output below you will see for the node itself a key of 'node_version' and 'account' have been added. Similarly under the 'peers_known' list, 'account' has been made to display correctly, and a 'node_version' has been added. You can see here that some of the peer data came from the bootstrap node, and as such doesn't contain the 'node_version' data.

    curl -Ls -X GET http://73.94.107.106:8995/node/status | jq .

    {
      "block_hash": "0000007414e771708a2f5e2cdd16e29dd2b2a5a858bbb5341a4eb8d855fc8861",
      "block_number": 19,
      "peers_known": {
        "73.94.107.106:8996": {
          "ip": "73.94.107.106",
          "port": 8996,
          "is_bootstrap": false,
          "account": "0xf04679700642fd1455782e1acc37c314aab1a847",
          "node_version": "1.3.1-alpha  TX Gas"
        },
        "73.94.107.106:8997": {
          "ip": "73.94.107.106",
          "port": 8997,
          "is_bootstrap": false,
          "account": "0xdd1fbd71d7f78a810ae10829220fbb7bd2f1818b",
          "node_version": ""
        },
        "node.tbb.web3.coach:443": {
          "ip": "node.tbb.web3.coach",
          "port": 443,
          "is_bootstrap": true,
          "account": "0x09ee50f2f37fcba1845de6fe5c762e83e65e755c",
          "node_version": ""
        }
      },
      "pending_txs": [],
      "node_version": "1.3.1-alpha  TX Gas",
      "account": "0xdd1fbd71d7f78a810ae10829220fbb7bd2f1818b"
    }
    
  • Add output of state JSON

    Add output of state JSON

    At the beginning you show the balances in a JSON file. So I added a simple additional command to do the same tbb balances state

    var balancesStateCmd = &cobra.Command{
    	Use:   "state",
    	Short: "State of balances (json).",
    	Run: func(cmd *cobra.Command, args []string) {
    		state, err := dao.NewStateFromDisk()
    		if err != nil {
    			fmt.Fprintln(os.Stderr, err)
    			os.Exit(1)
    		}
    		defer state.Close()
    
    		json, err := json.MarshalIndent(state, "", "  ")
    		if err != nil {
    			fmt.Fprintln(os.Stderr, err)
    			os.Exit(1)
    		}
    		fmt.Println(string(json))
    	},
    
  • Section 3 doesn't have data attribute

    Section 3 doesn't have data attribute

    It's a great tutorial - I haven't got to the end - but will raise any issues as I go along for you It says CLI is done and includes this line

    tbb tx add --from=andrej --to=andrej --value=100 --data=reward
    

    but the -data flag isn't in the code at that stage so an error

  • the hash block is invalid

    the hash block is invalid

    Searching for new Peers and their Blocks and Peers: 'node.tbb.web3.coach:443' Found 3 new blocks from Peer node.tbb.web3.coach:443 Importing blocks from Peer node.tbb.web3.coach:443... ERROR: invalid block hash 89bdfcde734cbab319bdc2d9e45bab3bcb5f899b28fb6fdf69613ba3d322229a Searching for new Peers and their Blocks and Peers: 'node.tbb.web3.coach:443' Found 3 new blocks from Peer node.tbb.web3.coach:443 Importing blocks from Peer node.tbb.web3.coach:443... ERROR: invalid block hash 89bdfcde734cbab319bdc2d9e45bab3bcb5f899b28fb6fdf69613ba3d322229a Searching for new Peers and their Blocks and Peers: 'node.tbb.web3.coach:443' Found 3 new blocks from Peer node.tbb.web3.coach:443 Importing blocks from Peer node.tbb.web3.coach:443... ERROR: invalid block hash 89bdfcde734cbab319bdc2d9e45bab3bcb5f899b28fb6fdf69613ba3d322229a

  • Bump github.com/ethereum/go-ethereum from 1.9.25 to 1.10.17

    Bump github.com/ethereum/go-ethereum from 1.9.25 to 1.10.17

    Bumps github.com/ethereum/go-ethereum from 1.9.25 to 1.10.17.

    Release notes

    Sourced from github.com/ethereum/go-ethereum's releases.

    Ploitari (v1.10.17)

    This is a maintenance release. This release contains a lot of work in preparation for The Merge, and work for an upcoming change to the way state is stored in go-ethereum.

    This release also adds a new tool to convert 'legacy' receipts into a newer format. During startup, geth will check the database and tell you if you need to perform the conversion. Converting receipts is only needed if geth's ancients database has not been resynced from scratch during the last couple of years. It is recommended to back-up your receipts freezer table (ancients/receipts*) before performing the conversion.

    Compatibility note about core/types: For optimization purposes, types.Header and other types in this package now implement the rlp.Encoder interface. This change can cause incompatibilities because the new method is implemented with pointer receiver. Attempting to RLP-encode unadressable (i.e. non-pointer) values of type Header does not work anymore and will result in an error.

    Change Log

    For a full rundown of the changes please consult the Geth 1.10.17 release milestone.


    As with all our previous releases, you can find the:

    Osun (v1.10.16)

    The focus of this release is bugfixes.

    Bugfixes

    • Block tracing via debug.traceBlockByHash has sometimes produced inconsistent/corrupt results. Fixed via (#24286).
    • The --whitelist CLI parameter functionality was broken in v1.10.14, and is fixed in this release (#24210).
    • A bug was introduced, and subsequently fixed, which could cause data corruption during mining (#24349).
    • When signing complex datatypes in EIP712-type data, the signing-hash was incorrect. Fixed via (#24220).
    • Evm execution times exported via metrics, were sometimes incorrect. Fixed in (#24304).
    • Range prover edgecases found and fixed (#24266, #24257).
    • Fix an error related to HTTP2 handling (#24292).
    • A lot of spleling-mistkaes and issues related to correctness were fixed (#24194, #24196, #24198, #24205, #24207, #24244, #24270, #24271, #24224, #24372, #24323, #24289, #24263 and #24211).

    New features

    • Work on The Merge includes support for RANDOM opcode (#24141) and various other internal refactorings (#24328, #24280, #24236, #23256).
    • The devp2p binary now supports doing snap/v1 protocol testing against a remote node, which can be used for Hive-testing (#24276).
    • New diagnostic command to show database metadata (#23900)
    • ethclient support for CallContractAtHash (#24355).

    ... (truncated)

    Commits
    • 25c9b49 params: go-ethereum v1.10.17 stable
    • de6a113 eth/catalyst: only apply block if we actually have the state (#24598)
    • b502b6a cmd/geth: change to non-fatal error message when legacy receipt storage is no...
    • 1027cb5 Merge pull request #24605 from karalabe/revert-setting-ttd
    • b06e8c4 core/vm: fix sstore gas comment type (#24583)
    • b45d82e core: set ttd override on all chain variations
    • 0fffd3a build: close sftp connection when done (#24593)
    • eb3ebce internal/build: exit sftp upload (#24590)
    • d1c243f internal/build: prevent travis timeout during ppa upload (#24589)
    • 19b9cf7 internal/build: show ppa upload process stdout on stdout (#24588)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

  • [no tests to run]

    [no tests to run]

    In branch c11_consensus, while running tests according to the book go test -timeout=0 -count=1 ./node -test.v -test.run ^TestNode_Run$, testing returns error:

    testing: warning: no tests to run
    PASS
    ok      github.com/web3coach/the-blockchain-bar/node    0.003s [no tests to run]
    

    I have installed tbb with usual go install ./cmd/..., it works. How do I launch tests?

  • Uncle Blocks?

    Uncle Blocks?

    Hi, Lukáš.

    This is not an issue, but more like a feature request:

    I was wondering if you had plans to integrate uncle blocks into the working of the application. Currently, I know we prevent any forks (ch_11), but I've read Ethereum incentivizes uncle blocks for a variety of reasons (at least in its PoW implementation). Would love to see it in action, and was wondering if you had any plans for it in future chapters.

    Thanks!

    PS: Excellent work, by the way. Absolutely love your book!

Source for the Chillis & Associates blockchain nodes

Chillis & Associates chillisd Repository This repository contains the source code for validators on the Chillis network. The source is based on the wa

Feb 8, 2022
Open Source Ethereum Mining Pool With Go
Open Source Ethereum Mining Pool With Go

Open Source Ethereum Mining Pool Features This pool is being further developed to provide an easy to use pool for Ethereum miners. This software is fu

Mar 10, 2022
Open Source Etho Mining Pool - tuned for 8000000 block hardfork on EthoProtocol blockchain.
 Open Source Etho Mining Pool - tuned for 8000000 block hardfork on EthoProtocol blockchain.

Open Source Etho Mining Pool - tuned for 8000000 block hardfork on EthoProtocol blockchain. image to be updated soon! Features This pool is being furt

Aug 13, 2022
Security research and open source implementation of the Apple 'Wireless Accessory Configuration' (WAC) protocol
Security research and open source implementation of the Apple 'Wireless Accessory Configuration' (WAC) protocol

Apple 'Wireless Accessory Configuration' (WAC) research Introduction This repository contains some research on how the WAC protocol works. I was mostl

Jul 28, 2022
An open source smart contract platform

EOSIO - The Most Powerful Infrastructure for Decentralized Applications Welcome to the EOSIO source code repository! This software enables businesses

Jan 7, 2023
A cryptocurrency implementation in less than 1500 lines of code
A cryptocurrency implementation in less than 1500 lines of code

Naivecoin - a cryptocurrency implementation in less than 1500 lines of code Motivation Cryptocurrencies and smart-contracts on top of a blockchain are

Dec 11, 2022
Fairly general building blocks used in Arista Go code and open-sourced for the benefit of all.

Arista Go library areflect Helper functions to work with the reflect package. Contains ForceExport(), which bypasses the check in reflect.Value that p

Dec 14, 2022
Card-encrypt - The encryption code necessary to enroll debit cards in the Palla API

?? Card RSA Encryption Thank you for choosing Palla! ?? In this repository you'l

Jul 15, 2022
ebk is a tiny tool for ebook

ebk ebk is a tiny tool for ebook. Usage ebk ls list directory ebook contents. $

Mar 25, 2022
:triangular_ruler:gofmtmd formats go source code block in Markdown. detects fenced code & formats code using gofmt.
:triangular_ruler:gofmtmd formats go source code block in Markdown. detects fenced code & formats code using gofmt.

gofmtmd gofmtmd formats go source code block in Markdown. detects fenced code & formats code using gofmt. Installation $ go get github.com/po3rin/gofm

Oct 31, 2022
The most opinionated Go source code linter for code audit.
The most opinionated Go source code linter for code audit.

go-critic Highly extensible Go source code linter providing checks currently missing from other linters. There is never too much static code analysis.

Jan 6, 2023
Clean-Swift source and test code auto-generator. It can save you time typing 500-600 lines of code.
Clean-Swift source and test code auto-generator. It can save you time typing 500-600 lines of code.

Clean-Swift source & test code auto generator Overview Run Output Basic Usage make config.yaml target_project_name: Miro // target project name copyri

Apr 13, 2022
🔎 Help find Trojan Source vulnerability in code 👀 . Useful for code review in project with multiple collaborators

TrojanSourceFinder TrojanSourceFinder helps developers detect "Trojan Source" vulnerability in source code. Trojan Source vulnerability allows an atta

Nov 9, 2022
Read k8S-source-code notes, help quickly understand the K8S-code organization rules
Read k8S-source-code notes, help quickly understand the K8S-code organization rules

K8S源码阅读笔记 以下笔记针对 kubernetes V1.23.1(截至2022年01月01日最新版本),并不保证对其它版本的有效性 一、架构图 二、阅读前准备 由于kubernetes项目巧妙的设计和代码高度的封装性,建议在阅读代码前,尽可能的进行以下内容的准备: 1. 编程知识配备 编程语准

Feb 16, 2022
Test your code without writing mocks with ephemeral Docker containers 📦 Setup popular services with just a couple lines of code ⏱️ No bash, no yaml, only code 💻

Gnomock – tests without mocks ??️ Spin up entire dependency stack ?? Setup initial dependency state – easily! ?? Test against actual, close to product

Dec 29, 2022
octocov is a tool for collecting code metrics (code coverage, code to test ratio and test execution time).

octocov is a tool for collecting code metrics (code coverage, code to test ratio and test execution time).

Jan 9, 2023
sail is an operation framework based on Ansible/Helm. sail follows the principles of Infrastructure as Code (IaC), Operation as Code (OaC), and Everything as Code. So it is a tool for DevOps.

sail 中文文档 sail is an operation framework based on Ansible/Helm. sail follows the principles of Infrastructure as Code (IaC), Operation as Code (OaC),a

Dec 16, 2021
Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.
Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.

Tagify Gets STDIN, file or HTTP address as an input and returns a list of most popular words ordered by popularity as an output. More info about what

Dec 19, 2022
SigNoz helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc. 🔥 🖥. 👉 Open source Application Performance Monitoring (APM) & Observability tool
SigNoz helps developers monitor their applications & troubleshoot problems, an open-source alternative to DataDog, NewRelic, etc. 🔥 🖥.   👉  Open source Application Performance Monitoring (APM) & Observability tool

Monitor your applications and troubleshoot problems in your deployed applications, an open-source alternative to DataDog, New Relic, etc. Documentatio

Sep 24, 2021