Skip to content

Commit

Permalink
fixup! wip
Browse files Browse the repository at this point in the history
  • Loading branch information
endersonmaia committed Oct 30, 2024
1 parent 1ea170a commit 04cba2b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 45 deletions.
13 changes: 0 additions & 13 deletions apps/cli/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,6 @@ export default class Run extends BaseCommand<typeof Run> {
CARTESI_LISTEN_PORT: listenPort.toString(),
CARTESI_VALIDATOR_CPUS: flags.cpus?.toString(),
CARTESI_VALIDATOR_MEMORY: flags.memory?.toString(),
CARTESI_POSTGRES_ENDPOINT:
"postgres://postgres:password@database:5432/postgres?sslmode=disable",
CARTESI_BLOCKCHAIN_HTTP_ENDPOINT: "http://anvil:8545",
CARTESI_BLOCKCHAIN_WS_ENDPOINT: "ws://anvil:8545",
CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:
"0x593E5BCf894D6829Dd26D0810DA7F064406aebB6",
CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER: "7",
CARTESI_AUTH_MNEMONIC:
"test test test test test test test test test test test junk",
CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS:
"0x1d4CfBD2622d802A07CeB4C3401Bbb455c9dbdC3",
CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS:
"0xB897F7Fe78f220aE34B7FA9493092701a873Ed45",
};

// validator
Expand Down
16 changes: 9 additions & 7 deletions apps/cli/src/node/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,27 @@ CARTESI_EVM_READER_RETRY_POLICY_MAX_DELAY="${CARTESI_EVM_READER_RETRY_POLICY_MAX

# blockchain
CARTESI_BLOCKCHAIN_ID="${CARTESI_BLOCKCHAIN_ID:-31337}"
CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="http://anvil:8545"
CARTESI_BLOCKCHAIN_WS_ENDPOINT="ws://anvil:8545"
CARTESI_BLOCKCHAIN_HTTP_ENDPOINT="${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT:-http://anvil:8545}"
CARTESI_BLOCKCHAIN_WS_ENDPOINT="${CARTESI_BLOCKCHAIN_WS_ENDPOINT:-ws://anvil:8545}"
CARTESI_LEGACY_BLOCKCHAIN_ENABLED="${CARTESI_LEGACY_BLOCKCHAIN_ENABLED:-false}"
CARTESI_BLOCKCHAIN_FINALITY_OFFSET="${CARTESI_BLOCKCHAIN_FINALITY_OFFSET:-0}"
CARTESI_EVM_READER_DEFAULT_BLOCK="${CARTESI_EVM_READER_DEFAULT_BLOCK:-latest}"
CARTESI_BLOCKCHAIN_BLOCK_TIMEOUT="${CARTESI_BLOCKCHAIN_BLOCK_TIMEOUT:-60}"

#contracts
CARTESI_CONTRACTS_INPUT_BOX_ADDRESS="0x593E5BCf894D6829Dd26D0810DA7F064406aebB6"
CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER="7"
CARTESI_CONTRACTS_INPUT_BOX_ADDRESS="${CARTESI_CONTRACTS_INPUT_BOX_ADDRESS:-0x593E5BCf894D6829Dd26D0810DA7F064406aebB6}"
CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER="${CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER:-7}"
CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS="${CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS:-0x1d4CfBD2622d802A07CeB4C3401Bbb455c9dbdC3}"
CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS="${CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS:-0xB897F7Fe78f220aE34B7FA9493092701a873Ed45}"

# snapshot
CARTESI_SNAPSHOT_DIR="/usr/share/rollups-node/snapshot"
CARTESI_SNAPSHOT_DIR="${CARTESI_SNAPSHOT_DIR:-/usr/share/rollups-node/snapshot}"

# auth
CARTESI_AUTH_MNEMONIC="test test test test test test test test test test test junk"
CARTESI_AUTH_MNEMONIC="${CARTESI_AUTH_MNEMONIC:-test test test test test test test test test test test junk}"

# postgres
CARTESI_POSTGRES_ENDPOINT="postgres://postgres:password@database:5432/postgres?sslmode=disable"
CARTESI_POSTGRES_ENDPOINT="${CARTESI_POSTGRES_ENDPOINT:-postgres://postgres:password@database:5432/postgres?sslmode=disable}"

# http
CARTESI_HTTP_ADDRESS="${CARTESI_HTTP_ADDRESS:-0.0.0.0}"
Expand Down
39 changes: 15 additions & 24 deletions apps/cli/src/node/docker-compose-anvil.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,21 @@ services:
env_file:
- ${CARTESI_BIN_PATH}/node/default.env
command:
[
"cartesi-rollups-cli",
"app",
"deploy",
"--print-json",
"--postgres-endpoint",
"${CARTESI_POSTGRES_ENDPOINT}",
"--rpc-url",
"${CARTESI_BLOCKCHAIN_HTTP_ENDPOINT}",
"--inputbox-block-number",
"${CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER}",
"--mnemonic",
"${CARTESI_AUTH_MNEMONIC}",
"--epoch-length",
"${CARTESI_EPOCH_LENGTH}",
"--app-factory",
"${CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS}",
"--authority-factory",
"${CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS}",
"--app-owner",
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"--template-path",
"${CARTESI_SNAPSHOT_DIR}",
]
- /bin/bash
- -c
- -x
- |
cartesi-rollups-cli app deploy \
--print-json \
--postgres-endpoint "$$CARTESI_POSTGRES_ENDPOINT" \
--rpc-url "$$CARTESI_BLOCKCHAIN_HTTP_ENDPOINT" \
--inputbox-block-number "$$CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER" \
--mnemonic "$$CARTESI_AUTH_MNEMONIC" \
--epoch-length "$$CARTESI_EPOCH_LENGTH" \
--app-factory "$$CARTESI_CONTRACTS_APPLICATION_FACTORY_ADDRESS" \
--authority-factory "$$CARTESI_CONTRACTS_AUTHORITY_FACTORY_ADDRESS" \
--app-owner "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" \
--template-path $$CARTESI_SNAPSHOT_DIR
prompt:
image: debian:bookworm-slim
Expand Down
8 changes: 7 additions & 1 deletion apps/cli/src/node/docker-compose-database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ services:

migration:
image: cartesi/rollups-node:devel
command: cartesi-rollups-cli db upgrade -p ${CARTESI_POSTGRES_ENDPOINT}
command:
- /bin/bash
- -c
- -x
- |
cartesi-rollups-cli db upgrade -p "$$CARTESI_POSTGRES_ENDPOINT"
depends_on:
database:
condition: service_healthy
Expand Down

0 comments on commit 04cba2b

Please sign in to comment.