Skip to content

Commit

Permalink
fix: Consistently name Docker container secretdev. sudo required for …
Browse files Browse the repository at this point in the history
…docker cp
  • Loading branch information
ltfschoen committed Dec 15, 2024
1 parent 87bc944 commit 539d327
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 17 deletions.
36 changes: 27 additions & 9 deletions _SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ ssh [email protected]
* Start Localhost server with chain-id `secretdev-1`

```bash
docker stop localsecret && docker rm localsecret
docker stop secretdev && docker rm secretdev
docker run -it --rm \
-p 9091:9091 -p 26657:26657 -p 26656:26656 -p 1317:1317 -p 5000:5000 \
-v $(pwd):/root/code \
--name localsecret ghcr.io/scrtlabs/localsecret:latest
--name secretdev ghcr.io/scrtlabs/localsecret:latest
```

* Ports:
Expand Down Expand Up @@ -274,7 +274,12 @@ cd packages/secret-contracts/secret-gateway
git submodule update --init --recursive
```

* [Compile](https://docs.scrt.network/secret-network-documentation/development/readme-1/compile-and-deploy#compile-the-code). Note: Outputs contract.wasm or contract.wasm.gz file in the root directory being the ./SecretPath/TNLS-Gateways/secret/ folder. Using `make build-mainnet-reproducible` will remove contract.wasm so only the optimised contract.wasm.gz remains. Warning: If you only run `make build-mainnet` then you will get this error https://github.com/svub/nunya/issues/8 when deploying.
* Terminal Tab 1: Secret Localhost (Localsecret)
```
make start-server
```

* Terminal Tab 2: [Compile](https://docs.scrt.network/secret-network-documentation/development/readme-1/compile-and-deploy#compile-the-code). Note: Outputs contract.wasm or contract.wasm.gz file in the root directory being the ./SecretPath/TNLS-Gateways/secret/ folder. Using `make build-mainnet-reproducible` will remove contract.wasm so only the optimised contract.wasm.gz remains. Warning: If you only run `make build-mainnet` then you will get this error https://github.com/svub/nunya/issues/8 when deploying.

* Secret Gateway Contract
```
Expand All @@ -292,7 +297,7 @@ git submodule update --init --recursive
* https://github.com/CosmWasm/cosmwasm/blob/main/contracts/cyberpunk/tests/integration.rs#L126
* TODO: For Production on mainnet, configure it to use a debug-print or debug_print with a custom feature flag and wrap use of `set_debug_handler` with it so debug logs aren't output in production.
* Note: Use existing localsecret Docker container that is running already.
* Note: Use existing secretdev Docker container that is running already.
* Copy compiled Secret Gateway contract to the Docker container
```
Expand All @@ -304,8 +309,6 @@ git submodule update --init --recursive
make store-secret-gateway-contract-local
```
* TODO
###### Deploy Relayer of SecretPath on Localhost
* Reference: https://docs.scrt.network/secret-network-documentation/confidential-computing-layer/ethereum-evm-developer-toolkit/basics/cross-chain-messaging/secretpath/how-to-deploy-secretpath-on-your-chain
Expand Down Expand Up @@ -520,16 +523,18 @@ git submodule update --init --recursive
#### Configure
##### Deploy Nunya Contract on Localhost
* Open file ./nunya/packages/secret-contracts-scripts/src/config/deploy.ts
* Check ./nunya/packages/secret-contracts-scripts/.env has been created from the .env-sample file
* Reference: https://docs.scrt.network/secret-network-documentation/development/example-contracts/tools-and-libraries/local-secret#advantages-of-localsecret-vs.-a-public-testnet
##### Testnet
###### Testnet
* Edit config.secret.network to be "testnet"
##### Localhost
###### Localhost
* Edit config.secret.network to be "localhost"
* Ensure `ENDPOINT_LOCAL` is set to where you are running the Secret Localhost (e.g. `http://<IP_ADDRESS>:1317`)
Expand Down Expand Up @@ -559,6 +564,8 @@ docker rmi sco
* [Compile](https://docs.scrt.network/secret-network-documentation/development/readme-1/compile-and-deploy#compile-the-code). Note: Outputs contract.wasm and contract.wasm.gz file in the root directory of the secret-contracts/nunya-contract folder. Using `make build-mainnet-reproducible` will remove contract.wasm so only the optimised contract.wasm.gz remains. Warning: If you only run `make build-mainnet` then you will get this error https://github.com/svub/nunya/issues/8 when deploying.
###### Testnet
* Nunya Contract
```
cd packages/secret-contracts/nunya-contract
Expand All @@ -575,6 +582,15 @@ docker rmi sco
make build-mainnet-reproducible
```
###### Localhost
* Nunya Contract
```
cd packages/secret-contracts/nunya-contract
make clean
make build
```
##### Deploy (Upload and Instantiate)
###### Testnet
Expand Down Expand Up @@ -622,13 +638,15 @@ yarn run secret:instantiate
###### Localhost
* Note: Only run `make start-server if necessary
```bash
make clean
make start-server
make copy-nunya-contract-local
make store-nunya-contract-local
```

* TODO: How to configure the Secret Gateway in Nunya Secret Contract?

#### Interact with Deployed Secret Contract via Deployed EVM Gateway to `requestValue` <a id="request-value"></a>

##### Testnet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# Service containers to run with `container-job`
services:
# Label used to access the service container
secret:
secretdev:
# Docker Hub image
image: ghcr.io/scrtlabs/localsecret:v1.6.0-rc.3
ports:
Expand Down
4 changes: 2 additions & 2 deletions packages/secret-contracts/nunya-contract/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ start-server: # CTRL+C to stop

.PHONY: copy-nunya-contract-local
copy-nunya--contract-local:
docker cp contract.wasm secretdev:/root/code/contract.wasm
docker cp contract.wasm.gz secretdev:/root/code/contract.wasm.gz
sudo docker cp contract.wasm secretdev:/root/code/contract.wasm
sudo docker cp contract.wasm.gz secretdev:/root/code/contract.wasm.gz

# This relies on running `start-server` in another console
# You can run other commands on the secretcli inside the dev image
Expand Down
6 changes: 3 additions & 3 deletions packages/secret-contracts/secret-gateway/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ start-server: # CTRL+C to stop
docker run -it --rm \
-p 9091:9091 -p 26657:26657 -p 26656:26656 -p 1317:1317 -p 5000:5000 \
-v $$(pwd):/root/code \
--name localsecret ghcr.io/scrtlabs/localsecret:v1.6.0-rc.3
--name secretdev ghcr.io/scrtlabs/localsecret:v1.6.0-rc.3

.PHONY: copy-secret-gateway-contract-local
copy-secret-gateway-contract-local:
docker cp secret-gateway-contract.wasm secretdev:/root/code/secret-gateway-contract.wasm
docker cp secret-gateway-contract.wasm.gz secretdev:/root/code/secret-gateway-contract.wasm.gz
sudo docker cp secret-gateway-contract.wasm secretdev:/root/code/secret-gateway-contract.wasm
sudo docker cp secret-gateway-contract.wasm.gz secretdev:/root/code/secret-gateway-contract.wasm.gz

# This relies on running `start-server` in another console
# You can run other commands on the secretcli inside the dev image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ schema:
.PHONY: start-server
start-server: # CTRL+C to stop
docker run -it --rm \
-p 26657:26657 -p 26656:26656 -p 1317:1317 -p 5000:5000 \
-p 9091:9091 -p 26657:26657 -p 26656:26656 -p 1317:1317 -p 5000:5000 \
-v $$(pwd):/root/code \
--name localsecret ghcr.io/scrtlabs/localsecret:1.3.1
--name secretdev ghcr.io/scrtlabs/localsecret:v1.6.0-rc.3

# This relies on running `start-server` in another console
# You can run other commands on the secretcli inside the dev image
Expand Down

0 comments on commit 539d327

Please sign in to comment.