Skip to content

Commit

Permalink
runtime 2200 (#806)
Browse files Browse the repository at this point in the history
* use mandala 2200

* fix img

* update

* update

* fix

* fix

* update

* updatre

* fix

* revert

* update

* update

* update
  • Loading branch information
shunjizhan authored Aug 16, 2023
1 parent d29e711 commit dbdf349
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 45 deletions.
25 changes: 13 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ services:
- 5432:5432
environment:
POSTGRES_PASSWORD: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 5s
retries: 100

subquery-node:
build:
Expand All @@ -19,7 +24,7 @@ services:
yarn-install:
condition: service_completed_successfully
postgres:
condition: service_started
condition: service_healthy
mandala-node:
condition: service_healthy
volumes:
Expand Down Expand Up @@ -48,7 +53,7 @@ services:
- 3001:3001
depends_on:
postgres:
condition: service_started
condition: service_healthy
subquery-node:
condition: service_started
restart: always
Expand Down Expand Up @@ -79,7 +84,7 @@ services:
yarn-install:
condition: service_completed_successfully
postgres:
condition: service_started
condition: service_healthy
subquery-node:
condition: service_started
graphql-engine:
Expand Down Expand Up @@ -112,22 +117,18 @@ services:
# ---------- No Subql Realm ---------- #
# ------------------------------------ #
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-a32c40b
image: ghcr.io/acalanetwork/mandala-node:sha-3267408
ports:
- 9933:9933
- 9944:9944
healthcheck:
test: "curl --fail -X POST -H \"Content-Type: application/json\" http://localhost:9933 -d \"{\"jsonrpc\": \"2.0\" }\" || exit 1"
interval: 10s
retries: 10
start_period: 30s
test: "curl --fail -X POST -H \"Content-Type: application/json\" http://localhost:9944 -d \"{\"jsonrpc\": \"2.0\" }\" || exit 1"
interval: 2s
retries: 100
start_period: 10s
command:
- --dev
# - -lruntime=debug
# - -levm=debug
- --ws-port=9944
- --ws-external
- --rpc-port=9933
- --rpc-external
- --rpc-cors=all
- --rpc-methods=unsafe
Expand Down
6 changes: 1 addition & 5 deletions examples/docker-compose-bodhi-stack.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
services:
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-a32c40b
image: ghcr.io/acalanetwork/mandala-node:sha-3267408
container_name: mandala-node
ports:
- 9944:9944
command:
- --dev
# - -lruntime=debug
- -levm=debug
- --ws-port=9944
- --ws-external
- --rpc-port=9933
- --rpc-external
- --rpc-cors=all
- --rpc-methods=unsafe
Expand Down
2 changes: 1 addition & 1 deletion examples/foundry/counter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ forge test
### to local mandala
1) first start a local mandala
```
docker run -it --rm -p 9944:9944 -p 9933:9933 ghcr.io/acalanetwork/mandala-node:sha-a32c40b --dev --ws-external --rpc-port=9933 --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-3267408 --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
```

2) then start an eth rpc adapter
Expand Down
2 changes: 1 addition & 1 deletion examples/waffle/arbitrager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ source.
If you prefer Docker, you need to run it and use the following command:

```
docker run -it --rm -p 9944:9944 -p 9933:9933 ghcr.io/acalanetwork/mandala-node:sha-a32c40b --dev --ws-external --rpc-port=9933 --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-3267408 --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
```

