Skip to content

Commit 5f4d9ef

Browse files
committed
update based on feedback
1 parent dc100d3 commit 5f4d9ef

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

streamlit_app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ def main(nada_test_file_name=None, path_nada_bin=None, path_nada_json=None):
186186

187187
# Display the program code
188188
st.subheader(f"{program_name}.py")
189-
st.code(program_code, language='python')
189+
with st.expander(f"Nada Program: {program_name}"):
190+
st.code(program_code, language='python')
190191

191192
# Display inputs grouped by party, alphabetized
192193
updated_input_values = create_party_inputs(input_info, input_values)

streamlit_demo_apps/README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Deploying Streamlit Apps
22

3-
Follow the steps to deploy a live Streamlit app for your Nada program and test file. The app will connect to the Nillion Testnet to store your Nada program, store secret inputs (or use computation time secrets), and run blind computation.
3+
Follow the steps to deploy a live Streamlit app for your Nada program. The app will connect to the Nillion Testnet to store your Nada program, store secret inputs (or use computation time secrets), and run blind computation.
44

55
## How to add a new Streamlit App
66

7-
### 0. Create a streamlit secrets file
7+
### 0. Fork this repo
8+
9+
### 1. Create a streamlit secrets file
810

911
Run this command to create a `.streamlit/secrets.toml` copied from the example.
1012

@@ -14,30 +16,30 @@ cp .streamlit/secrets.toml.example .streamlit/secrets.toml
1416

1517
Add your Nilchain private key to the .streamlit/secrets.toml file. The private key must be linked to a funded Nillion Testnet address that was created using a Google account (not a mnemonic). This allows you to retrieve the private key from Keplr. If you don’t have a Testnet wallet yet, you can learn how to create one here: https://docs.nillion.com/testnet-guides
1618

17-
### 1. Run the script to generate a new streamlit app for your program
19+
### 2. Run the script to generate a new streamlit app for your program
1820

1921
From the root folder of this repo, run the generate-streamlit-app script:
2022

2123
```
2224
python3 generate-streamlit-app.py
2325
```
2426

25-
### 2. Follow the prompts to
27+
### 3. Follow the prompts to
2628

2729
- Select an existing program (from the src/ directory)
2830
- Select an existing yaml test file for your program (from the tests/ directory)
2931

30-
This will generate a Streamlit app file: streamlit_demo_apps/app_[your_program_name].py. The script will run the Streamlit app locally with this command
32+
This will generate a Streamlit app file: streamlit*demo_apps/app*[your_program_name].py. The script will run the Streamlit app locally with this command
3133

3234
```
3335
streamlit run streamlit_demo_apps/app_[your_program_name].py`
3436
```
3537

36-
### 3. Test your Streamlit app locally
38+
### 4. Test your Streamlit app locally
3739

3840
View the app in your browser to make sure everything works as expected.
3941

40-
### 4. Commit your code to GitHub
42+
### 5. Commit your code to GitHub
4143

4244
Add and commit your new streamlit app code to your forked Github repo. (Code must be connected to a remote, open source GitHub repository to deploy a Streamlit app.)
4345

@@ -51,8 +53,7 @@ Once you've committed the open source code, you can click the "deploy" button wi
5153

5254
<img width="1000" alt="Streamlit Community Cloud" src="https://github.com/user-attachments/assets/74a70b4e-506c-41df-8d59-f949871c9a4e">
5355

54-
55-
### 5. Deploy your app from Streamlit.io
56+
### 6. Deploy your app from Streamlit.io
5657

5758
When you click "Deploy Now" from your local app, you'll be taken to streamlit.io and asked to log in with Github to create a new Streamlit app. Set the main file path to your new app `streamlit_demo_apps/app_[your_program_name].py`
5859

@@ -68,9 +69,9 @@ nilchain_private_key = "YOUR_FUNDED_PRIVATE_KEY"
6869

6970
<img width="1000" alt="advanced settings" src="https://github.com/user-attachments/assets/6b48b225-60b7-41bd-8591-c04419131bf8">
7071

71-
Save and click "Deploy" to deploy your testnet-connected Streamlit app.
72+
Save and click "Deploy" to deploy your testnet-connected Streamlit app.
7273

73-
### 6. Access Your Live Streamlit App
74+
### 7. Access Your Live Streamlit App
7475

7576
Once deployed, you’ll get a live link to your Nillion Testnet Streamlit app!
7677

0 commit comments

Comments
 (0)