Skip to content
Snippets Groups Projects
Commit 13306f81 authored by Hans Moog's avatar Hans Moog
Browse files

Feat: gossip on solididification strategy added

parent cf60f6bd
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ import (
"github.com/iotaledger/goshimmer/plugins/autopeering"
"github.com/iotaledger/goshimmer/plugins/cli"
"github.com/iotaledger/goshimmer/plugins/gossip"
gossip_on_solidification "github.com/iotaledger/goshimmer/plugins/gossip-on-solidification"
"github.com/iotaledger/goshimmer/plugins/gracefulshutdown"
"github.com/iotaledger/goshimmer/plugins/statusscreen"
statusscreen_tps "github.com/iotaledger/goshimmer/plugins/statusscreen-tps"
......@@ -21,6 +22,7 @@ func main() {
cli.PLUGIN,
autopeering.PLUGIN,
gossip.PLUGIN,
gossip_on_solidification.PLUGIN,
tangle.PLUGIN,
analysis.PLUGIN,
gracefulshutdown.PLUGIN,
......
package gossip_on_solidification
import (
"github.com/iotaledger/goshimmer/packages/events"
"github.com/iotaledger/goshimmer/packages/model/value_transaction"
"github.com/iotaledger/goshimmer/packages/node"
"github.com/iotaledger/goshimmer/plugins/gossip"
"github.com/iotaledger/goshimmer/plugins/tangle"
)
var PLUGIN = node.NewPlugin("Gossip On Solidification", func(plugin *node.Plugin) {
tangle.Events.TransactionSolid.Attach(events.NewClosure(func(tx *value_transaction.ValueTransaction) {
gossip.SendTransaction(tx.MetaTransaction)
}))
})
package gossip
import (
"github.com/iotaledger/goshimmer/packages/events"
"github.com/iotaledger/goshimmer/packages/model/meta_transaction"
"github.com/iotaledger/goshimmer/packages/node"
)
......@@ -10,6 +12,10 @@ func configure(plugin *node.Plugin) {
configureNeighbors(plugin)
configureServer(plugin)
configureSendQueue(plugin)
Events.ReceiveTransaction.Attach(events.NewClosure(func(tx *meta_transaction.MetaTransaction) {
plugin.LogDebug("Received TX " + string(tx.GetHash()))
}))
}
func run(plugin *node.Plugin) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment