Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3 from vulcanize/dshelp_update
Browse files Browse the repository at this point in the history
update ipfs stack dshelp.CidToDsKey => dshelp.Multihash…
  • Loading branch information
i-norden authored Jun 22, 2020
2 parents 2d4f4ad + 3dc1bf6 commit ba0a5f0
Show file tree
Hide file tree
Showing 105 changed files with 1,064 additions and 567 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Vagrantfile
vagrant*.sh
.vagrant
test_scripts/
ipfs-chain-watcher
ipfs-blockchain-watcher
postgraphile/build/
postgraphile/node_modules/
postgraphile/package-lock.json
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
addons:
ssh_known_hosts: arch1.vdb.to
postgresql: '11.2'
go_import_path: github.com/vulcanize/ipfs-chain-watcher
go_import_path: github.com/vulcanize/ipfs-blockchain-watcher
before_install:
- openssl aes-256-cbc -K $encrypted_e1db309e8776_key -iv $encrypted_e1db309e8776_iv
-in temp_rsa.enc -out temp_rsa -d
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ FROM golang:alpine as builder
RUN apk --update --no-cache add make git g++

# Build statically linked vDB binary (wonky path because of Dep)
RUN mkdir -p /go/src/github.com/vulcanize/ipfs-chain-watcher
ADD . /go/src/github.com/vulcanize/ipfs-chain-watcher
WORKDIR /go/src/github.com/vulcanize/ipfs-chain-watcher
RUN mkdir -p /go/src/github.com/vulcanize/ipfs-blockchain-watcher
ADD . /go/src/github.com/vulcanize/ipfs-blockchain-watcher
WORKDIR /go/src/github.com/vulcanize/ipfs-blockchain-watcher
RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' .

# Build migration tool
Expand All @@ -14,10 +14,10 @@ RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflag

