From e96066bc835be0a10538a8b4ead606108227d303 Mon Sep 17 00:00:00 2001 From: Matt Krump Date: Wed, 21 Mar 2018 13:44:01 -0500 Subject: [PATCH] Remove geth --dev dep --- Makefile | 10 ---------- README.md | 15 +++++++-------- integration_test/geth_blockchain_test.go | 8 ++++---- scripts/start_private_blockchain | 4 ---- test_config/test_config.go | 6 ------ 5 files changed, 11 insertions(+), 32 deletions(-) delete mode 100755 scripts/start_private_blockchain diff --git a/Makefile b/Makefile index d324fa04..4de14e51 100644 --- a/Makefile +++ b/Makefile @@ -82,13 +82,3 @@ migrate: $(MIGRATE) checkdbvars import: test -n "$(NAME)" # $$NAME psql $(NAME) < db/schema.sql - -#Ethereum -createprivate: - echo "deleting test_data_dir" - rm -rf test_data_dir - echo "adding test_data_dir" - mkdir test_data_dir - -startprivate: createprivate - geth --dev --dev.period=1 --datadir=test_data_dir --nodiscover diff --git a/README.md b/README.md index ea205639..db43cc98 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,10 @@ ### Setting up the Databases 1. Install Postgres -2. Create a superuser for yourself and make sure `psql --list` works without prompting for a password. -3. `createdb vulcanize_private` -4. `cd $GOPATH/src/github.com/vulcanize/vulcanizedb` -5. Import the schema: `psql vulcanize_private < db/schema.sql` +1. Create a superuser for yourself and make sure `psql --list` works without prompting for a password. +1. `createdb vulcanize_private` +1. `cd $GOPATH/src/github.com/vulcanize/vulcanizedb` +1. Import the schema: `psql vulcanize_private < db/schema.sql` or run the migrations: `make migrate HOST_NAME=localhost NAME=vulcanize_public PORT=5432` * See below for configuring additional environments @@ -35,7 +35,7 @@ The default location for Ethereum is: ## Start syncing with postgres 1. Start geth node (**if fast syncing wait for geth to finsh initial sync**) -2. In a separate terminal start vulcanize_db +1. In a separate terminal start vulcanize_db - `vulcanizedb sync --config --starting-block-number ` * see `./environments` for example config @@ -48,10 +48,9 @@ The default location for Ethereum is: ### Integration Test -1. Run `make startprivate` in a separate terminal -2. Setup a test database and import the schema: +1. Setup a test database and import the schema: `createdb vulcanize_private` `psql vulcanize_private < db/schema.sql` -3. `go test ./...` to run all tests. +1. `go test ./...` to run all tests. diff --git a/integration_test/geth_blockchain_test.go b/integration_test/geth_blockchain_test.go index de9f830e..8eab9382 100644 --- a/integration_test/geth_blockchain_test.go +++ b/integration_test/geth_blockchain_test.go @@ -15,7 +15,7 @@ var _ = Describe("Reading from the Geth blockchain", func() { var inMemory *inmemory.InMemory BeforeEach(func() { - blockchain = geth.NewBlockchain(test_config.TestClientConfig.IPCPath) + blockchain = geth.NewBlockchain(test_config.InfuraClient.IPCPath) inMemory = inmemory.NewInMemory() }) @@ -25,7 +25,7 @@ var _ = Describe("Reading from the Geth blockchain", func() { validator.ValidateBlocks() Expect(blocks.BlockCount()).To(Equal(2)) close(done) - }, 15) + }, 30) It("retrieves the genesis block and first block", func(done Done) { genesisBlock := blockchain.GetBlockByNumber(int64(0)) @@ -44,8 +44,8 @@ var _ = Describe("Reading from the Geth blockchain", func() { Expect(node.GenesisBlock).ToNot(BeNil()) Expect(node.NetworkID).To(Equal(devNetworkNodeId)) - Expect(len(node.ID)).To(Equal(128)) - Expect(node.ClientName).To(ContainSubstring("Geth")) + Expect(len(node.ID)).ToNot(BeZero()) + Expect(node.ClientName).ToNot(BeZero()) close(done) }, 15) diff --git a/scripts/start_private_blockchain b/scripts/start_private_blockchain deleted file mode 100755 index d0257a3b..00000000 --- a/scripts/start_private_blockchain +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -rm -rf test_data_dir -mkdir test_data_dir -geth --dev --dev.period=1 --datadir=test_data_dir --nodiscover diff --git a/test_config/test_config.go b/test_config/test_config.go index f8127c53..4ac6cec1 100644 --- a/test_config/test_config.go +++ b/test_config/test_config.go @@ -13,7 +13,6 @@ import ( var TestConfig *viper.Viper var DBConfig config.Database -var TestClientConfig config.Client var Infura *viper.Viper var InfuraClient config.Client var ABIFilePath string @@ -40,11 +39,6 @@ func setTestConfig() { Name: name, Port: port, } - ipc := TestConfig.GetString("client.ipcpath") - gopath := os.Getenv("GOPATH") - TestClientConfig = config.Client{ - IPCPath: gopath + "/src/github.com/vulcanize/vulcanizedb/" + ipc, - } } func setInfuraConfig() {