diff --git a/.github/actions/private-tangle/setup/action.yml b/.github/actions/iota-sandbox/setup/action.yml similarity index 62% rename from .github/actions/private-tangle/setup/action.yml rename to .github/actions/iota-sandbox/setup/action.yml index 3d6feab379..f0e60b2d75 100644 --- a/.github/actions/private-tangle/setup/action.yml +++ b/.github/actions/iota-sandbox/setup/action.yml @@ -1,9 +1,9 @@ -name: 'private-tangle-setup' -description: 'Setup a private tangle' +name: 'iota-sandbox-setup' +description: 'Setup IOTA Sandbox' runs: using: "composite" steps: - - name: Setup private tangle + - name: Setup iota sandbox shell: bash run: | # TODO: use next lines when a working hornet release is published @@ -17,28 +17,27 @@ runs: # tar -xf private_tangle.tar.gz # TODO: remove next lines when a working hornet release is published - git clone https://github.com/iotaledger/hornet.git - cd hornet/private_tangle + git clone https://github.com/iotaledger/iota-sandbox + cd iota-sandbox/sandbox - # Set minPoWScore = 1 since the default (0) doesn't work with wasm_miner.rs in iota.rs currently. - jq '.minPoWScore = $val' --argjson val 1 protocol_parameters.json > tmp.json && mv tmp.json protocol_parameters.json - jq --color-output . protocol_parameters.json + # # Set minPoWScore = 1 since the default (0) doesn't work with wasm_miner.rs in iota.rs currently. + # jq '.minPoWScore = $val' --argjson val 1 protocol_parameters.json > tmp.json && mv tmp.json protocol_parameters.json + # jq --color-output . protocol_parameters.json - # Manipulate and print config - jq '.restAPI.pow.enabled = $newVal' --argjson newVal true config_private_tangle.json > tmp.$$.json && mv tmp.$$.json config_private_tangle.json - jq --color-output . config_private_tangle.json + # # Manipulate and print config + # jq '.restAPI.pow.enabled = $newVal' --argjson newVal true config_private_tangle.json > tmp.$$.json && mv tmp.$$.json config_private_tangle.json + # jq --color-output . config_private_tangle.json # Start Tangle - sudo ./cleanup.sh sudo ./bootstrap.sh - sudo ./run.sh -d + docker compose up -d - name: Wait for tangle to start shell: bash - run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost:14265/health -- echo "Tangle is up" + run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost/health -- echo "Tangle is up" env: WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7 # v2.2.3 - name: Wait for faucet to start shell: bash - run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost:8091/api/info -- echo "Faucet is up" + run: wget -qO- https://raw.githubusercontent.com/eficode/wait-for/$WAIT_FOR_VERSION/wait-for | sh -s -- -t 60 http://localhost/faucet/api/info -- echo "Faucet is up" env: WAIT_FOR_VERSION: 4df3f9262d84cab0039c07bf861045fbb3c20ab7 # v2.2.3 diff --git a/.github/actions/private-tangle/tear-down/action.yml b/.github/actions/iota-sandbox/tear-down/action.yml similarity index 62% rename from .github/actions/private-tangle/tear-down/action.yml rename to .github/actions/iota-sandbox/tear-down/action.yml index bfd73f46ff..bc31780597 100644 --- a/.github/actions/private-tangle/tear-down/action.yml +++ b/.github/actions/iota-sandbox/tear-down/action.yml @@ -1,16 +1,16 @@ -name: 'private-tangle-tear-down' -description: 'tear-down a private tangle' +name: 'iota-sandbox-tear-down' +description: 'tear-down a iota sandbox' runs: using: "composite" steps: - - name: Tear down private tangle + - name: Tear down iota sandbox shell: bash run: | # TODO: use next line when a working hornet release is published #cd private_tangle # TODO: remove next line when a working hornet release is published - cd hornet/private_tangle + cd iota-sandbox/sandbox docker-compose down cd .. - sudo rm -rf private_tangle + sudo rm -rf iota-sandbox diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 27ded3b745..d60c351e6c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -123,9 +123,9 @@ jobs: - name: Build with all features run: cargo build --workspace --tests --examples --all-features --release - - name: Start private tangle + - name: Start iota sandbox if: matrix.os == 'ubuntu-latest' - uses: './.github/actions/private-tangle/setup' + uses: './.github/actions/iota-sandbox/setup' - name: Run tests run: cargo test --workspace --all-features --release @@ -148,9 +148,9 @@ jobs: npm ci npm run test:readme:rust - - name: Tear down private tangle + - name: Tear down iota sandbox if: matrix.os == 'ubuntu-latest' && always() - uses: './.github/actions/private-tangle/tear-down' + uses: './.github/actions/iota-sandbox/tear-down' - name: Stop sccache uses: './.github/actions/rust/sccache/stop-sccache' @@ -194,13 +194,13 @@ jobs: name: identity-wasm-bindings-build path: bindings/wasm - - name: Start private tangle - uses: './.github/actions/private-tangle/setup' + - name: Start iota sandbox + uses: './.github/actions/iota-sandbox/setup' - name: Run Wasm examples run: npm run test:examples working-directory: bindings/wasm - - name: Tear down private tangle + - name: Tear down iota sandbox if: always() - uses: './.github/actions/private-tangle/tear-down' + uses: './.github/actions/iota-sandbox/tear-down' diff --git a/bindings/wasm/README.md b/bindings/wasm/README.md index f3b854fa37..f1d93f9b98 100644 --- a/bindings/wasm/README.md +++ b/bindings/wasm/README.md @@ -81,7 +81,7 @@ const EXAMPLE_JWK = new Jwk({ }); // The endpoint of the IOTA node to use. -const API_ENDPOINT = "http://127.0.0.1:14265"; +const API_ENDPOINT = "http://localhost"; /** Demonstrate how to create a DID Document. */ async function main() { diff --git a/bindings/wasm/examples/src/util.ts b/bindings/wasm/examples/src/util.ts index 41a0a5a7ee..3fc2be116e 100644 --- a/bindings/wasm/examples/src/util.ts +++ b/bindings/wasm/examples/src/util.ts @@ -16,8 +16,8 @@ import { Utils, } from "@iota/sdk-wasm/node"; -export const API_ENDPOINT = "http://localhost:14265"; -export const FAUCET_ENDPOINT = "http://localhost:8091/api/enqueue"; +export const API_ENDPOINT = "http://localhost"; +export const FAUCET_ENDPOINT = "http://localhost/faucet/api/enqueue"; /** Creates a DID Document and publishes it in a new Alias Output. diff --git a/examples/0_basic/0_create_did.rs b/examples/0_basic/0_create_did.rs index 03f64353fc..61f157cb37 100644 --- a/examples/0_basic/0_create_did.rs +++ b/examples/0_basic/0_create_did.rs @@ -30,10 +30,10 @@ use iota_sdk::types::block::output::AliasOutput; #[tokio::main] async fn main() -> anyhow::Result<()> { // The API endpoint of an IOTA node, e.g. Hornet. - let api_endpoint: &str = "http://127.0.0.1:14265"; + let api_endpoint: &str = "http://localhost"; // The faucet endpoint allows requesting funds for testing purposes. - let faucet_endpoint: &str = "http://127.0.0.1:8091/api/enqueue"; + let faucet_endpoint: &str = "http://localhost/faucet/api/enqueue"; // Create a new client to interact with the IOTA ledger. let client: Client = Client::builder() diff --git a/examples/utils/utils.rs b/examples/utils/utils.rs index a9b8ca5154..a79a74312e 100644 --- a/examples/utils/utils.rs +++ b/examples/utils/utils.rs @@ -28,8 +28,8 @@ use iota_sdk::types::block::address::Hrp; use rand::distributions::DistString; use serde_json::Value; -pub static API_ENDPOINT: &str = "http://localhost:14265"; -pub static FAUCET_ENDPOINT: &str = "http://localhost:8091/api/enqueue"; +pub static API_ENDPOINT: &str = "http://localhost"; +pub static FAUCET_ENDPOINT: &str = "http://localhost/faucet/api/enqueue"; pub type MemStorage = Storage;