If you whish to build and run the local development network from source, you can clone the
Expand Down
4 changes: 2 additions & 2 deletions examples/waffle/scheduler/test/Scheduler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ describe('Schedule', () => {
expect((await erc20.balanceOf(recurringPayment.address)).toNumber()).to.equal(0);
if (!process.argv.includes('--with-ethereum-compatibility')) {
expect((await provider.getBalance(transferTo)).toString()).to.equal(
formatAmount('4_999_963_791_376_202_000_000')
formatAmount('4_999_969_004_075_107_000_000')
);

expect((await erc20.balanceOf(transferTo)).toString()).to.equal(formatAmount('4_999_963_791_376_202'));
expect((await erc20.balanceOf(transferTo)).toString()).to.equal(formatAmount('4_999_969_004_075_107'));
} else {
expect((await provider.getBalance(transferTo)).toString()).to.equal(dollar.mul(5000000000).toString());
expect((await erc20.balanceOf(transferTo)).toString()).to.equal(dollar.mul(5000).toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import dotenv from 'dotenv';

dotenv.config();

const ACALA_NODE_URL = 'wss://acala-rpc-1.aca-api.network';
const ACALA_NODE_URL = 'wss://acala-rpc.aca-api.network';
const ACALA_SUBQL = 'https://subql-query-acala.aca-api.network';

describe('connect random', () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/eth-providers/src/__tests__/e2e/parseBlock.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ describe.concurrent('getAllReceiptsAtBlock', () => {

beforeAll(async () => {
console.log('connecting to node...');
const KARURA_NODE_URL = 'wss://karura-rpc-1.aca-api.network';
const ACALA_NODE_URL = 'wss://acala-rpc-1.aca-api.network';
const KARURA_NODE_URL = 'wss://karura-rpc.aca-api.network';
const ACALA_NODE_URL = 'wss://acala-rpc.aca-api.network';

apiK = new ApiPromise(
options({
Expand Down
4 changes: 2 additions & 2 deletions packages/eth-providers/src/__tests__/e2e/tx.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('transaction tests', () => {
const validUntil = curBlockNum + 199;

expect((params.gasPrice as BigNumber).toNumber()).eq(100000000000 + validUntil);
expect((params.gasLimit as BigNumber).toNumber()).eq(200100);
expect((params.gasLimit as BigNumber).toNumber()).eq(100100);
});
});

Expand Down Expand Up @@ -140,7 +140,7 @@ describe('transaction tests', () => {
gasLimit: txGasLimit,
gasPrice: txGasPrice,
})
).rejects.toThrowError('ExistentialDeposit');
).rejects.toThrowError('execution error: Account cannot exist with the funds that would be given');
});
});

Expand Down
4 changes: 2 additions & 2 deletions packages/eth-rpc-adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A node service that provides [JSON-RPC](https://eth.wiki/json-rpc/API) for [Acal
## Run
First run a Mandala node locally
```
docker run -it --rm -p 9944:9944 -p 9933:9933 ghcr.io/acalanetwork/mandala-node:sha-a32c40b --dev --ws-external --rpc-port=9933 --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-3267408 --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
```

Then there are 3 ways to run an RPC adapter:
Expand All @@ -14,7 +14,7 @@ Then there are 3 ways to run an RPC adapter:

#### from docker
```
docker run -it --rm -e LOCAL_MODE=1 -p 8545:8545 acala/eth-rpc-adapter:v2.5.3 yarn start
docker run -it --rm -e LOCAL_MODE=1 -p 8545:8545 acala/eth-rpc-adapter:v2.7.6 yarn start
```
latest image can be found [here](https://hub.docker.com/r/acala/eth-rpc-adapter/tags)

Expand Down
5 changes: 1 addition & 4 deletions packages/eth-rpc-adapter/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ version: '3'

services:
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-a32c40b
image: ghcr.io/acalanetwork/mandala-node:sha-3267408
ports:
- 9944:9944
command:
- --dev
- -lruntime=debug
- -levm=debug
- --ws-port=9944
- --ws-external
- --rpc-port=9933
- --rpc-external
- --rpc-cors=all
- --rpc-methods=unsafe
Expand Down
8 changes: 4 additions & 4 deletions packages/eth-rpc-adapter/src/__tests__/e2e/endpoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('endpoint', () => {
from: ADDRESS_ALICE,
contractAddress: null,
transactionIndex: '0x0',
gasUsed: '0x1a8ea',
gasUsed: '0x1a8a4',
logsBloom: DUMMY_LOGS_BLOOM,
blockHash: txR.blockHash,
transactionHash: txR.transactionHash,
Expand Down Expand Up @@ -198,7 +198,7 @@ describe('endpoint', () => {
from: ADDRESS_ALICE,
contractAddress: null,
transactionIndex: '0x0',
gasUsed: '0x1f66d',
gasUsed: '0x1f615',
logsBloom: DUMMY_LOGS_BLOOM,
blockHash: txR.blockHash,
transactionHash: txR.transactionHash,
Expand Down Expand Up @@ -231,7 +231,7 @@ describe('endpoint', () => {
from: ADDRESS_ALICE,
contractAddress: null,
transactionIndex: '0x0',
gasUsed: '0x1a919',
gasUsed: '0x1a8d3',
logsBloom: DUMMY_LOGS_BLOOM,
blockHash: txR.blockHash,
transactionHash: txR.transactionHash,
Expand Down Expand Up @@ -1381,7 +1381,7 @@ describe('endpoint', () => {

describe('eth_getBalance', () => {
it('get correct balance', async () => {
const block8Balance = 8999994511087564473000000n; // edit me for different mandala version
const block8Balance = 8999995192389995117000000n; // edit me for different mandala version
expect(BigInt((await eth_getBalance([ADDRESS_ALICE, 8])).data.result)).to.equal(block8Balance);
expect(BigInt((await eth_getBalance([ADDRESS_ALICE, '0x8'])).data.result)).to.equal(block8Balance);
expect(BigInt((await eth_getBalance([ADDRESS_ALICE, { blockNumber: 8 }])).data.result)).to.equal(block8Balance);
Expand Down
2 changes: 1 addition & 1 deletion packages/evm-subql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ npm i -g @subql/[email protected] @subql/[email protected]
If you already have a node running elsewhere, you can skip this step.

```shell
docker run -it --rm -p 9944:9944 -p 9933:9933 ghcr.io/acalanetwork/mandala-node:sha-a32c40b --dev --ws-external --rpc-port=9933 --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-3267408 --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive --instant-sealing
```

3. Run a Postgres service and listen to port number 5432 (in the second terminal)
Expand Down
8 changes: 2 additions & 6 deletions packages/evm-subql/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@ version: '3.9'

services:
mandala-node:
image: ghcr.io/acalanetwork/mandala-node:sha-a32c40b
image: ghcr.io/acalanetwork/mandala-node:sha-3267408
ports:
- 9933:9933
- 9944:9944
healthcheck:
test: "curl --fail -X POST -H \"Content-Type: application/json\" http://localhost:9933 -d \"{\"jsonrpc\": \"2.0\" }\" || exit 1"
test: "curl --fail -X POST -H \"Content-Type: application/json\" http://localhost:9944 -d \"{\"jsonrpc\": \"2.0\" }\" || exit 1"
interval: 10s
retries: 10
start_period: 30s
command:
- --dev
- -lruntime=debug
- -levm=debug
- --ws-port=9944
- --ws-external
- --rpc-port=9933
- --rpc-external
- --rpc-cors=all
- --rpc-methods=unsafe
Expand Down
2 changes: 1 addition & 1 deletion packages/evm-subql/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ schema:
file: ./schema.graphql
network:
# local mandala
chainId: '0xa547d06d0a044a5e3c319941fd033a88f2d3e8e1eab2c2f0f7c3d8b8dac23d6c'
chainId: '0x7daefd150ede207e8a1195cd2696c836f5cf79442827fa2d26a447123615fcfa'
endpoint: ws://localhost:9944
chaintypes:
# TODO: can generate this dynamically with `yarn build` using `@acala-network/types`
Expand Down
2 changes: 1 addition & 1 deletion scripts/new-rpc-benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# New Eth RPC Benchmark
first start a local mandala with normal sealing
```
docker run -it --rm -p 9944:9944 -p 9933:9933 ghcr.io/acalanetwork/mandala-node:sha-a32c40b --dev --ws-external --rpc-port=9933 --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive
docker run -it --rm -p 9944:9944 ghcr.io/acalanetwork/mandala-node:sha-3267408 --dev --rpc-external --rpc-cors=all --rpc-methods=unsafe -levm=debug --pruning=archive
```

then start an old rpc adapter
Expand Down

0 comments on commit dbdf349

Please sign in to comment.