Skip to content

Commit

Permalink
Merge pull request #99 from renproject/feat/upgrade-solana-ffi
Browse files Browse the repository at this point in the history
Feat/upgrade solana ffi
  • Loading branch information
roynalnaruto authored Jun 3, 2021
2 parents 154f458 + b7eb102 commit 53fb528
Show file tree
Hide file tree
Showing 11 changed files with 292 additions and 95 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Docker Build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: renbot/multichain:latest
secrets: |
GIT_AUTH_TOKEN=${{ secrets.PERSONAL_ACCESS_TOKEN }}
build-args: |
GITHUB_TOKEN=${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
131 changes: 55 additions & 76 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ jobs:
test-solana:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: a62d00da59d1b0fb35f3a4ae854efa9441af892d
SOLANA_FFI_COMMIT: f6521b8a1af44f4d468bc8e7e67ba3766a5602ef
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: 1d5f4405dd2fb89c96cde28db33051a6e992d607
steps:
- uses: actions/setup-go@v2
with:
go-version: "1.15.5"

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
submodules: recursive

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Caching modules
uses: actions/cache@v1
with:
Expand All @@ -43,7 +44,7 @@ jobs:
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
Expand Down Expand Up @@ -92,7 +93,7 @@ jobs:
- name: Setup environment for Solana tests
run: |
sh -c "$(curl -sSfL https://release.solana.com/v1.6.8/install)"
sh -c "$(curl -sSfL https://release.solana.com/v1.7.0/install)"
cd $GITHUB_WORKSPACE
export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH"
echo ${{ secrets.SOLANA_KEY }} > ~/.config/solana/id.json
Expand All @@ -115,25 +116,26 @@ jobs:
test-filecoin:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: a62d00da59d1b0fb35f3a4ae854efa9441af892d
SOLANA_FFI_COMMIT: f6521b8a1af44f4d468bc8e7e67ba3766a5602ef
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: 1d5f4405dd2fb89c96cde28db33051a6e992d607
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
submodules: recursive

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Caching modules
uses: actions/cache@v1
with:
Expand All @@ -156,7 +158,7 @@ jobs:
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
Expand Down Expand Up @@ -239,25 +241,26 @@ jobs:
test-zcash:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: a62d00da59d1b0fb35f3a4ae854efa9441af892d
SOLANA_FFI_COMMIT: f6521b8a1af44f4d468bc8e7e67ba3766a5602ef
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: 1d5f4405dd2fb89c96cde28db33051a6e992d607
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
submodules: recursive

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Caching modules
uses: actions/cache@v1
with:
Expand All @@ -280,7 +283,7 @@ jobs:
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
Expand Down Expand Up @@ -362,25 +365,26 @@ jobs:
test-terra:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: a62d00da59d1b0fb35f3a4ae854efa9441af892d
SOLANA_FFI_COMMIT: f6521b8a1af44f4d468bc8e7e67ba3766a5602ef
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: 1d5f4405dd2fb89c96cde28db33051a6e992d607
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
submodules: recursive

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Caching modules
uses: actions/cache@v1
with:
Expand All @@ -403,7 +407,7 @@ jobs:
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
Expand Down Expand Up @@ -485,25 +489,26 @@ jobs:
test-dogecoin:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: a62d00da59d1b0fb35f3a4ae854efa9441af892d
SOLANA_FFI_COMMIT: f6521b8a1af44f4d468bc8e7e67ba3766a5602ef
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: 1d5f4405dd2fb89c96cde28db33051a6e992d607
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
submodules: recursive

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Caching modules
uses: actions/cache@v1
with:
Expand All @@ -526,7 +531,7 @@ jobs:
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
Expand Down Expand Up @@ -608,25 +613,26 @@ jobs:
test-btc-bch:
runs-on: ubuntu-latest
env:
FILECOIN_FFI_COMMIT: a62d00da59d1b0fb35f3a4ae854efa9441af892d
SOLANA_FFI_COMMIT: f6521b8a1af44f4d468bc8e7e67ba3766a5602ef
FILECOIN_FFI_COMMIT: 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
SOLANA_FFI_COMMIT: 1d5f4405dd2fb89c96cde28db33051a6e992d607
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
submodules: recursive

- name: Configure git for Private Modules
env:
TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: git config --global url."https://roynalnaruto:${TOKEN}@github.com".insteadOf "https://github.com"

- name: Caching modules
uses: actions/cache@v1
with:
Expand All @@ -649,7 +655,7 @@ jobs:
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev
sudo apt-get install -y jq mesa-opencl-icd ocl-icd-opencl-dev pkg-config libudev-dev hwloc libhwloc-dev
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
Expand Down Expand Up @@ -730,30 +736,3 @@ jobs:
-btc=true \
-bch=true \
-timeout 1500s
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: renbot/multichain:latest
build-args: |
GITHUB_TOKEN=${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ RUN apt-get update && \
ocl-icd-opencl-dev \
libssl-dev \
libudev-dev \
hwloc \
libhwloc-dev \
gcc \
git \
bzr \
Expand All @@ -22,7 +24,7 @@ ENV GOPROXY=https://proxy.golang.org

ARG GITHUB_TOKEN
RUN git config --global url."https://${GITHUB_TOKEN}:[email protected]/".insteadOf "https://github.com/"
ENV GOPRIVATE=github.com/renproject/ren-solana
ENV GOPRIVATE="github.com/renproject/ren-solana,github.com/renproject/solana-ffi"

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
Expand All @@ -33,7 +35,7 @@ RUN mkdir -p src/github.com/filecoin-project
WORKDIR $GOPATH/src/github.com/filecoin-project
RUN git clone https://github.com/filecoin-project/filecoin-ffi
WORKDIR $GOPATH/src/github.com/filecoin-project/filecoin-ffi
RUN git checkout a62d00da59d1b0fb35f3a4ae854efa9441af892d
RUN git checkout 8b97bd8230b77bd32f4f27e4766a6d8a03b4e801
RUN make
RUN go install

Expand All @@ -43,6 +45,6 @@ RUN mkdir -p src/github.com/renproject
WORKDIR $GOPATH/src/github.com/renproject
RUN git clone https://github.com/renproject/solana-ffi
WORKDIR $GOPATH/src/github.com/renproject/solana-ffi
RUN git checkout f6521b8a1af44f4d468bc8e7e67ba3766a5602ef
RUN git checkout 1d5f4405dd2fb89c96cde28db33051a6e992d607
RUN make clean && make
RUN go install ./...
6 changes: 3 additions & 3 deletions chain/filecoin/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
filaddress "github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/go-state-types/crypto"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/api/v0api"
filclient "github.com/filecoin-project/lotus/api/client"
"github.com/filecoin-project/lotus/chain/types"
"github.com/ipfs/go-cid"
Expand Down Expand Up @@ -66,7 +66,7 @@ func (opts ClientOptions) WithAuthToken(authToken pack.String) ClientOptions {
// RPC client instance.
type Client struct {
opts ClientOptions
node api.FullNode
node v0api.FullNode
closer jsonrpc.ClientCloser
}

Expand All @@ -77,7 +77,7 @@ func NewClient(opts ClientOptions) (*Client, error) {
requestHeaders.Add(AuthorizationKey, opts.AuthToken)
}

node, closer, err := filclient.NewFullNodeRPC(context.Background(), opts.RPCURL, requestHeaders)
node, closer, err := filclient.NewFullNodeRPCV0(context.Background(), opts.RPCURL, requestHeaders)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit 53fb528

Please sign in to comment.