Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions Dockerfile.mio
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# --------------------------------------------
# WorldLand Mio Testnet Node Dockerfile
# --------------------------------------------
# This specialized Dockerfile builds and runs a WorldLand node
# preconfigured for the Mio testnet network.
# --------------------------------------------

ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""

# --------------------------------------------
# Stage 1: Build WorldLand binaries in a Go builder container
# --------------------------------------------
FROM golang:1.24-alpine AS builder

# Install required build tools
RUN apk add --no-cache gcc musl-dev linux-headers git

# Set working directory
WORKDIR /worldland

# Copy Go module files and download dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy the full project source
COPY . .

# Build the WorldLand binary (statically linked)
RUN go run build/ci.go install -static ./cmd/worldland

# --------------------------------------------
# Stage 2: Create a minimal runtime container with the built binary
# --------------------------------------------
FROM alpine:latest

# Install runtime dependencies
RUN apk add --no-cache ca-certificates curl jq

# Create data directory for blockchain data
RUN mkdir -p /worldland/data

# Copy the compiled worldland binary
COPY --from=builder /worldland/build/bin/worldland /usr/local/bin/

# Expose standard blockchain ports
# 8545: HTTP-RPC server
# 8546: WS-RPC server
# 30303: P2P network (TCP & UDP)
EXPOSE 8545 8546 30303 30303/udp

# Set data directory as volume
VOLUME ["/worldland/data"]

# Default entrypoint runs worldland with Mio testnet flag
# Users can override CMD to add additional flags
ENTRYPOINT ["worldland"]

# Default command runs Mio testnet with common settings
# --mio: Use Mio testnet network
# --datadir: Store blockchain data in /worldland/data
# --http: Enable HTTP-RPC server
# --http.addr: Listen on all interfaces
# --http.corsdomain: Allow CORS from any origin (adjust for production)
# --http.vhosts: Allow any virtual host (adjust for production)
CMD ["--mio", \
"--datadir", "/worldland/data", \
"--http", \
"--http.addr", "0.0.0.0", \
"--http.api", "eth,net,web3,txpool", \
"--http.corsdomain", "*", \
"--http.vhosts", "*"]

# --------------------------------------------
# Metadata labels for programmatic image tracking
# --------------------------------------------
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""

LABEL org.opencontainers.image.title="WorldLand Mio Testnet Node"
LABEL org.opencontainers.image.description="WorldLand blockchain node for Mio testnet network"
LABEL org.opencontainers.image.source="https://github.com/cryptoecc/WorldLand"
LABEL commit="$COMMIT"
LABEL version="$VERSION"
LABEL buildnum="$BUILDNUM"
LABEL network="mio-testnet"
2 changes: 2 additions & 0 deletions cmd/devp2p/nodesetcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ func ethFilter(args []string) (nodeFilter, error) {
filter = forkid.NewStaticFilter(params.SeoulChainConfig, params.SeoulGenesisHash)
case "gwangju":
filter = forkid.NewStaticFilter(params.GwangjuChainConfig, params.GwangjuGenesisHash)
case "mio":
filter = forkid.NewStaticFilter(params.MioChainConfig, params.MioGenesisHash)
default:
return nil, fmt.Errorf("unknown network %q", args[0])
}
Expand Down
8 changes: 8 additions & 0 deletions cmd/evm/internal/t8ntool/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ type header struct {
BaseFee *big.Int `json:"baseFeePerGas" rlp:"optional"`
Codeword []byte `json:"codeword" rlp:"optional"`
CodeLength uint64 `json:"codelength" rlp:"optional"`
VRFProof []byte `json:"vrfProof" rlp:"optional"`
VRFPublicKey []byte `json:"vrfPublicKey" rlp:"optional"`
}

