Remove geth --dev dep

This commit is contained in:
Matt Krump 2018-03-21 13:44:01 -05:00 committed by Matt K
parent 1b4e57a5b4
commit e96066bc83
5 changed files with 11 additions and 32 deletions

View File

@ -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

View File

@ -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 <config.toml> --starting-block-number <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.

View File

@ -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)

View File

@ -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

View File

@ -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() {