Skip to content

Commit

Permalink
Update docs and setup scripts
Browse files Browse the repository at this point in the history
We replaced github.com/gogo/protobuf with google.golang.org/protobuf
so need to align the resources around that.
  • Loading branch information
nkuba committed Sep 8, 2022
1 parent d17b176 commit 0d3b505
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 29 deletions.
6 changes: 3 additions & 3 deletions docs-v1/development/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ repository. A simple `docker build` should get you a functioning container.
If you want to build natively, there are a few prereqs you'll need to go through.
In particular, you'll need the
https://developers.google.com/protocol-buffers/docs/downloads[protobuf
compiler]. You'll also need to install the `protoc-gen-gogoslick` toolchain,
compiler]. You'll also need to install the `protoc-gen-go` toolchain,
which you can install using `go get`:

```
go get -u github.com/gogo/protobuf/protoc-gen-gogoslick
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
```

Run `+go generate ./.../+` from `keep-core` and if everything is fine, start the
Expand Down Expand Up @@ -100,7 +100,7 @@ branches are instead published to `+https://docs.keep.network/<branch name>/+`.

- Please avoid using `~` when defining `$GOBIN` location and use `$HOME` instead.
We've been observing https://github.com/google/protobuf/issues/3355[some issues]
with locating `protoc-gen-gogoslick` when running `go generate` and `$GOBIN`
with locating `protoc-gen-go` when running `go generate` and `$GOBIN`
contained `~`.

- For Mojave, if you have a problem with missing include or missing library and
Expand Down
10 changes: 5 additions & 5 deletions scripts/macos-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
set -e

echo "Installing coreutils requirement..."
brew list coreutils &> /dev/null || brew install coreutils
brew list coreutils &>/dev/null || brew install coreutils

echo "Installing golang requirements..."
brew list golang &> /dev/null || brew install golang
brew list golang &>/dev/null || brew install golang

echo "Installing ethereum requirements..."
brew tap ethereum/ethereum
Expand All @@ -15,7 +15,7 @@ brew list solidity &>/dev/null || brew install solidity@5
echo "Installing protobuf requirements..."
# Protobuf
brew list protobuf &>/dev/null || brew install protobuf
go install github.com/gogo/protobuf/protoc-gen-gogoslick@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

echo "Installing precommit requirements..."
brew list pre-commit &>/dev/null || brew install pre-commit
Expand All @@ -32,8 +32,8 @@ echo "Installing solidity npm and requirements..."
brew list npm &>/dev/null || brew install npm
cd ../solidity-v1 && npm install && cd ../scripts

if ! [ -x "$(command -v protoc-gen-gogoslick)" ]; then
echo 'WARNING: protoc-gen-gogoslick command is not available'
if ! [ -x "$(command -v protoc-gen-go)" ]; then
echo 'WARNING: protoc-gen-go command is not available'
echo 'WARNING: please check whether $GOPATH/bin is added to your $PATH'
fi

Expand Down
87 changes: 66 additions & 21 deletions scripts/ubuntu-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,34 @@ sudo apt-get install -y \
python \
build-essential

if ! [ -x "$(command -v curl)" ]; then echo "curl installation failed"; exit 1; fi
if ! [ -x "$(command -v wget)" ]; then echo "wget installation failed"; exit 1; fi
if ! [ -x "$(command -v git)" ]; then echo "git installation failed"; exit 1; fi
if ! [ -x "$(command -v unzip)" ]; then echo "unzip installation failed"; exit 1; fi
if ! [ -x "$(command -v jq)" ]; then echo "jq installation failed"; exit 1; fi
if ! [ -x "$(command -v python)" ]; then echo "python installation failed"; exit 1; fi
if ! [ -x "$(command -v make)" ]; then echo "build-essential installation failed"; exit 1; fi
if ! [ -x "$(command -v curl)" ]; then
echo "curl installation failed"
exit 1
fi
if ! [ -x "$(command -v wget)" ]; then
echo "wget installation failed"
exit 1
fi
if ! [ -x "$(command -v git)" ]; then
echo "git installation failed"
exit 1
fi
if ! [ -x "$(command -v unzip)" ]; then
echo "unzip installation failed"
exit 1
fi
if ! [ -x "$(command -v jq)" ]; then
echo "jq installation failed"
exit 1
fi
if ! [ -x "$(command -v python)" ]; then
echo "python installation failed"
exit 1
fi
if ! [ -x "$(command -v make)" ]; then
echo "build-essential installation failed"
exit 1
fi

