use stock v1.11.5 geth; use new cerc test db info

This commit is contained in:
i-norden
2023-03-30 16:11:05 -05:00
parent 4a52acb0bb
commit 360b0abbbc
9 changed files with 90 additions and 56 deletions
+13 -5
View File
@@ -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
}