Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move runner and export it #539

Merged
merged 6 commits into from
Apr 7, 2023
Merged

move runner and export it #539

merged 6 commits into from
Apr 7, 2023

Conversation

ceyonur
Copy link
Collaborator

@ceyonur ceyonur commented Feb 23, 2023

Why this should be merged

Makes it possible for external programs to import the main runner function from subnet-evm like

in another repo's plugin/main.go:

// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.

package main

import (
	"github.com/ava-labs/subnet-evm/plugin/runner"

	_ "github.com/ava-labs/precompilevm/helloworld"
)

func main() {
	runner.Run()
}

How this works

moves main function to a separate exported package

How this was tested

Locally tested

How is this documented

Will add a new repo for example and document it.

"github.com/ava-labs/subnet-evm/plugin/evm"
)

func Run() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add a string argument so the external repo can add some text to the PrintVersion message?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed it would be nice to allow an external repo to optionally specify some additional output to be included in PrintVersion().

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Copy link
Contributor

@anusha-ctrl anusha-ctrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@aaronbuchwald aaronbuchwald added the DO NOT MERGE This PR is not meant to be merged in its current state label Feb 23, 2023
@aaronbuchwald
Copy link
Collaborator

Adding the DO NOT MERGE label as @ceyonur and I talked offline that we want to spend a little more time thinking about the best way to do this before putting out an example that we would expect the community to start using.

@aaronbuchwald aaronbuchwald removed the DO NOT MERGE This PR is not meant to be merged in its current state label Apr 4, 2023
@aaronbuchwald aaronbuchwald merged commit 4e2eab7 into master Apr 7, 2023
@aaronbuchwald aaronbuchwald deleted the add-runner branch April 7, 2023 15:13
0xkaz added a commit to 0xkaz/subnet-evm that referenced this pull request Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants