Skip to content

Commit 9f258c7

Browse files
author
Alex Stelea
committed
docs: improve deployment steps
1 parent 36a3538 commit 9f258c7

1 file changed

Lines changed: 84 additions & 34 deletions

File tree

README.md

Lines changed: 84 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,76 @@ Above script iterates over all scrypto packages inside this repository and build
122122
npm run wallet:faucet
123123
```
124124

125-
### Deploy scrypto components to Stokenet
125+
### Create all resources on-ledger
126126

127127
```bash
128-
npm run wallet:create:resources &&\
129-
npm run wallet:deploy-new:all &&\
128+
npm run wallet:create:resources
129+
```
130+
131+
#### Replace the following resources in the `constants.ts` file
132+
```json
133+
badges: {
134+
adminBadgeAddress: 'resource_tdx_2_1t...,
135+
superAdminBadgeAddress: 'resource_tdx_2_1t...,
136+
heroBadgeAddress: 'resource_tdx_2_1n...,
137+
},
138+
resources: {
139+
elementAddress: 'resource_tdx_2_1t...,
140+
clamAddress: 'resource_tdx_2_1t...,
141+
radgemAddress: 'resource_tdx_2_1n...,
142+
morphEnergyCardAddress:
143+
'resource_tdx_2_1n...,
144+
radmorphAddress: 'resource_tdx_2_1n...,
145+
ottercoinAddress:
146+
'resource_tdx_2_1t...,
147+
giftBox: {
148+
Starter: 'resource_tdx_2_1t...,
149+
Simple: 'resource_tdx_2_1t...,
150+
Fancy: 'resource_tdx_2_1t...,
151+
Elite: 'resource_tdx_2_1...'
152+
}
153+
}
154+
```
155+
156+
### Deploy packages and instantiate components from blueprints
157+
158+
```bash
159+
npm run wallet:deploy-new:all
160+
```
161+
162+
#### Replace the following items in the `constants.ts` file
163+
```json
164+
{
165+
radquestPackage: 'package_tdx_2_1...',
166+
heroBadgeForgeV2Package: 'package_tdx_2_1...',
167+
questRewardsV2Package: 'package_tdx_2_1...',
168+
cardForgeV2Package: 'package_tdx_2_1...',
169+
giftBoxOpenerV2Package: 'package_tdx_2_1...',
170+
radgemForgeV2Package: 'package_tdx_2_1...',
171+
components: {
172+
radgemForgeAddress: 'component_tdx_2_1...,
173+
radmorphForgeAddress: 'component_tdx_2_1...,
174+
imageOracleAddress: 'component_tdx_2_1...,
175+
refineryAddress: 'component_tdx_2_1...,
176+
heroBadgeForgeV2: 'component_tdx_2_1...,
177+
questRewardsV2: 'component_tdx_2_1...,
178+
cardForgeV2: 'component_tdx_2_1...,
179+
giftBoxOpenerV2: 'component_tdx_2_1...,
180+
radgemForgeV2: 'component_tdx_2_1...'
181+
}
182+
}
183+
184+
```
185+
186+
### Set dApp definition metadata
187+
```bash
130188
npm run wallet:set:dapp-data
131189
```
132190

133191
### Run the full-stack
134192

135193
```bash
136-
# starts all services
194+
# starts all services (Redis, Postgres, etc.)
137195
docker compose up -d
138196
```
139197

@@ -159,35 +217,27 @@ npm run wallet:populate:oracle
159217
npm run dev
160218
```
161219

162-
163-
164-
### Run frontend only
165-
166-
```bash
167-
npm run dev:dapp
168-
```
169-
170-
### Install dependency
171-
172-
```bash
173-
# run in project root folder
174-
npm install PACKAGE_NAME --workspace=NAME_OF_APP
175-
```
176-
177-
### Update dependency
178-
179-
```bash
180-
# run in project root folder
181-
npm update PACKAGE_NAME --workspace=NAME_OF_APP
182-
```
183-
184-
### Uninstall dependency
185-
186-
```bash
187-
# run in project root folder
188-
npm uninstall PACKAGE_NAME --workspace=NAME_OF_APP
189-
```
190-
191220
## User authentication
192221

193-
![user auth flow](docs/user-authentication-flow.png)
222+
```mermaid
223+
sequenceDiagram
224+
actor User
225+
participant Frontend
226+
participant Backend
227+
participant Wallet
228+
229+
User->>Frontend: Initiate Login
230+
Frontend->>Backend: Request Auth Challenge
231+
Backend->>Backend: Generate Challenge
232+
Backend-->>Frontend: Return Challenge
233+
Frontend->>Wallet: Request Challenge Signing
234+
Wallet->>User: Prompt for Approval
235+
User->>Wallet: Approve Signing
236+
Wallet-->>Frontend: Return Signed Challenge
237+
Frontend->>Backend: Submit Signed Challenge
238+
Backend->>Backend: Verify Signature
239+
Backend->>Backend: Generate Session Token
240+
Backend-->>Frontend: Return Session Token
241+
Frontend->>Frontend: Store Session Token
242+
Frontend-->>User: Show Logged In State
243+
```

0 commit comments

Comments
 (0)