type headerMarshaling struct {
Expand Down Expand Up @@ -165,6 +167,12 @@ func (i *bbInput) ToBlock() *types.Block {
if header.CodeLength != 0 {
header.CodeLength = i.Header.CodeLength
}
if header.VRFProof != nil {
header.VRFProof = i.Header.VRFProof
}
if header.VRFPublicKey != nil {
header.VRFPublicKey = i.Header.VRFPublicKey
}

return types.NewBlockWithHeader(header).WithBody(i.Txs, i.Ommers)
}
Expand Down
13 changes: 12 additions & 1 deletion cmd/evm/internal/t8ntool/gen_header.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 33 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ var (
Usage: "Gwangju network: Error-Correction Codes Proof-of-Work Test Network",
}

MioFlag = &cli.BoolFlag{
Name: "mio",
Usage: "Mio network: Error-Correction Codes Proof-of-Work Test Network",
}

// Dev mode
DeveloperFlag = &cli.BoolFlag{
Name: "dev",
Expand Down Expand Up @@ -996,6 +1001,7 @@ var (
SepoliaFlag,
KilnFlag,*/
GwangjuFlag,
MioFlag,
}
// NetworkFlags is the flag group of all built-in supported networks.
NetworkFlags = append([]cli.Flag{
Expand Down Expand Up @@ -1039,6 +1045,9 @@ func MakeDataDir(ctx *cli.Context) string {
if ctx.Bool(GwangjuFlag.Name) {
return filepath.Join(path, "gwangju")
}
if ctx.Bool(MioFlag.Name) {
return filepath.Join(path, "mio")
}
return path
}
Fatalf("Cannot determine default data directory, please set manually (--datadir)")
Expand Down Expand Up @@ -1099,7 +1108,11 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) {
urls = params.SeoulBootnodes
case ctx.Bool(GwangjuFlag.Name):
urls = params.GwangjuBootnodes
case ctx.Bool(MioFlag.Name):
urls = params.MioBootnodes

}

// don't apply defaults if BootstrapNodes is already set
if cfg.BootstrapNodes != nil {
return
Expand Down Expand Up @@ -1560,7 +1573,10 @@ func SetDataDir(ctx *cli.Context, cfg *node.Config) {
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "seoul")
case ctx.Bool(GwangjuFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "gwangju")
case ctx.Bool(MioFlag.Name) && cfg.DataDir == node.DefaultDataDir():
cfg.DataDir = filepath.Join(node.DefaultDataDir(), "mio")
}

}

func setGPO(ctx *cli.Context, cfg *gasprice.Config, light bool) {
Expand Down Expand Up @@ -1751,7 +1767,7 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) {
func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
// Avoid conflicting network flags
//CheckExclusive(ctx, MainnetFlag, DeveloperFlag, RopstenFlag, RinkebyFlag, GoerliFlag, SepoliaFlag, KilnFlag, SeoulFlag, GwangjuFlag)
CheckExclusive(ctx, DeveloperFlag, SeoulFlag, GwangjuFlag)
CheckExclusive(ctx, DeveloperFlag, SeoulFlag, GwangjuFlag, MioFlag)
CheckExclusive(ctx, LightServeFlag, SyncModeFlag, "light")
CheckExclusive(ctx, DeveloperFlag, ExternalSignerFlag) // Can't use both ephemeral unlocked and external signer
if ctx.String(GCModeFlag.Name) == "archive" && ctx.Uint64(TxLookupLimitFlag.Name) != 0 {
Expand Down Expand Up @@ -1944,6 +1960,14 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
cfg.Genesis = core.DefaultGwangjuGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.GwangjuGenesisHash)

case ctx.Bool(MioFlag.Name):
if !ctx.IsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 10396
}
cfg.Genesis = core.DefaultMioGenesisBlock()
SetDNSDiscoveryDefaults(cfg, params.MioGenesisHash)

case ctx.Bool(DeveloperFlag.Name):
if !ctx.IsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1337
Expand Down Expand Up @@ -2199,6 +2223,8 @@ func MakeGenesis(ctx *cli.Context) *core.Genesis {
genesis = core.DefaultSeoulGenesisBlock()
case ctx.Bool(GwangjuFlag.Name):
genesis = core.DefaultGwangjuGenesisBlock()
case ctx.Bool(MioFlag.Name):
genesis = core.DefaultMioGenesisBlock()
case ctx.Bool(DeveloperFlag.Name):
Fatalf("Developer chains are ephemeral")
}
Expand Down Expand Up @@ -2230,7 +2256,12 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (*core.BlockChain, ethdb.Data
ethashConfig.PowMode = ethash.ModeFake
}

engine := ethconfig.CreateConsensusEngine(stack, &ethashConfig, cliqueConfig, &eccpowConfig, nil, false, chainDb)
kaijuConfig := ethconfig.Defaults.Kaiju
if ctx.Bool(FakePoWFlag.Name) {
ethashConfig.PowMode = ethash.ModeFake
}

engine := ethconfig.CreateConsensusEngine(stack, &ethashConfig, cliqueConfig, &eccpowConfig, &kaijuConfig, nil, false, chainDb)
if gcmode := ctx.String(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" {
Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name)
}
Expand Down
8 changes: 6 additions & 2 deletions cmd/worldland/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,9 @@ func prepare(ctx *cli.Context) {
case ctx.IsSet(utils.GwangjuFlag.Name):
log.Info("Starting Worldland on Gwangju testnet ...")

case ctx.IsSet(utils.MioFlag.Name):
log.Info("Starting Worldland on Mio testnet ...")

case ctx.IsSet(utils.DeveloperFlag.Name):
log.Info("Starting Worldland in ephemeral dev mode...")
log.Warn(`You are running Worldland in --dev mode. Please note the following:
Expand All @@ -313,21 +316,22 @@ func prepare(ctx *cli.Context) {
5. Networking is disabled; there is no listen-address, the maximum number of peers is set
to 0, and discovery is disabled.
`)

case !ctx.IsSet(utils.NetworkIdFlag.Name):
log.Info("Starting clinet on Worldland Seoul mainnet...")
ctx.Set(utils.SeoulFlag.Name, strconv.FormatBool(true))
}
// If we're a full node on mainnet without --cache specified, bump default cache allowance
if ctx.String(utils.SyncModeFlag.Name) != "light" && !ctx.IsSet(utils.CacheFlag.Name) && !ctx.IsSet(utils.NetworkIdFlag.Name) {
// Make sure we're not on any supported preconfigured testnet either
if !ctx.IsSet(utils.RopstenFlag.Name) &&
if !ctx.IsSet(utils.RopstenFlag.Name) &&
!ctx.IsSet(utils.SepoliaFlag.Name) &&
!ctx.IsSet(utils.RinkebyFlag.Name) &&
!ctx.IsSet(utils.GoerliFlag.Name) &&
!ctx.IsSet(utils.KilnFlag.Name) &&
!ctx.IsSet(utils.SeoulFlag.Name) &&
!ctx.IsSet(utils.GwangjuFlag.Name) &&
!ctx.IsSet(utils.MioFlag.Name) &&
!ctx.IsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on mainnet. Bump that cache up!
log.Info("Bumping default cache on mainnet", "provided", ctx.Int(utils.CacheFlag.Name), "updated", 4096)
Expand Down
Loading