Use external main module

* renames main package so it's importable
* adds wrapmain sub-module as main module
* updates plugeth-utils to version that supports linking libsecp256k1
This commit is contained in:
roysc committed 2024-03-14 22:10:37 +08:00
1 parent 1a89183720
commit f45dabbeff
27 files changed
+794 -30

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"fmt"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"os"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"fmt"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"encoding/json"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"bufio"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"fmt"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"crypto/rand"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"bytes"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"bytes"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"fmt"
+1 -1
View File
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"bufio"
+1 -1
View File
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"errors"
+1 -1
View File
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import "github.com/urfave/cli/v2"
+5 -2
View File
@@ -15,7 +15,7 @@
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
// geth is a command-line client for Ethereum.
package main
package geth
import (
"fmt"
@@ -273,7 +273,10 @@ func init() {
}
}
func main() {
// FIXME workaround https://github.com/golang/go/issues/31354 by wrapping main
func main() { Main() }
func Main() {
if err := app.Run(os.Args); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"fmt"
+6 -6
View File
@@ -1,4 +1,4 @@
package main
package geth
import (
"github.com/ethereum/go-ethereum/log"
@@ -107,18 +107,18 @@ func pluginsOnShutdown() {
func BlockChain(pl *plugins.PluginLoader) {
fnList := pl.Lookup("BlockChain", func(item interface{}) bool {
_, ok := item.(func())
return ok
_, ok := item.(func())
return ok
})
for _, fni := range fnList {
fni.(func())()
fni.(func())()
}
}
func pluginBlockChain() {
if plugins.DefaultPluginLoader == nil {
log.Warn("Attempting BlockChain, but default PluginLoader has not been initialized")
return
log.Warn("Attempting BlockChain, but default PluginLoader has not been initialized")
return
}
BlockChain(plugins.DefaultPluginLoader)
}
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"context"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"bytes"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"bytes"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"encoding/json"
+1 -1
View File
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package main
package geth
import (
"encoding/json"