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

ARM architecture support #227

Closed
ferrouswheel opened this issue Mar 13, 2019 · 3 comments · Fixed by #230
Closed

ARM architecture support #227

ferrouswheel opened this issue Mar 13, 2019 · 3 comments · Fixed by #230

Comments

@ferrouswheel
Copy link
Contributor

I'm investigating ARM support, so that snetd can be run on low-powered devices like the Raspberry Pi and be used in IoT applications.

This issue is an attempt to log my progress.

Initially I'm trying to cross compile with the following:

env GOOS=linux GOARCH=arm GOARM=6 go build -o build/snetd-linux-arm6 snetd/main.go

The first issue is:

# github.com/singnet/snet-daemon/ratelimit
ratelimit/rateLimit.go:15:13: constant 9223372036854775807 overflows int

That can be fixed by using math.MaxInt32 instead of math.MaxInt64.

The next issue is that ethereum-go has to do some C compilation and requires xgo for cross-compilation to work properly.

build constraints exclude all Go files in /home/joel/go/src/github.com/singnet/snet-daemon/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1

While cross compilation would make development faster and more convenient, tomorrow I'll try compiling directly on the Pi.

@vsbogd
Copy link
Member

vsbogd commented Mar 13, 2019

Looks like we need cross compilation in any case, for example to release Mac OS X binary, so solving cross compilation issue will be fruitful for daemon.

@ferrouswheel
Copy link
Contributor Author

Update on this.

  • the max message size is too large to fit in an int on arm, so I changed maxsizeOpt := grpc.MaxRecvMsgSize(math.MaxInt32)
  • The RaspberryPi I'm working with doesn't have enough memory to compile the daemon (it has ~500MB) even if I set GOMAXPROCS=1

So looks like we will have to figure out cross-compilation.

@ferrouswheel
Copy link
Contributor Author

Yes! Managed to snetd running on Raspberry Pi using xgo. I'll try to reproduce the steps, and make a PR with documentation.

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 a pull request may close this issue.

2 participants