updates to documentation for super node
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// VulcanizeDB
|
||||
// Copyright © 2019 Vulcanize
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
package ipfs
|
||||
|
||||
import (
|
||||
ipld "github.com/ipfs/go-ipld-format"
|
||||
)
|
||||
|
||||
// DagPutter is a general interface for a dag putter
|
||||
type DagPutter interface {
|
||||
DagPut(n ipld.Node) (string, error)
|
||||
}
|
||||
@@ -28,9 +28,9 @@ import (
|
||||
|
||||
// IPLDPublisher satisfies the IPLDPublisher for ethereum
|
||||
type IPLDPublisher struct {
|
||||
HeaderPutter shared.DagPutter
|
||||
TransactionPutter shared.DagPutter
|
||||
TransactionTriePutter shared.DagPutter
|
||||
HeaderPutter ipfs.DagPutter
|
||||
TransactionPutter ipfs.DagPutter
|
||||
TransactionTriePutter ipfs.DagPutter
|
||||
}
|
||||
|
||||
// NewIPLDPublisher creates a pointer to a new Publisher which satisfies the IPLDPublisher interface
|
||||
|
||||
@@ -52,7 +52,7 @@ type TxFilter struct {
|
||||
}
|
||||
|
||||
// Init is used to initialize a EthSubscription struct with env variables
|
||||
func NewEthSubscriptionConfig() (*SubscriptionSettings, error) {
|
||||
func NewBtcSubscriptionConfig() (*SubscriptionSettings, error) {
|
||||
sc := new(SubscriptionSettings)
|
||||
// Below default to false, which means we do not backfill by default
|
||||
sc.BackFill = viper.GetBool("superNode.btcSubscription.historicalData")
|
||||
|
||||
@@ -36,13 +36,13 @@ import (
|
||||
|
||||
// IPLDPublisher satisfies the IPLDPublisher for ethereum
|
||||
type IPLDPublisher struct {
|
||||
HeaderPutter shared.DagPutter
|
||||
TransactionPutter shared.DagPutter
|
||||
TransactionTriePutter shared.DagPutter
|
||||
ReceiptPutter shared.DagPutter
|
||||
ReceiptTriePutter shared.DagPutter
|
||||
StatePutter shared.DagPutter
|
||||
StoragePutter shared.DagPutter
|
||||
HeaderPutter ipfs.DagPutter
|
||||
TransactionPutter ipfs.DagPutter
|
||||
TransactionTriePutter ipfs.DagPutter
|
||||
ReceiptPutter ipfs.DagPutter
|
||||
ReceiptTriePutter ipfs.DagPutter
|
||||
StatePutter ipfs.DagPutter
|
||||
StoragePutter ipfs.DagPutter
|
||||
}
|
||||
|
||||
// NewIPLDPublisher creates a pointer to a new Publisher which satisfies the IPLDPublisher interface
|
||||
|
||||
@@ -18,8 +18,6 @@ package shared
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
node "github.com/ipfs/go-ipld-format"
|
||||
)
|
||||
|
||||
// PayloadStreamer streams chain-specific payloads to the provided channel
|
||||
@@ -71,11 +69,6 @@ type ClientSubscription interface {
|
||||
Unsubscribe()
|
||||
}
|
||||
|
||||
// DagPutter is a general interface for a dag putter
|
||||
type DagPutter interface {
|
||||
DagPut(n node.Node) (string, error)
|
||||
}
|
||||
|
||||
// Cleaner is for cleaning out data from the cache within the given ranges
|
||||
type Cleaner interface {
|
||||
Clean(rngs [][2]uint64, t DataType) error
|
||||
|
||||
@@ -74,7 +74,7 @@ func NewWatcherConfig() (*Config, error) {
|
||||
return nil, err
|
||||
}
|
||||
case shared.Bitcoin:
|
||||
c.SubscriptionConfig, err = btc.NewEthSubscriptionConfig()
|
||||
c.SubscriptionConfig, err = btc.NewBtcSubscriptionConfig()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user