# Second stage
FROM alpine
COPY --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/vulcanizedb /app/vulcanizedb
COPY --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/environments/staging.toml /app/environments/
COPY --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/dockerfiles/startup_script.sh /app/
COPY --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/db/migrations/* /app/
COPY --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/vulcanizedb /app/vulcanizedb
COPY --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/environments/staging.toml /app/environments/
COPY --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/dockerfiles/startup_script.sh /app/
COPY --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/db/migrations/* /app/
COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose /app/goose

WORKDIR /app
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Vulcanize DB
# ipfs-blockchain-watcher

[![Go Report Card](https://goreportcard.com/badge/github.com/vulcanize/ipfs-blockchain-watcher)](https://goreportcard.com/report/github.com/vulcanize/ipfs-blockchain-watcher)

Expand Down Expand Up @@ -162,9 +162,9 @@ Finally, we can setup the watcher process itself.

Start by downloading vulcanizedb and moving into the repo:

`go get github.com/vulcanize/ipfs-chain-watcher`
`go get github.com/vulcanize/ipfs-blockchain-watcher`

`cd $GOPATH/src/github.com/vulcanize/ipfs-chain-watcher`
`cd $GOPATH/src/github.com/vulcanize/ipfs-blockchain-watcher`

Then, build the binary:

Expand Down
8 changes: 4 additions & 4 deletions cmd/resync.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/vulcanize/ipfs-chain-watcher/pkg/shared"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/shared"

"github.com/vulcanize/ipfs-chain-watcher/pkg/ipfs"
"github.com/vulcanize/ipfs-chain-watcher/pkg/resync"
v "github.com/vulcanize/ipfs-chain-watcher/version"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/ipfs"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/resync"
v "github.com/vulcanize/ipfs-blockchain-watcher/version"
)

// resyncCmd represents the resync command
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/vulcanize/ipfs-chain-watcher/pkg/config"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/config"
)

var (
Expand Down
10 changes: 5 additions & 5 deletions cmd/streamEthSubscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/vulcanize/ipfs-chain-watcher/pkg/client"
"github.com/vulcanize/ipfs-chain-watcher/pkg/core"
"github.com/vulcanize/ipfs-chain-watcher/pkg/eth"
"github.com/vulcanize/ipfs-chain-watcher/pkg/streamer"
"github.com/vulcanize/ipfs-chain-watcher/pkg/watcher"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/client"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/core"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/eth"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/streamer"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/watcher"
)

// streamEthSubscriptionCmd represents the streamEthSubscription command
Expand Down
10 changes: 5 additions & 5 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ import (
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

v "github.com/vulcanize/ipfs-chain-watcher/version"
v "github.com/vulcanize/ipfs-blockchain-watcher/version"
)

// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Prints the version of ipfs-chain-watcher",
Long: `Use this command to fetch the version of ipfs-chain-watcher
Short: "Prints the version of ipfs-blockchain-watcher",
Long: `Use this command to fetch the version of ipfs-blockchain-watcher
Usage: ./ipfs-chain-watcher version`,
Usage: ./ipfs-blockchain-watcher version`,
Run: func(cmd *cobra.Command, args []string) {
subCommand = cmd.CalledAs()
logWithCommand = *log.WithField("SubCommand", subCommand)
logWithCommand.Infof("ipfs-chain-watcher version: %s", v.VersionWithMeta)
logWithCommand.Infof("ipfs-blockchain-watcher version: %s", v.VersionWithMeta)
},
}

Expand Down
10 changes: 5 additions & 5 deletions cmd/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"

"github.com/vulcanize/ipfs-chain-watcher/pkg/ipfs"
"github.com/vulcanize/ipfs-chain-watcher/pkg/shared"
"github.com/vulcanize/ipfs-chain-watcher/pkg/watcher"
v "github.com/vulcanize/ipfs-chain-watcher/version"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/ipfs"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/shared"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/watcher"
v "github.com/vulcanize/ipfs-blockchain-watcher/version"
)

// superNodeCmd represents the superNode command
var superNodeCmd = &cobra.Command{
Use: "superNode",
Short: "sync chain data into PG-IPFS",
Long: `This command configures a VulcanizeDB ipfs-chain-watcher.
Long: `This command configures a VulcanizeDB ipfs-blockchain-watcher.
The Sync process streams all chain data from the appropriate chain, processes this data into IPLD objects
and publishes them to IPFS. It then indexes the CIDs against useful data fields/metadata in Postgres.
Expand Down
8 changes: 4 additions & 4 deletions dockerfiles/migrations/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ RUN apk add busybox-extras
FROM golang:1.12.4 as builder

# Get and build vulcanizedb
ADD . /go/src/github.com/vulcanize/ipfs-chain-watcher
ADD . /go/src/github.com/vulcanize/ipfs-blockchain-watcher

# Build migration tool
RUN go get -u -d github.com/pressly/goose/cmd/goose
WORKDIR /go/src/github.com/pressly/goose/cmd/goose
RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -tags='no_mysql no_sqlite' -o goose .

WORKDIR /go/src/github.com/vulcanize/ipfs-chain-watcher
WORKDIR /go/src/github.com/vulcanize/ipfs-blockchain-watcher

# app container
FROM alpine
Expand All @@ -29,12 +29,12 @@ USER $USER

# chown first so dir is writable
# note: using $USER is merged, but not in the stable release yet
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/dockerfiles/migrations/startup_script.sh .
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/dockerfiles/migrations/startup_script.sh .


# keep binaries immutable
COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose goose
COPY --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/db/migrations migrations/vulcanizedb
COPY --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/db/migrations migrations/vulcanizedb
# XXX dir is already writeable RUN touch vulcanizedb.log

CMD ["./startup_script.sh"]
18 changes: 9 additions & 9 deletions dockerfiles/super_node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ RUN apk --update --no-cache add make git g++ linux-headers
RUN apk add busybox-extras

# Get and build vulcanizedb
ADD . /go/src/github.com/vulcanize/ipfs-chain-watcher
WORKDIR /go/src/github.com/vulcanize/ipfs-chain-watcher
ADD . /go/src/github.com/vulcanize/ipfs-blockchain-watcher
WORKDIR /go/src/github.com/vulcanize/ipfs-blockchain-watcher
RUN GO111MODULE=on GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o vulcanizedb .

# Build migration tool
RUN go get -u -d github.com/pressly/goose/cmd/goose
WORKDIR /go/src/github.com/pressly/goose/cmd/goose
RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -tags='no_mysql no_sqlite' -o goose .

WORKDIR /go/src/github.com/vulcanize/ipfs-chain-watcher
WORKDIR /go/src/github.com/vulcanize/ipfs-blockchain-watcher

# app container
FROM alpine
Expand All @@ -31,16 +31,16 @@ USER $USER

# chown first so dir is writable
# note: using $USER is merged, but not in the stable release yet
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/$CONFIG_FILE config.toml
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/dockerfiles/super_node/startup_script.sh .
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/dockerfiles/super_node/entrypoint.sh .
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/$CONFIG_FILE config.toml
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/dockerfiles/super_node/startup_script.sh .
COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/dockerfiles/super_node/entrypoint.sh .


# keep binaries immutable
COPY --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/vulcanizedb vulcanizedb
COPY --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/vulcanizedb vulcanizedb
COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose goose
COPY --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/db/migrations migrations/vulcanizedb
COPY --from=builder /go/src/github.com/vulcanize/ipfs-chain-watcher/environments environments
COPY --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/db/migrations migrations/vulcanizedb
COPY --from=builder /go/src/github.com/vulcanize/ipfs-blockchain-watcher/environments environments

EXPOSE $EXPOSE_PORT_1
EXPOSE $EXPOSE_PORT_2
Expand Down
16 changes: 8 additions & 8 deletions documentation/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ An example of how to subscribe to a real-time Ethereum data feed from ipfs-block
"github.com/ethereum/go-ethereum/rpc"
"github.com/spf13/viper"

"github.com/vulcanize/ipfs-chain-watcher/pkg/client"
"github.com/vulcanize/ipfs-chain-watcher/pkg/eth"
"github.com/vulcanize/ipfs-chain-watcher/pkg/streamer"
"github.com/vulcanize/ipfs-chain-watcher/pkg/watcher"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/client"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/eth"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/streamer"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/watcher"
)

config, _ := eth.NewEthSubscriptionConfig()
Expand Down Expand Up @@ -162,10 +162,10 @@ An example of how to subscribe to a real-time Bitcoin data feed from ipfs-blockc
"github.com/ethereum/go-ethereum/rpc"
"github.com/spf13/viper"

"github.com/vulcanize/ipfs-chain-watcher/libraries/shared/streamer"
"github.com/vulcanize/ipfs-chain-watcher/pkg/eth/client"
"github.com/vulcanize/ipfs-chain-watcher/pkg/super_node"
"github.com/vulcanize/ipfs-chain-watcher/pkg/super_node/btc"
"github.com/vulcanize/ipfs-blockchain-watcher/libraries/shared/streamer"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/eth/client"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/super_node"
"github.com/vulcanize/ipfs-blockchain-watcher/pkg/super_node/btc"
)

config, _ := btc.NewBtcSubscriptionConfig()
Expand Down
115 changes: 22 additions & 93 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,101 +1,30 @@
module github.com/vulcanize/ipfs-chain-watcher
module github.com/vulcanize/ipfs-blockchain-watcher

go 1.12

require (
bazil.org/fuse v0.0.0-20180421153158-65cc252bf669 // indirect
github.com/aristanetworks/goarista v0.0.0-20190712234253-ed1100a1c015 // indirect
github.com/bren2010/proquint v0.0.0-20160323162903-38337c27106d // indirect
github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/dave/jennifer v1.3.0
github.com/davidlazar/go-crypto v0.0.0-20190522120613-62389b5e4ae0 // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/edsrzf/mmap-go v1.0.0 // indirect
github.com/elastic/gosigar v0.10.4 // indirect
github.com/ethereum/go-ethereum v1.9.1
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/hashicorp/golang-lru v0.5.3
github.com/hpcloud/tail v1.0.0
github.com/ipfs/go-bitswap v0.1.6 // indirect
github.com/btcsuite/btcd v0.20.1-beta
github.com/btcsuite/btcutil v1.0.2
github.com/ethereum/go-ethereum v1.9.11
github.com/ipfs/go-block-format v0.0.2
github.com/ipfs/go-blockservice v0.1.2
github.com/ipfs/go-cid v0.0.3
github.com/ipfs/go-cidutil v0.0.2 // indirect
github.com/ipfs/go-ds-flatfs v0.0.2 // indirect
github.com/ipfs/go-ds-leveldb v0.0.2 // indirect
github.com/ipfs/go-ds-measure v0.0.1 // indirect
github.com/ipfs/go-fs-lock v0.0.1 // indirect
github.com/ipfs/go-ipfs v0.4.22
github.com/ipfs/go-ipfs-blockstore v0.0.1
github.com/ipfs/go-ipfs-cmds v0.1.1 // indirect
github.com/ipfs/go-ipfs-config v0.0.3 // indirect
github.com/ipfs/go-ipfs-ds-help v0.0.1
github.com/ipfs/go-blockservice v0.1.3
github.com/ipfs/go-cid v0.0.5
github.com/ipfs/go-filestore v1.0.0 // indirect
github.com/ipfs/go-ipfs v0.5.1
github.com/ipfs/go-ipfs-blockstore v1.0.0
github.com/ipfs/go-ipfs-ds-help v1.0.0
github.com/ipfs/go-ipfs-exchange-interface v0.0.1
github.com/ipfs/go-ipld-cbor v0.0.3 // indirect
github.com/ipfs/go-ipld-format v0.0.2
github.com/ipfs/go-ipld-git v0.0.2 // indirect
github.com/ipfs/go-ipns v0.0.1 // indirect
github.com/ipfs/go-mfs v0.1.1 // indirect
github.com/ipfs/interface-go-ipfs-core v0.1.0 // indirect
github.com/jbenet/go-is-domain v1.0.2 // indirect
github.com/jmoiron/sqlx v0.0.0-20190426154859-38398a30ed85
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/lib/pq v1.2.0
github.com/libp2p/go-eventbus v0.0.3 // indirect
github.com/libp2p/go-libp2p v0.1.2 // indirect
github.com/libp2p/go-libp2p-autonat-svc v0.1.0 // indirect
github.com/libp2p/go-libp2p-connmgr v0.1.0 // indirect
github.com/libp2p/go-libp2p-core v0.0.9 // indirect
github.com/libp2p/go-libp2p-kad-dht v0.1.1 // indirect
github.com/libp2p/go-libp2p-peerstore v0.1.3 // indirect
github.com/libp2p/go-libp2p-pnet v0.1.0 // indirect
github.com/libp2p/go-libp2p-pubsub-router v0.1.0 // indirect
github.com/libp2p/go-libp2p-quic-transport v0.1.1 // indirect
github.com/libp2p/go-libp2p-secio v0.1.1 // indirect
github.com/libp2p/go-libp2p-swarm v0.1.1 // indirect
github.com/libp2p/go-libp2p-tls v0.1.0 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/marten-seemann/qtls v0.2.4 // indirect
github.com/miekg/dns v1.1.15 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-multiaddr-dns v0.0.3 // indirect
github.com/multiformats/go-multihash v0.0.6
github.com/onsi/ginkgo v1.8.0
github.com/onsi/gomega v1.5.0
github.com/pborman/uuid v1.2.0 // indirect
github.com/pelletier/go-toml v1.4.0 // indirect
github.com/polydawn/refmt v0.0.0-20190731040541-eff0b363297a // indirect
github.com/pressly/goose v2.6.0+incompatible
github.com/prometheus/tsdb v0.10.0 // indirect
github.com/rjeczalik/notify v0.9.2 // indirect
github.com/sirupsen/logrus v1.4.2
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cobra v0.0.5
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.4.0
github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 // indirect
github.com/whyrusleeping/sql-datastore v0.0.0-20190124195324-b24eb8d0ce14 // indirect
go.opencensus.io v0.22.0 // indirect
go.uber.org/dig v1.7.0 // indirect
go.uber.org/fx v1.9.0 // indirect
go.uber.org/goleak v1.0.0 // indirect
go4.org v0.0.0-20190313082347-94abd6928b1d // indirect
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
github.com/ipfs/go-ipld-format v0.2.0
github.com/jmoiron/sqlx v1.2.0
github.com/lib/pq v1.5.2
github.com/multiformats/go-multihash v0.0.13
github.com/onsi/ginkgo v1.12.1
github.com/onsi/gomega v1.10.1
github.com/sirupsen/logrus v1.6.0
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.7.0
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 // indirect
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a // indirect
)

replace github.com/dgraph-io/badger v2.0.0-rc.2+incompatible => github.com/dgraph-io/badger/v2 v2.0.0-rc.2

replace github.com/dgraph-io/badger/v2 v2.0.0-rc2 => github.com/dgraph-io/badger v1.6.0-rc1

replace github.com/ipfs/go-ipfs v0.4.22 => github.com/vulcanize/go-ipfs v0.4.22-alpha

replace github.com/ipfs/go-ipfs-config v0.0.3 => github.com/vulcanize/go-ipfs-config v0.0.8-alpha

replace github.com/ethereum/go-ethereum v1.9.1 => github.com/vulcanize/go-ethereum v1.9.11-statediff-0.0.2
replace github.com/ethereum/go-ethereum v1.9.11 => github.com/vulcanize/go-ethereum v1.9.11-statediff-0.0.2
Loading

0 comments on commit ba0a5f0

Please sign in to comment.