Esempio n. 1
0
// NewReleaseService creates a new service to periodically check for new client
// releases and notify the user of such.
func NewReleaseService(ctx *node.ServiceContext, config Config) (node.Service, error) {
	// Retrieve the Expanse service dependency to access the blockchain
	var expanse *exp.Expanse
	if err := ctx.Service(&expanse); err != nil {
		return nil, err
	}
	// Construct the release service
	contract, err := NewReleaseOracle(config.Oracle, exp.NewContractBackend(expanse))
	if err != nil {
		return nil, err
	}
	return &ReleaseService{
		config: config,
		oracle: contract,
		quit:   make(chan chan error),
	}, nil
}