Skip to content

Commit d3026b2

Browse files
committed
update readme to add docker setup
1 parent 854a1b3 commit d3026b2

File tree

1 file changed

+52
-17
lines changed

1 file changed

+52
-17
lines changed

README.md

+52-17
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,24 @@ Welcome to **Hyperweb**, the blockchain for JavaScript smart contracts. Hyperweb
2020
## Table of Contents
2121

2222
- [Quickstart](#quickstart)
23-
- [Contract Layout](#contract-layout)
24-
- [Building and Bundling](#building-and-bundling)
25-
- [Creating JSD Client](#creating-jsd-client)
26-
- [Deploying and Interacting with the Contract](#deploying-and-interacting-with-the-contract)
23+
- [Bundle Contracts](#bundle-contracts)
24+
- [Infrastructure Setup](#infrastructure-setup)
25+
- [Option 1: Using Starship](#option-1-using-starship)
26+
- [Enable Kubernetes in Docker Desktop](#enable-kubernetes-in-docker-desktop)
27+
- [Install `kubectl` and `helm`](#install-kubectl-and-helm)
28+
- [Start Starship](#start-starship)
29+
- [Interact with the Chain](#interact-with-the-chain)
30+
- [Option 2: Using Docker](#option-2-using-docker)
31+
- [Run Hyperweb with Docker](#run-hyperweb-with-docker)
32+
- [Interact with Chain](#interact-with-chain)
33+
- [Run Tests](#run-tests)
2734
- [Usage](#usage)
28-
- [Instantiating a Contract](#instantiating-a-contract)
29-
- [Interacting with the Contract](#interacting-with-the-contract)
30-
- [Evaluating Functions on the Contract](#evaluating-functions-on-the-contract)
31-
- [Reading Contract State](#reading-contract-state)
35+
- [Creating JSD Client](#creating-jsd-client)
36+
- [Deploying and Interacting with the Contract](#deploying-and-interacting-with-the-contract)
37+
- [Instantiating a Contract](#instantiating-a-contract)
38+
- [Interacting with the Contract](#interacting-with-the-contract)
39+
- [Evaluating Functions on the Contract](#evaluating-functions-on-the-contract)
40+
- [Reading Contract State](#reading-contract-state)
3241
- [Development](#development)
3342

3443
## Installation
@@ -56,7 +65,11 @@ yarn build
5665

5766
This bundles the contracts from src/** into dist/contracts/.
5867

59-
### Spin Up Starship
68+
## Infrastructure Setup
69+
70+
### Option 1: Using Starship
71+
[Starship](https://github.com/cosmology-tech/starship) is a Kubernetes-based blockchain orchestrator. It sets up a local blockchain environment with full cross-chain compatibility.
72+
6073
#### Enable Kubernetes in Docker Desktop
6174
Docker Desktop includes a standalone Kubernetes server and client, as well as Docker CLI integration that runs on your machine.
6275
To enable Kubernetes in Docker Desktop:
@@ -80,18 +93,40 @@ Wait for Starship to initialize.
8093

8194
For more details, refer to the [Starship Docs](https://docs.cosmology.zone/starship/).
8295

83-
#### Interact with Chain
84-
Once the starship nodes are running, then you can interact with the chain using following endpoints:
85-
- REST: http://localhost:1317
86-
- RPC: http://localhost:26657
87-
- Faucet: http://localhost:8000
96+
### Option 2: Using Docker
97+
Alternatively, Hyperweb can be run using Docker, which simplifies setup and enables you to interact with the blockchain without requiring Kubernetes.
98+
99+
#### Run Hyperweb with Docker
100+
To spin up the chain using Docker, the following scripts are available in the package.json:
101+
102+
* Run Docker container:
103+
```bash
104+
yarn docker
105+
```
106+
107+
* Stop and remove the container:
108+
```bash
109+
yarn docker:stop
110+
```
111+
112+
### Interact with chain
113+
114+
This will set up the same chain environment that Starship provides, allowing you to interact with the chain using the same endpoints:
115+
* REST: http://localhost:1317
116+
* RPC: http://localhost:26657
117+
* Faucet: http://localhost:8000
118+
* Exposer: http://localhost:8081
119+
* Registry: http://localhost:8001
120+
121+
Once the chain is running, you can follow the same steps to interact with the chain and run tests as detailed below.
88122

89-
### Run Tests
123+
## Run Tests
124+
Once the setup it complete, you can run tests to validate the contract functionality.
90125
Run tests:
91126
```bash
92127
yarn test
93128
```
94-
The test suite deploys the contracts, interacts with them, and validates state transitions. The tests are located in tests/.
129+
The test suite deploys the contracts, interacts with them, and validates state transitions. The tests are located in `__tests__/`.
95130

96131
---
97132

@@ -212,4 +247,4 @@ console.log('Contract state:', state);
212247

213248
## Development
214249

215-
For local development, you can run the tests provided in the `tests/` folder to validate contract functionality using `starshipjs` to simulate chain interactions.
250+
For local development, you can run the tests provided in the `__tests__/` folder to validate contract functionality using `starshipjs` to simulate chain interactions.

0 commit comments

Comments
 (0)