Temporary Setup with docker

This commit is contained in:
evgeniy-scherbina 2024-01-03 10:06:14 -05:00
parent 1381099eaf
commit 7a2099c8d8
4 changed files with 41 additions and 0 deletions

17
Dockerfile.dev Normal file
View file

@ -0,0 +1,17 @@
FROM golang:1.20-alpine
# Set up dependencies
# bash, jq, curl for debugging
# git, make for installation
# libc-dev, gcc, linux-headers, eudev-dev are used for cgo and ledger installation
# RUN apk add bash git make libc-dev gcc linux-headers eudev-dev jq curl
RUN apk add make curl bash
RUN mkdir -p $GOPATH/src/github.com/Kava-Labs/go-ethereum
WORKDIR $GOPATH/src/github.com/Kava-Labs/go-ethereum
COPY . .
RUN make geth
RUN cp ./build/bin/geth /go/bin/
CMD ["geth","--dev","--http"]

6
build-docker.sh Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
docker build -t go-ethereum-dev -f Dockerfile.dev .
# RUN
# docker run -it go-ethereum-dev sh

View file

@ -105,6 +105,7 @@ var PrecompiledContractsCancun = map[common.Address]PrecompiledContract{
common.BytesToAddress([]byte{8}): &bn256PairingIstanbul{},
common.BytesToAddress([]byte{9}): &blake2F{},
common.BytesToAddress([]byte{0x0a}): &kzgPointEvaluation{},
//common.BytesToAddress([]byte{0x0b}): &sum3{},
}
// PrecompiledContractsBLS contains the set of pre-compiled Ethereum
@ -231,6 +232,19 @@ func (c *sha256hash) Run(input []byte) ([]byte, error) {
return h[:], nil
}
type sum3 struct{}
// RequiredGas returns the gas required to execute the pre-compiled contract.
//
// This method does not require any overflow checking as the input size gas costs
// required for anything significant is so high it's impossible to pay for.
func (c *sum3) RequiredGas(input []byte) uint64 {
return 1
}
func (c *sum3) Run(input []byte) ([]byte, error) {
return input, nil
}
// RIPEMD160 implemented as a native contract.
type ripemd160hash struct{}

4
curl.sh Executable file
View file

@ -0,0 +1,4 @@
curl -X POST \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' \
-H "Content-Type: application/json" \
http://localhost:8545