DJDNS / go-deje

Golang library for DEJE Next, a protocol/technology for decentralized document hosting and concurrent editing.
GNU Lesser General Public License v2.1
8 stars 0 forks source link

Acceptor/Block middleware #49

Open MaddieM4 opened 10 years ago

MaddieM4 commented 10 years ago

TimestampServices expose a simple list of timestamps. We want the advanced ones to be able to easily use common code to handle the Acceptor metadata and block divisions, regardless of which blockchain or blockchain-like concrete system we are using.

The interface should include the following:

type Block map[string]int

type BlockMiddleware struct {
    // ...
}

func (bm BlockMiddleware) GetTimestamps(blocks []Block) []string {
    // ...
}

BlockMiddleware can then be used directly (and internally) by blockchain backends.

MaddieM4 commented 10 years ago

Part of #47.