forked from cerc-io/ipld-eth-server
seed node documentation
This commit is contained in:
@@ -163,7 +163,6 @@ func streamSubscribe() {
|
||||
|
||||
func subscriptionConfig() {
|
||||
log.Info("loading subscription config")
|
||||
vulcPath = viper.GetString("subscription.path")
|
||||
subConfig = config.Subscription{
|
||||
// Below default to false, which means we do not backfill by default
|
||||
BackFill: viper.GetBool("subscription.backfill"),
|
||||
@@ -215,6 +214,10 @@ func subscriptionConfig() {
|
||||
}
|
||||
|
||||
func getRpcClient() core.RpcClient {
|
||||
vulcPath := viper.GetString("subscription.path")
|
||||
if vulcPath == "" {
|
||||
vulcPath = "ws://127.0.0.1:2019" // default to and try the default ws url if no path is provided
|
||||
}
|
||||
rawRpcClient, err := rpc.Dial(vulcPath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
+13
-1
@@ -16,8 +16,12 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
syn "sync"
|
||||
|
||||
"github.com/spf13/viper"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
@@ -48,7 +52,6 @@ it maintains a local index of the IPLD objects' CIDs in Postgres.`,
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(syncAndPublishCmd)
|
||||
syncAndPublishCmd.Flags().StringVarP(&ipfsPath, "ipfs-path", "i", "~/.ipfs", "Path for configuring IPFS node")
|
||||
}
|
||||
|
||||
func syncAndPublish() {
|
||||
@@ -56,6 +59,15 @@ func syncAndPublish() {
|
||||
|
||||
db := utils.LoadPostgres(databaseConfig, blockChain.Node())
|
||||
quitChan := make(chan bool)
|
||||
|
||||
ipfsPath := viper.GetString("client.ipfsPath")
|
||||
if ipfsPath == "" {
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ipfsPath = filepath.Join(home, ".ipfs")
|
||||
}
|
||||
processor, err := ipfs.NewIPFSProcessor(ipfsPath, &db, ethClient, rpcClient, quitChan)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
||||
@@ -45,8 +45,6 @@ relays relevant data to requesting clients.`,
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(syncPublishScreenAndServeCmd)
|
||||
syncPublishScreenAndServeCmd.Flags().StringVarP(&ipfsPath, "ipfs-path", "i", "~/.ipfs", "Path for configuring IPFS node")
|
||||
syncPublishScreenAndServeCmd.Flags().StringVarP(&vulcPath, "sub-path", "p", "~/.vulcanize/vulcanize.ipc", "IPC path for the Vulcanize seed node server")
|
||||
}
|
||||
|
||||
func syncPublishScreenAndServe() {
|
||||
@@ -55,6 +53,15 @@ func syncPublishScreenAndServe() {
|
||||
|
||||
db := utils.LoadPostgres(databaseConfig, blockChain.Node())
|
||||
quitChan := make(chan bool, 1)
|
||||
|
||||
ipfsPath := viper.GetString("client.ipfsPath")
|
||||
if ipfsPath == "" {
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
ipfsPath = filepath.Join(home, ".ipfs")
|
||||
}
|
||||
processor, err := ipfs.NewIPFSProcessor(ipfsPath, &db, ethClient, rpcClient, quitChan)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@@ -78,7 +85,7 @@ func syncPublishScreenAndServe() {
|
||||
}
|
||||
ipcPath = filepath.Join(home, ".vulcanize/vulcanize.ipc")
|
||||
}
|
||||
_, _, err = rpc.StartIPCEndpoint(vulcPath, processor.APIs())
|
||||
_, _, err = rpc.StartIPCEndpoint(ipcPath, processor.APIs())
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user