forked from stellar/go
/
init_txsub.go
31 lines (26 loc) · 983 Bytes
/
init_txsub.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package horizon
import (
"net/http"
"github.com/stivens13/go/services/horizon/internal/db2/core"
"github.com/stivens13/go/services/horizon/internal/db2/history"
"github.com/stivens13/go/services/horizon/internal/txsub"
results "github.com/stivens13/go/services/horizon/internal/txsub/results/db"
"github.com/stivens13/go/services/horizon/internal/txsub/sequence"
)
func initSubmissionSystem(app *App) {
cq := &core.Q{Session: app.CoreSession(nil)}
app.submitter = &txsub.System{
Pending: txsub.NewDefaultSubmissionList(),
Submitter: txsub.NewDefaultSubmitter(http.DefaultClient, app.config.StellarCoreURL),
SubmissionQueue: sequence.NewManager(),
Results: &results.DB{
Core: cq,
History: &history.Q{Session: app.HorizonSession(nil)},
},
Sequences: cq.SequenceProvider(),
NetworkPassphrase: app.networkPassphrase,
}
}
func init() {
appInit.Add("txsub", initSubmissionSystem, "app-context", "log", "horizon-db", "core-db")
}