Skip to content

Commit

Permalink
update for new deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
willemolding committed Jun 3, 2024
1 parent 16426cb commit 1fe6b9f
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 11 deletions.
61 changes: 61 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Instructions for deployment

## Non CI Deployment

### on-chain deployment

Build the machine docker file and deploy to fly.io image registry

```shell
cartesi build
export IMAGE_TAG=$(cartesi deploy build --platform linux/amd64 | grep "Application node Docker image" | awk '{print $NF}')
docker tag $IMAGE_TAG registry.fly.io/cartezcash:latest
docker push registry.fly.io/cartezcash:latest
```

Take note of the machine/template hash.

Next visit https://sunodo.io/deploy and use the helper to deploy the on-chain component to Sepolia

Copy the ENV vars from the fly.toml produced and past them into the fly.toml in the repo.

### Node deployment

Clear the database if it exists already by running

```shell
fly postgres connect -a cartezcash-database
```

and then in the database shell run

```sql
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;

GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
```

Finally run

```shell
fly deploy
```

### Fullnode deployment

Update the DAPP_ADDRESS in the fly.fullnode.toml

Build and deploy the fullnode in one step by running

```shell
fly deploy --config fly.fullnode.toml
fly restart cartezcash-fullnode
```

### Bridge UI deployment

Update the dApp address in the [config.json](./bridge-frontend/src/config.json) then commit the changes and push to main.

Run the Deploy bridge Github Pages action.
2 changes: 1 addition & 1 deletion bridge-frontend/src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"Erc721PortalAddress":"0x237F8DD094C0e47f4236f12b4Fa01d6Dae89fb87",
"Erc1155SinglePortalAddress":"0x7CFB0193Ca87eB6e48056885E026552c3A941FC4",
"Erc1155BatchPortalAddress":"0xedB53860A6B52bbb7561Ad596416ee9965B055Aa",
"DAppAddress": "0x02370C5B1217b3E80b18132403DE02ee6240e07C"
"DAppAddress": "0x0861329Be3032DA84cf56Dd08ca4CE5b13206a60"
}
}
2 changes: 1 addition & 1 deletion fly.fullnode.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ ROLLUP_HTTP_SERVER_URL="http://cartezcash.internal:10000/graphql"
ETH_CHAIN_ID="11155111"
INPUTBOX_CONTRACT_ADDRESS="0x59b22D57D4f067708AB0c00552767405926dc768"
ETH_RPC_URL="https://sepolia.infura.io/v3/ccfd148140454f7abb2664d0d13ea381"
DAPP_ADDRESS = "0x02370C5B1217b3E80b18132403DE02ee6240e07C"
DAPP_ADDRESS = "0x0861329Be3032DA84cf56Dd08ca4CE5b13206a60"
ETH_DEPOSIT_ADDR="0xFfdbe43d4c855BF7e0f105c400A50857f53AB044"
11 changes: 5 additions & 6 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
app = "cartezcash"

[build]
# image = "registry.fly.io/cartezcash:latest"
dockerfile = "./Dockerfile"
image = "registry.fly.io/cartezcash:latest"

[http_service]
internal_port = 10000
Expand All @@ -27,10 +26,10 @@ memory = "2gb"
[env]
CARTESI_BLOCKCHAIN_FINALITY_OFFSET = "1"
CARTESI_BLOCKCHAIN_ID = "11155111"
CARTESI_CONTRACTS_APPLICATION_ADDRESS = "0x02370C5B1217b3E80b18132403DE02ee6240e07C"
CARTESI_CONTRACTS_APPLICATION_DEPLOYMENT_BLOCK_NUMBER = "5958307"
CARTESI_CONTRACTS_AUTHORITY_ADDRESS = "0x9c19314C56238e28107A4122fc536D977a1986C6"
CARTESI_CONTRACTS_HISTORY_ADDRESS = "0x0cD956B572379DA203D5eEe85f6D17bA3EbF9625"
CARTESI_CONTRACTS_APPLICATION_ADDRESS = "0x0861329Be3032DA84cf56Dd08ca4CE5b13206a60"
CARTESI_CONTRACTS_APPLICATION_DEPLOYMENT_BLOCK_NUMBER = "6029967"
CARTESI_CONTRACTS_AUTHORITY_ADDRESS = "0x8afa60157596846264e78f790FB69211BD96b2Ee"
CARTESI_CONTRACTS_HISTORY_ADDRESS = "0x5caaeD1f8BD456C8097BE0Db8780009322B86428"
CARTESI_CONTRACTS_INPUT_BOX_ADDRESS = "0x59b22D57D4f067708AB0c00552767405926dc768"
CARTESI_CONTRACTS_INPUT_BOX_DEPLOYMENT_BLOCK_NUMBER = "3963384"
CARTESI_EPOCH_DURATION = "86400"
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ send-address:
##### wallet related commands

install-wallet:
cargo install --git https://github.com/willemolding/zingolib --branch willem/tinycash-desktop --bin zingo-cli
cargo install --force --git https://github.com/willemolding/zingolib --branch willem/tinycash-desktop --bin zingo-cli

## Do not use these wallets on mainnet!

Expand Down
3 changes: 1 addition & 2 deletions src/service/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl TryFrom<(tower_cartesi::AdvanceStateMetadata, Vec<u8>)> for Request {
to: dest_t_address,
})
}
INBOX_CONTRACT_ADDR => {
_ => { // If it is unrecognised then assume it is an inputBox message. This gets around a suspected bug
/* Encoding
abi.encodePacked(
transaction bytes // arbitrary size
Expand All @@ -73,7 +73,6 @@ impl TryFrom<(tower_cartesi::AdvanceStateMetadata, Vec<u8>)> for Request {

Ok(Request::Transact { txn })
}
_ => anyhow::bail!("unrecognised sender {}", metadata.msg_sender.to_string()),
}
}
}
Expand Down

0 comments on commit 1fe6b9f

Please sign in to comment.