use _start as entrypoint, closes #18

This commit is contained in:
Cadey Ratio 2019-12-13 04:39:25 +00:00
parent 25d512186b
commit 112f4287e1
2 changed files with 9 additions and 8 deletions

View File

@ -24,12 +24,13 @@ import (
)
var (
natsURL = flag.String("nats-url", nats.DefaultURL, "nats URL")
ipfsURL = flag.String("ipfs-host", "localhost:5001", "IPFS host")
workerCount = flag.Int("worker-count", 1, "number of wasm executor workers")
gasLimit = flag.Int("gas-limit", 1048576, "number of wasm instructions per execution")
ramLimit = flag.Int("ram-limit", 128, "number of wasm pages that can be used")
loopTimeout = flag.Duration("loop-timeout", 30*time.Second, "idle time per loop")
natsURL = flag.String("nats-url", nats.DefaultURL, "nats URL")
ipfsURL = flag.String("ipfs-host", "localhost:5001", "IPFS host")
workerCount = flag.Int("worker-count", 1, "number of wasm executor workers")
gasLimit = flag.Int("gas-limit", 1048576, "number of wasm instructions per execution")
ramLimit = flag.Int("ram-limit", 128, "number of wasm pages that can be used")
loopTimeout = flag.Duration("loop-timeout", 30*time.Second, "idle time per loop")
cwaEntrypoint = flag.String("cwa-entrypoint", "_start", "entrypoint into CWA programs")
)
func main() {
@ -126,7 +127,7 @@ func waitForNewWASM(ctx context.Context, wg *sync.WaitGroup, sh *shell.Shell, nc
},
Name: er.Name,
FuncName: "cwa_main",
FuncName: *cwaEntrypoint,
Env: er.Env,
Binary: wasmBin,
Stdin: stdin,

View File

@ -44,7 +44,7 @@ Flags:
}
func (r *runCmd) SetFlags(fs *flag.FlagSet) {
fs.StringVar(&r.funcName, "func-name", "cwa_main", "entrypoint function to call")
fs.StringVar(&r.funcName, "func-name", "_start", "entrypoint function to call")
fs.StringVar(&r.abi, "abi", "cwa", "ABI to use")
fs.Uint64Var(&r.gasLimit, "gas-limit", 1048576, "number of wasm instructions per execution")
fs.IntVar(&r.ramLimit, "ram-limit", 128, "number of wasm pages that can be used")