Skip to content

Commit

Permalink
update ord version & lock pnpm version in ci (rooch-network#1606)
Browse files Browse the repository at this point in the history
* update ord version & lock pnpm version in ci

* opt cmd

* update doc
  • Loading branch information
wow-sven authored Apr 23, 2024
1 parent ef361c6 commit d108246
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
${{ runner.OS }}-pnpm-
## Build and test app start
- name: Install pnpm dependencies
run: npm install pnpm -g@8.6.6 && pnpm install
run: npm install [email protected] -g && pnpm install
- name: Gen SDK dependencie Code
run: pnpm rooch-sdk gen
- name: Lint
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ sdk/typescript/dist/
sdk/typescript/example/
sdk/typescript/src/generated/
rooch-portal-v1/script/nohup.out
*.out
17 changes: 9 additions & 8 deletions scripts/bitcoin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ This directory contains scripts for setting up a local development environment f

You can also configure the environment using the env script, use `./env -i`

1. Run `ord wallet create` to create a new ord wallet
2. Run `ord wallet receive` to get a new address to receive funds
3. Run `bitcoin-cli generatetoaddress 101 <address>` to generate 101 blocks to the address
4. Run `ord wallet balance` to check the balance of the wallet
5. Run `echo "{"p":"brc-20","op":"mint","tick":"Rooch","amt":"1"}">/tmp/hello.txt` to create a file
6. Run `ord wallet inscribe --fee-rate 1 --file /tmp/hello.txt --destination <address>` to inscribe the file to the blockchain
7. Run `bitcoin-cli generatetoaddress 1 <address>` to mine an inscription
8. Run `ord wallet inscriptions` to get the reveal transaction ID
1. Run `ord server` to start ord indexer server
2. Run `ord wallet create` to create a new ord wallet
3. Run `ord wallet receive` to get a new address to receive funds
4. Run `bitcoin-cli generatetoaddress 101 <address>` to generate 101 blocks to the address
5. Run `ord wallet balance` to check the balance of the wallet
6. Run `echo "{"p":"brc-20","op":"mint","tick":"Rooch","amt":"1"}">/tmp/hello.txt` to create a file
7. Run `ord wallet inscribe --fee-rate 1 --file /tmp/hello.txt --destination <address>` to inscribe the file to the blockchain
8. Run `bitcoin-cli generatetoaddress 1 <address>` to mine an inscription
9. Run `ord wallet inscriptions` to get the reveal transaction ID



Expand Down
2 changes: 1 addition & 1 deletion scripts/bitcoin/cmd_alias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# Copyright (c) RoochNetwork
# SPDX-License-Identifier: Apache-2.0

alias ord="ord --regtest --rpc-url http://127.0.0.1:18443 --bitcoin-rpc-user roochuser --bitcoin-rpc-pass roochpass"
alias ord="ord --regtest --bitcoin-rpc-url http://127.0.0.1:18443 --bitcoin-rpc-username roochuser --bitcoin-rpc-password roochpass"
alias bitcoin-cli="docker exec -it bitcoind bitcoin-cli -regtest"
28 changes: 23 additions & 5 deletions scripts/bitcoin/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
container_name="bitcoind"

ord() {
command ord --regtest --rpc-url http://127.0.0.1:18443 --bitcoin-rpc-user roochuser --bitcoin-rpc-pass roochpass "$@"
command ord --regtest --bitcoin-rpc-url http://127.0.0.1:18443 --bitcoin-rpc-username roochuser --bitcoin-rpc-password roochpass "$@"
}

bitcoin-cli() {
Expand All @@ -18,6 +18,7 @@ getBitcoinNode() {
}

init() {
# check bitcoin env
container_id=$(getBitcoinNode)
if [ -n "$container_id" ]; then
echo "Bitcoin node is already running."
Expand All @@ -41,35 +42,49 @@ init() {
done
fi

# start ord server
ord server &

sleep 5

# Step 1: Create a new ord wallet
ord wallet create

sleep 1

# Step 2: Get a new address to receive funds
address=$(ord wallet receive | jq -r '.address')
address=$(ord wallet receive | jq -r '.addresses[0]')
echo "You bitcoin address $address"

sleep 1

# Step 3: Generate 101 blocks to the address
bitcoin-cli generatetoaddress 101 $address > /dev/null 2>&1

sleep 3

# Step 4: Check the balance of the wallet
ord wallet balance

# Step 5: Create a file with specific content
echo '{"p":"brc-20","op":"mint","tick":"Rooch","amt":"1"}' > /tmp/hello.txt

# Step 6: Inscribe the file to the blockchain
ord wallet inscribe --fee-rate 1 --file /tmp/hello.txt --destination $address
ord wallet inscribe --fee-rate 1 --file /tmp/hello.txt --destination $address > /dev/null 2>&1

sleep 1

# Step 7: Mine an inscription with 1 block
bitcoin-cli generatetoaddress 1 $address
bitcoin-cli generatetoaddress 1 $address > /dev/null 2>&1

sleep 2

echo "You inscriptions"
# Step 8: Get the reveal transaction ID
ord wallet inscriptions

# Step 9: start rooch node
cargo run --package rooch --bin rooch server start --btc-rpc-url http://127.0.0.1:18443 --btc-rpc-username roochuser --btc-rpc-password roochpass --btc-start-block-height 0 --btc-network 4 --data-import-mode 10

}

clean() {
Expand All @@ -79,6 +94,9 @@ clean() {
rm "$indexPath"
fi

# stop ord server
lsof -ti:80 | xargs kill

# clean bitcoin docker
container_id=$(getBitcoinNode)
if [ -n "$container_id" ]; then
Expand Down

0 comments on commit d108246

Please sign in to comment.