ipld-eth-server/pkg/observers/blockchain_logging_observer.go
2017-11-06 13:06:03 -06:00

19 lines
458 B
Go

package observers
import (
"fmt"
"time"
"github.com/8thlight/vulcanizedb/pkg/core"
)
type BlockchainLoggingObserver struct{}
func (blockchainObserver BlockchainLoggingObserver) NotifyBlockAdded(block core.Block) {
fmt.Printf("New block was added: %d\n"+
"\tTime: %v\n"+
"\tGas Limit: %d\n"+
"\tGas Used: %d\n"+
"\tNumber of Transactions %d\n", block.Number, time.Unix(block.Time, 0), block.GasLimit, block.GasUsed, len(block.Transactions))
}