AWS Lambda project as ethereum reverse proxy following JSON-RPC, written in Golang. In addition, this project try porting web3 to Golang. Furthermore it applied IPFS API here to overwhelm limited storage of blockchain.
- JSON-RPC relay with Ethereum node
- Proofs for sign and merkle tree such as Ecrecover, DeriveSha, VerifyProof and so on
- Sign, SignTx with encrypted private key on DynamoDB/Local
- IPFS interface
- fromWei, toWei written in Golang
- Go
- Install at https://golang.org/doc/install
- dep
- Install
brew install dep
- Docker
- Install at https://docs.docker.com/install
- xgo
- because of compilation for C code used in go-ethereum, we need improved cross-compiler
docker pull karalabe/xgo-latest
go get github.com/karalabe/xgo
- Move to root directory of this repo
- Build on your preference
- In case of Lambda that is cross-compile,
make
ormake lambda
- In case of Lambda with remote branch,
make branch=master remote
- In case of local machine compile,
make local
- Move each module directory such as json, rpc and so on
- Run testunit
go test -v
- $> proxy [KEY_JSON_PATH] -log_lev=debug -log_out=/log/proxy.log -log_fmt=json
- $> proxy [KEY_JSON_PATH] [KEY_JSON_PASSPHRASE] -log_lev=debug -log_out=/log/proxy.log -log_fmt=json
- path and passphrase for key json are NECESSARY now for crypto module.
log_lev
,log_out
,log_fmt
,log_bot_token
andlog_bot_chatid
are optional- description:
- log_lev: log level
- log_out: log output location
- log_fmt: log format, text or JSON
- log_bot_token: telegram access token
- log_bot_chatid: telegram chat ID
- default:
- log_lev: info
- log_out: stdout
- log_fmt: text
- Set Lambda on AWS
- Function package: compressed binary file in $GOPATH/src/{repo}/bin
- Handler: eth-proxy (binary file name, it is optional)
- Runtime: Go 1.x
- (Optional) Include DynamoDB execution role to Lambda execution role
- Set API Gateway as proxy on AWS
- Add API Gateway as Lambda trigger
- Add CloudWatch Logs
[1] AWS Lambda Go, https://github.com/aws/aws-lambda-go
[2] Go ethereum, https://github.com/ethereum/go-ethereum
[3] IPFS, https://ipfs.io/
[4] IPFS API, https://github.com/ipfs/go-ipfs-api
[5] Cross compiling for ethereum, https://github.com/ethereum/go-ethereum/wiki/Cross-compiling-Ethereum
[6] Xgo, https://github.com/karalabe/xgo
[7] Dep, https://github.com/golang/dep
MIT