ipld-eth-server/observers/blockchain_db_observer.go

16 lines
331 B
Go
Raw Normal View History

package observers
import (
"github.com/8thlight/vulcanizedb/core"
2017-11-03 13:01:35 +00:00
"github.com/8thlight/vulcanizedb/repositories"
"github.com/jmoiron/sqlx"
)
type BlockchainDBObserver struct {
Db *sqlx.DB
}
func (observer BlockchainDBObserver) NotifyBlockAdded(block core.Block) {
2017-11-03 13:01:35 +00:00
repositories.NewPostgres(observer.Db).CreateBlock(block)
}