diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..5f2ecb6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,53 @@ +--- +name: Bug report +about: Report a defect in interchain-kit +labels: bug +--- + +## Description + + + +## Steps to reproduce + + + +1. +2. +3. + +## Expected behavior + + + +## Actual behavior + + + +## Environment + +- OS / arch: +- Node version (`node -v`): +- pnpm version (`pnpm -v`): +- `avalanchego` commit / version (`avalanchego --version`): +- Foundry version (`forge --version`): +- interchain-kit commit (`git rev-parse HEAD`): + +## Logs + + + +## Additional context + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..b8324bd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an improvement or new capability for interchain-kit +labels: enhancement +--- + +## Problem + + + +## Proposed solution + + + +## Alternatives considered + + + +## Additional context + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..4780a4d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ +## Summary + + + +## What changed + + + +- +- + +## How to verify + + + +```sh +pnpm install +pnpm test:harness +``` + +## Linked issues + + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..aa18305 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,67 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test-contracts: + name: Foundry tests + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: stable + + - name: Install forge dependencies + working-directory: contracts + run: | + # `forge install --no-git` strips .git, which breaks recursive submodule + # init inside icm-contracts (it depends on subnet-evm as a git submodule). + # Clone deps directly with --recurse-submodules instead. + mkdir -p lib + git clone --depth 1 --branch v1.9.4 --recurse-submodules \ + https://github.com/foundry-rs/forge-std.git lib/forge-std + git clone --depth 1 --branch v5.0.2 --recurse-submodules \ + https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable.git lib/openzeppelin-contracts-upgradeable + git clone --depth 1 --branch v1.0.9 --recurse-submodules \ + https://github.com/ava-labs/icm-contracts.git lib/icm-contracts + + - name: Check formatting + run: forge fmt --check --root contracts + + - name: Run tests + run: forge test --root contracts -vv + + typecheck-ts: + name: TypeScript build & typecheck + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.12.0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build packages + run: pnpm -r --filter './packages/**' build + + - name: Typecheck examples + run: pnpm --filter @interchain-kit/examples typecheck diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..f698820 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,83 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [security@avalabs.org](mailto:security@avalabs.org). All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fe9feae --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,43 @@ +# Contributing to interchain-kit + +Thanks for your interest in improving interchain-kit. This kit boots a local Avalanche network with ICM, ICTT, the validator manager, an icm-relayer, and a signature aggregator — contributions that make those flows faster, clearer, or more reliable are very welcome. + +## Prerequisites + +See the [Prerequisites section in the README](./README.md#prerequisites) for the full toolchain (Node 20+, pnpm 9+, Foundry, an `avalanchego` binary, etc.). Please don't open a PR until you can run the harness locally. + +## Development + +```sh +pnpm install +pnpm test:harness # boots the local network and runs the end-to-end flows +pnpm up # bring the network up for manual exploration +``` + +If you're touching Solidity, run `forge build` and `forge test` from the relevant contracts package. + +## Issues + +### Security + +**Do not** open a public GitHub issue for a security vulnerability. Follow the process in [SECURITY.md](./SECURITY.md) instead. + +### Bugs and features + +- Search [existing issues](https://github.com/ava-labs/interchain-kit/issues) before filing a new one. +- For bugs, use the bug report template and include logs plus your environment (OS, Node, pnpm, `avalanchego` commit, Foundry version). +- For non-trivial features, open an issue first to align on scope before writing code. + +## Pull requests + +- Target the `main` branch. +- Branch naming: `docs/`, `feature/`, `fix/`, or `refactor/` followed by a short slug (e.g. `feature/ictt-erc20-flow`). +- All commits must be [GPG-signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits). Do not bypass signing or commit hooks. +- Keep PRs focused. One logical change per PR makes review and bisecting much easier. +- Update or add tests for behavior you change. The harness flows are the source of truth for end-to-end behavior. +- Fill out the PR template — Summary, What changed, How to verify, Linked issues. +- Draft PRs are welcome for early feedback. + +## Questions + +For usage questions, prefer [GitHub Discussions](https://github.com/ava-labs/interchain-kit/discussions) over issues. diff --git a/README.md b/README.md index c2f3c2a..d5ef7ae 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,17 @@ examples/ End-to-end demos against the live network - **Node 20+** and **pnpm 9+** - **Foundry** (`forge`) -- An **avalanchego** binary. Easiest: clone `ava-labs/avalanchego`, `./scripts/build.sh`, then build the bundled subnet-evm plugin: `cd graft/subnet-evm && ./scripts/build.sh` (symlinks into `/build/plugins/`). +- An **avalanchego** binary, built with the bundled subnet-evm plugin. The avalanchego source tree includes a `graft/` directory holding plugin sources — that's where the subnet-evm build script lives. From a fresh checkout: + ```bash + git clone https://github.com/ava-labs/avalanchego + cd avalanchego + ./scripts/build.sh # builds the avalanchego binary + cd graft/subnet-evm && ./scripts/build.sh # builds the subnet-evm plugin + ``` + The second step symlinks the plugin into `/build/plugins/` under its VM ID (`srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy`). Confirm that file exists before booting. - Set `AVALANCHEGO_PATH` to the binary: ```bash - export AVALANCHEGO_PATH=$HOME/code/avalanchego/build/avalanchego + export AVALANCHEGO_PATH=/path/to/avalanchego/build/avalanchego ``` ## Quickstart @@ -122,6 +129,16 @@ const { publicClient, walletClient } = makeClients(net.cChain, net.funded.privat Producer-side API (`up`, `down`, `Network.start`, `captureSnapshot`, …) is also exported — see [`packages/tmpnetjs/README.md`](./packages/tmpnetjs/README.md). +## Troubleshooting + +| Symptom | Fix | +|---|---| +| `avalanchego binary not found` (lists tried paths) | Set `AVALANCHEGO_PATH` to the absolute path of the built binary, e.g. `/build/avalanchego`. | +| Node never goes healthy / "plugin not found" / subnet won't bootstrap | The subnet-evm plugin isn't where avalanchego expects. Confirm `/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy` exists. Rebuild via `cd /graft/subnet-evm && ./scripts/build.sh` if missing. | +| `up` fails partway, subsequent runs reuse stale data and fail again | `pnpm run clean` then `pnpm run up`. `clean` nukes `.interchain-kit/` (data, snapshots, logs). | +| `forge: command not found` | Install Foundry: . | +| Port already in use (`:9650-9950`, `:8080`, `:8090`, `:9090`) | The primary nodes use `9650+100*i`, `icm-relayer` binds `:8080` (API) + `:9090` (metrics), `signature-aggregator` binds `:8090`. Kill the process holding them (`lsof -iTCP:8080 -sTCP:LISTEN`) or stop the other service. | + ## Replaces The next-gen replacement for [`ava-labs/avalanche-starter-kit`](https://github.com/ava-labs/avalanche-starter-kit). Built on `@avalanche-sdk/{client,interchain}` and the bundled subnet-evm in the avalanchego graft. `avalanche-cli` is intentionally not used — every primitive is driven directly. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..85349c3 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,22 @@ +# Security Policy + +Avalanche takes the security of the platform and of its users very seriously. We and our community recognize the critical role of external security researchers and developers and welcome responsible disclosures. + +## Reporting a Vulnerability + +**Please do not file a public GitHub issue** for any security vulnerability in interchain-kit or in the Avalanche components it exercises (ICM, ICTT, validator manager, icm-relayer, signature aggregator). + +Disclose vulnerabilities privately through one of the following channels: + +- The Avalanche [Bug Bounty Program on Immunefi](https://immunefi.com/bug-bounty/avalanche/information/) — valid reports may be eligible for a reward (terms and conditions apply). +- Email [security@avalabs.org](mailto:security@avalabs.org) if the issue is out of Immunefi scope. + +Vulnerabilities must be disclosed privately with reasonable time to respond, and must avoid compromise of other users and accounts, or loss of funds that are not your own. We do not reward spam or social engineering vulnerabilities. + +Do not test for or validate any security issues against the live Avalanche networks (Mainnet and Fuji testnet). Reproduce exploits in a local private network — that is exactly what this repo is for. + +Please refer to the [Bug Bounty page](https://immunefi.com/bug-bounty/avalanche/information/) for the most up-to-date program rules and scope. + +## Supported Versions + +Please use the latest commit on `main` when validating security issues. diff --git a/contracts/src/examples/icm-basics/SimpleReceiver.sol b/contracts/src/examples/icm-basics/SimpleReceiver.sol index 54a064d..961a82e 100644 --- a/contracts/src/examples/icm-basics/SimpleReceiver.sol +++ b/contracts/src/examples/icm-basics/SimpleReceiver.sol @@ -41,9 +41,7 @@ contract SimpleReceiver is TeleporterRegistryApp { /// @notice Emitted whenever a cross-chain message is successfully processed. event MessageReceived( - bytes32 indexed sourceBlockchainID, - address indexed originSenderAddress, - string message + bytes32 indexed sourceBlockchainID, address indexed originSenderAddress, string message ); /// @param teleporterRegistryAddress Address of the TeleporterRegistry on diff --git a/contracts/src/examples/icm-basics/SimpleSender.sol b/contracts/src/examples/icm-basics/SimpleSender.sol index ad1a057..749c364 100644 --- a/contracts/src/examples/icm-basics/SimpleSender.sol +++ b/contracts/src/examples/icm-basics/SimpleSender.sol @@ -54,11 +54,10 @@ contract SimpleSender { /// @param destinationAddress The receiver contract address on that L1. /// @param message Arbitrary UTF-8 string payload. /// @return messageID Teleporter's unique ID for this message. - function sendMessage( - bytes32 destinationBlockchainID, - address destinationAddress, - string calldata message - ) external returns (bytes32 messageID) { + function sendMessage(bytes32 destinationBlockchainID, address destinationAddress, string calldata message) + external + returns (bytes32 messageID) + { // ABI-encode the user payload. ICM messages are arbitrary `bytes`; both // sides agree on the encoding. Here we just wrap a single string. bytes memory encodedMessage = abi.encode(message); diff --git a/contracts/src/examples/ictt-native/NativeRoundTrip.sol b/contracts/src/examples/ictt-native/NativeRoundTrip.sol index 18a3286..e5b830d 100644 --- a/contracts/src/examples/ictt-native/NativeRoundTrip.sol +++ b/contracts/src/examples/ictt-native/NativeRoundTrip.sol @@ -2,8 +2,7 @@ pragma solidity 0.8.25; import {Vm} from "forge-std/Vm.sol"; -import {INativeMinter} from - "@avalabs/subnet-evm-contracts@1.2.2/contracts/interfaces/INativeMinter.sol"; +import {INativeMinter} from "@avalabs/subnet-evm-contracts@1.2.2/contracts/interfaces/INativeMinter.sol"; /// @title MockNativeMinter /// @notice Test-only stand-in for the Avalanche Subnet-EVM `NativeMinter` precompile @@ -50,6 +49,7 @@ contract MockNativeMinter is INativeMinter { function setEnabled(address) external override {} function setManager(address) external override {} function setNone(address) external override {} + function readAllowList(address) external pure override returns (uint256) { return 0; } diff --git a/contracts/src/examples/teleporter-patterns/CrossChainCounter.sol b/contracts/src/examples/teleporter-patterns/CrossChainCounter.sol index df1e3cc..6675d5e 100644 --- a/contracts/src/examples/teleporter-patterns/CrossChainCounter.sol +++ b/contracts/src/examples/teleporter-patterns/CrossChainCounter.sol @@ -87,10 +87,10 @@ contract CrossChainCounter is ITeleporterReceiver { /// @param destinationChainID The bytes32 blockchainID of the target L1. /// @param amount How much to add to the remote counter. /// @return messageID The Teleporter messageID for the outbound msg. - function incrementRemote( - bytes32 destinationChainID, - uint256 amount - ) external returns (bytes32 messageID) { + function incrementRemote(bytes32 destinationChainID, uint256 amount) + external + returns (bytes32 messageID) + { address peer = peers[destinationChainID]; require(peer != address(0), "CrossChainCounter: peer not set"); @@ -120,9 +120,7 @@ contract CrossChainCounter is ITeleporterReceiver { bytes calldata message ) external override { // (a) Only the local TeleporterMessenger may deliver to us. - require( - msg.sender == address(teleporterMessenger), "CrossChainCounter: unauthorized messenger" - ); + require(msg.sender == address(teleporterMessenger), "CrossChainCounter: unauthorized messenger"); // (b) Only the trusted peer on the source chain may instruct us. address expectedPeer = peers[sourceBlockchainID]; require(expectedPeer != address(0), "CrossChainCounter: unknown source chain"); diff --git a/contracts/test/examples/icm-basics/SimpleMessage.t.sol b/contracts/test/examples/icm-basics/SimpleMessage.t.sol index 55756d3..f588fc5 100644 --- a/contracts/test/examples/icm-basics/SimpleMessage.t.sol +++ b/contracts/test/examples/icm-basics/SimpleMessage.t.sol @@ -118,10 +118,7 @@ contract SimpleMessageTest is Test { address(sender), "originSenderAddress should be the SimpleSender contract" ); - assertTrue( - receiver.latestOriginSenderAddress() != user, - "originSenderAddress is NOT the EOA" - ); + assertTrue(receiver.latestOriginSenderAddress() != user, "originSenderAddress is NOT the EOA"); } // ------------------------------------------------------------------------- diff --git a/contracts/test/examples/ictt-erc20/RoundTrip.t.sol b/contracts/test/examples/ictt-erc20/RoundTrip.t.sol index f90b7cb..feee7e3 100644 --- a/contracts/test/examples/ictt-erc20/RoundTrip.t.sol +++ b/contracts/test/examples/ictt-erc20/RoundTrip.t.sol @@ -18,8 +18,14 @@ import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract DemoUSDC is ERC20 { constructor() ERC20("Demo USDC", "USDC") {} - function decimals() public pure override returns (uint8) { return 6; } - function mint(address to, uint256 amount) external { _mint(to, amount); } + + function decimals() public pure override returns (uint8) { + return 6; + } + + function mint(address to, uint256 amount) external { + _mint(to, amount); + } } /// @notice Round-trip test against unmodified `ERC20TokenHome` / @@ -35,7 +41,7 @@ contract DemoUSDC is ERC20 { /// 6. home.send(...) -> harness relays C -> L1 (minting on remote) /// 7. assert recipient balance on remote. contract CrossChainRoundtrip is Test { - bytes32 constant C_CHAIN = bytes32(uint256(0xC1)); + bytes32 constant C_CHAIN = bytes32(uint256(0xC1)); bytes32 constant L1_CHAIN = bytes32(uint256(0x71)); FoundryWarpHarness harness; @@ -53,7 +59,7 @@ contract CrossChainRoundtrip is Test { function setUp() public { harness = new FoundryWarpHarness(); - (regC, msgrC) = harness.deployChain(C_CHAIN); + (regC, msgrC) = harness.deployChain(C_CHAIN); (regL1, msgrL1) = harness.deployChain(L1_CHAIN); usdc = new DemoUSDC(); diff --git a/contracts/test/examples/ictt-native/NativeRoundTrip.t.sol b/contracts/test/examples/ictt-native/NativeRoundTrip.t.sol index 79f23d3..0474d11 100644 --- a/contracts/test/examples/ictt-native/NativeRoundTrip.t.sol +++ b/contracts/test/examples/ictt-native/NativeRoundTrip.t.sol @@ -167,9 +167,7 @@ contract NativeRoundTrip is Test { assertEq(recipient.balance, sendAmount, "native AVAX minted on remote"); // Home now holds collateral + the new send. assertEq( - wavax.balanceOf(address(home)), - INITIAL_RESERVE_IMBALANCE + sendAmount, - "home WAVAX after send" + wavax.balanceOf(address(home)), INITIAL_RESERVE_IMBALANCE + sendAmount, "home WAVAX after send" ); // First SEND from home flips the remote into "collateralized" state. assertEq(remote.getIsCollateralized(), true, "remote collateralized after first send"); diff --git a/examples/package.json b/examples/package.json index 0265fe9..33eccc1 100644 --- a/examples/package.json +++ b/examples/package.json @@ -3,6 +3,7 @@ "version": "0.0.0", "private": true, "description": "Runnable end-to-end demos against a local interchain-kit tmpnet. Send a real ICM message and run a real ICTT transfer.", + "license": "BSD-3-Clause", "type": "module", "scripts": { "send-message": "tsx send-message.ts", diff --git a/package.json b/package.json index a095827..ab20f7b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "description": "Local dev kit for ICM and ICTT on Avalanche — Foundry harness for fast iteration, one-command tmpnet + relayer for end-to-end.", - "license": "MIT", + "license": "BSD-3-Clause", "scripts": { "build": "pnpm -r --filter './packages/**' build", "test": "pnpm test:harness", diff --git a/packages/harness/package.json b/packages/harness/package.json index 22abb32..b2730f6 100644 --- a/packages/harness/package.json +++ b/packages/harness/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "description": "Foundry harness for running real, unmodified icm-contracts (Teleporter + ICTT) end-to-end inside a single EVM via an etched Warp precompile.", - "license": "MIT", + "license": "BSD-3-Clause", "files": [ "src/" ] diff --git a/packages/icm-services-installer/package.json b/packages/icm-services-installer/package.json index e4b5163..c353759 100644 --- a/packages/icm-services-installer/package.json +++ b/packages/icm-services-installer/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "description": "Downloads and caches pinned icm-relayer and signature-aggregator binaries from github.com/ava-labs/icm-services releases.", - "license": "MIT", + "license": "BSD-3-Clause", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts", diff --git a/packages/tmpnetjs/README.md b/packages/tmpnetjs/README.md index eadd3ca..3e0e209 100644 --- a/packages/tmpnetjs/README.md +++ b/packages/tmpnetjs/README.md @@ -1,15 +1,25 @@ # tmpnetjs -JS analog of avalanchego's [`tmpnet`](https://github.com/ava-labs/avalanchego/tree/master/tests/fixture/tmpnet). Boots a local Avalanche network — primary nodes, L1s, Teleporter, ICTT, `icm-relayer`, `signature-aggregator` — and exposes it both as an SDK and a CLI. +JS analog of avalanchego's [`tmpnet`](https://github.com/ava-labs/avalanchego/tree/master/tests/fixture/tmpnet). Boots a local Avalanche network — primary nodes, L1s, Teleporter, ICTT, `icm-relayer`, `signature-aggregator` — and exposes it as a workspace SDK plus a small CLI. + +This package is consumed from within the `interchain-kit` repo (`workspace:*`). It is **not published to npm**. ## Use it ### CLI +From the repo root, via the wired-up scripts: + +```bash +pnpm run up # boot primary network + L1 + ICM + relayer + sigagg +pnpm run down # stop processes (snapshot preserved) +pnpm run clean # nuke data, snapshots, binaries +``` + +Or invoke the bin directly (same thing — useful inside another workspace package): + ```bash -tmpnetjs up # boot primary network + L1 + ICM + relayer + sigagg -tmpnetjs down # stop processes (snapshot preserved) -tmpnetjs clean # nuke data, snapshots, binaries +node packages/tmpnetjs/bin/tmpnetjs.js up ``` Artifacts land in `/.interchain-kit/artifacts/`: diff --git a/packages/tmpnetjs/package.json b/packages/tmpnetjs/package.json index 9384153..2645532 100644 --- a/packages/tmpnetjs/package.json +++ b/packages/tmpnetjs/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "description": "JS analog of avalanchego's tmpnet. Boots a local Avalanche network with L1s, Teleporter, ICTT, icm-relayer, and signature-aggregator — drive it as an SDK or via the CLI.", - "license": "MIT", + "license": "BSD-3-Clause", "type": "module", "main": "./dist/index.js", "types": "./dist/index.d.ts",