-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add account to rollup node and index node (#494)
* feat: add doc store * feat: add key store * feat: add retry to subscribe the message * feat: add setup rollup * feat: update cicd * feat: add docker build * feat: add test latest * feat: add a standalone docker build * feat: add docker files * fix: update the docker cd name * feat: add indexer system status * feat: add setup function * feat: add setup with permission control * feat: add meta store client * feat: update cicd * fix: update cicd * fix: fix the typo
- Loading branch information
Showing
32 changed files
with
5,782 additions
and
7,313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI # Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
|
||
docker_image: | ||
name: build_pr_image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
override: true | ||
components: rustfmt | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: taiki-e/install-action@cargo-llvm-cov | ||
- uses: taiki-e/install-action@nextest | ||
- name: Setup build env | ||
run: | | ||
sudo apt-get install protobuf-compiler | ||
protoc --version | ||
ROOT_DIR=`pwd` | ||
cd ${ROOT_DIR}/metadata && yarn install && npx hardhat compile | ||
ls ${ROOT_DIR}/metadata/artifacts/contracts/DB3MetaStore.sol/ | ||
cd ${ROOT_DIR} && cargo build | ||
cp ${ROOT_DIR}/target/debug/db3 ${ROOT_DIR}/docker/ | ||
- name: docker login | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build Docker image | ||
run: | | ||
git_hash=$(git rev-parse --short "$GITHUB_SHA") | ||
cd docker && docker build . -t ghcr.io/dbpunk-labs/db3:${git_hash} | ||
docker push ghcr.io/dbpunk-labs/db3:${git_hash} | ||
echo "the image is ghcr.io/dbpunk-labs/db3:${git_hash}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ubuntu | ||
RUN apt update && apt install -y curl git | ||
RUN curl -sL https://deb.nodesource.com/setup_18.x -o /tmp/nodesource_setup.sh | ||
RUN bash /tmp/nodesource_setup.sh && apt install nodejs | ||
RUN npm install -g arlocal serve | ||
ADD db3 /usr/bin/db3 | ||
RUN chmod +x /usr/bin/db3 | ||
ADD ar_miner.sh /usr/bin/ar_miner.sh | ||
ADD start_localnet.sh /usr/bin/start_localnet.sh | ||
CMD ["/bin/bash", "/usr/bin/start_localnet.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#! /bin/sh | ||
# | ||
# ar_miner.sh | ||
# Copyright (C) 2023 jackwang <jackwang@jackwang-ub> | ||
# | ||
# Distributed under terms of the MIT license. | ||
# | ||
|
||
npx arlocal >arlocal.log 2>&1 & | ||
sleep 2 | ||
curl http://127.0.0.1:1984/mint/$1/10000000000000 | ||
while true | ||
do | ||
curl http://127.0.0.1:1984/mine | ||
sleep 2 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#! /bin/bash | ||
# | ||
mkdir -p ./mutation_db ./state_db ./doc_db ./keys ./index_meta_db ./index_doc_db | ||
echo "start store node..." | ||
/usr/bin/db3 store --public-host 0.0.0.0 --rollup-interval 30000 > store.log 2>&1 & | ||
sleep 3 | ||
echo "start index node..." | ||
/usr/bin/db3 indexer --public-host 0.0.0.0 > indexer.log 2>&1 & | ||
sleep 3 | ||
|
||
AR_ADDRESS=`cat /store.log | grep filestore | awk '{print $NF}'` | ||
echo "the ar account address ${AR_ADDRESS}" | ||
echo "start ar testnet ..." | ||
bash /usr/bin/ar_miner.sh ${AR_ADDRESS} > miner.log 2>&1 & | ||
sleep 1 | ||
echo "Start the local db3 nodes successfully" | ||
echo "The storage node url: http://127.0.0.1:26619" | ||
echo "The index node url: http://127.0.0.1:26639" | ||
while true; do sleep 10 ; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -433,4 +433,4 @@ describe("DB3MetaStore", function () { | |
|
||
|
||
}); | ||
|
||
|
Oops, something went wrong.