package
0.79.0-preview.4
Repository: https://github.com/vegaprotocol/vega.git
Documentation: pkg.go.dev

# README

Event bus

Add a new event

  1. Create a protobuf message to describe your event in the proto folder.
  2. Register your event in BusEventType enum and BusEvent.event message in proto/events.proto.
  3. Generate the code with make proto.
  4. In events/bus.go, create a constant to identify the event and map it to the protobuf enum type BusEventType in variable protoMap and toProto. Give it a name in eventStrings.
  5. In the events folder, create a file my_event.go where the Golang definition of the new event will live:
package events

import (
	eventspb "code.vegaprotocol.io/vega/protos/vega/events/v1"
)

type MyEvent struct {
	*Base
	o eventspb.MyEvent
}

  1. Implement the StreamEvent interface on it.
  2. Implement the "FromStream interface on it.
  3. Add the support for this new event into the Service responsible for it.
  4. Update the graphql structures in the data-node in schema.graphql. In particular the BusEventType enum and the Event union