use stock v1.11.5 geth; use new cerc test db info
This commit is contained in:
+13
-5
@@ -18,16 +18,24 @@ package shared
|
||||
|
||||
import "github.com/jmoiron/sqlx"
|
||||
|
||||
/*
|
||||
Hostname: "localhost",
|
||||
Port: 8077,
|
||||
DatabaseName: "cerc_testing",
|
||||
Username: "vdbm",
|
||||
Password: "password",
|
||||
*/
|
||||
|
||||
// TestDB connect to the testing database
|
||||
// it assumes the database has the IPFS public.blocks table present
|
||||
// DO NOT use a production db for the test db, as it will remove all contents of the public.blocks table
|
||||
// it assumes the database has the IPFS ipld.blocks table present
|
||||
// DO NOT use a production db for the test db, as it will remove all contents of the ipld.blocks table
|
||||
func TestDB() (*sqlx.DB, error) {
|
||||
connectStr := "postgresql://localhost:5432/vulcanize_testing?sslmode=disable"
|
||||
connectStr := "postgresql://vdbm:password@localhost:8077/cerc_testing?sslmode=disable"
|
||||
return sqlx.Connect("postgres", connectStr)
|
||||
}
|
||||
|
||||
// ResetTestDB drops all rows in the test db public.blocks table
|
||||
// ResetTestDB drops all rows in the test db ipld.blocks table
|
||||
func ResetTestDB(db *sqlx.DB) error {
|
||||
_, err := db.Exec("TRUNCATE public.blocks CASCADE")
|
||||
_, err := db.Exec("TRUNCATE ipld.blocks CASCADE")
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user