echo "Common tools have been installed successfully!"

Expand All @@ -30,8 +51,8 @@ echo "Installing Node.js and NPM..."
if ! [ -x "$(command -v nvm)" ]; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.profile
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.profile
echo 'export NVM_DIR="$HOME/.nvm"' >>~/.profile
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >>~/.profile
source ~/.profile
fi

Expand All @@ -40,8 +61,14 @@ nvm install 11.15.0
nvm alias default 11.15.0
nvm use default

if ! [ -x "$(command -v node)" ]; then echo "Node installation failed"; exit 1; fi
if ! [ -x "$(command -v npm)" ]; then echo "NPM installation failed"; exit 1; fi
if ! [ -x "$(command -v node)" ]; then
echo "Node installation failed"
exit 1
fi
if ! [ -x "$(command -v npm)" ]; then
echo "NPM installation failed"
exit 1
fi

echo "Node.js and NPM have been installed successfully!"

Expand All @@ -55,11 +82,14 @@ tar -xvf $GOLANG_PACKAGE
sudo chown -R root:root ./go
sudo mv go /usr/local

echo 'GOPATH="$HOME/go"' >> ~/.profile
echo 'PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"' >> ~/.profile
echo 'GOPATH="$HOME/go"' >>~/.profile
echo 'PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"' >>~/.profile
source ~/.profile

if ! [ -x "$(command -v go)" ]; then echo "Go installation failed"; exit 1; fi
if ! [ -x "$(command -v go)" ]; then
echo "Go installation failed"
exit 1
fi

echo "Go has been installed successfully!"

Expand All @@ -74,7 +104,10 @@ mkdir ./go-ethereum && tar -xzf $GETH_PACKAGE -C ./go-ethereum --strip-component
sudo chown -R root:root ./go-ethereum
sudo mv ./go-ethereum/* /usr/local/bin

if ! [ -x "$(command -v geth)" ]; then echo "go-ethereum installation failed"; exit 1; fi
if ! [ -x "$(command -v geth)" ]; then
echo "go-ethereum installation failed"
exit 1
fi

echo "go-ethereum has been installed successfully!"

Expand All @@ -88,7 +121,10 @@ chmod 755 solc-static-linux
sudo mv solc-static-linux /usr/local/bin
sudo ln -s -f /usr/local/bin/solc-static-linux /usr/local/bin/solc

if ! [ -x "$(command -v solc)" ]; then echo "Solidity installation failed"; exit 1; fi
if ! [ -x "$(command -v solc)" ]; then
echo "Solidity installation failed"
exit 1
fi

echo "Solidity has been installed successfully!"

Expand All @@ -104,17 +140,26 @@ chmod 755 -R ./protoc
sudo mv protoc/bin/protoc /usr/local/bin
sudo mv protoc/include/* /usr/local/include

go install github.com/gogo/protobuf/protoc-gen-gogoslick@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

if ! [ -x "$(command -v protoc)" ]; then echo "protoc installation failed"; exit 1; fi
if ! [ -x "$(command -v protoc-gen-gogoslick)" ]; then echo "protoc-gen-gogoslick installation failed"; exit 1; fi
if ! [ -x "$(command -v protoc)" ]; then
echo "protoc installation failed"
exit 1
fi
if ! [ -x "$(command -v protoc-gen-go)" ]; then
echo "protoc-gen-go installation failed"
exit 1
fi

echo "Protobuf has been installed successfully!"

echo "Installing Truffle..."

npm install -g [email protected]

if ! [ -x "$(command -v truffle)" ]; then echo "Truffle installation failed"; exit 1; fi
if ! [ -x "$(command -v truffle)" ]; then
echo "Truffle installation failed"
exit 1
fi

echo "Truffle has been installed successfully!"
echo "Truffle has been installed successfully!"

0 comments on commit 0d3b505

Please sign in to comment.