Skip to content

Commit dc1f8c1

Browse files
committed
Merge #51: Rename Simfony to SimplicityHL
419166f rename Simfony to SimplicityHL (Simon Tennant) 35e2261 get building and running in docker (Simon Tennant) Pull request description: it appears the latest version of SimplicityHL has some breaking changes and the IDE doesn't build against it. I've left the original reference there, but against the BlockstreamResearch repo and against the last working commit. ``` [dependencies] #simplicityhl = "0.2.0" simplicityhl = { package = "simfony", git = "https://github.com/BlockstreamResearch/simplicityhl", rev = "d5284014e9f67593e50b272f1f676ea8d09f6ec8" } ``` ACKs for top commit: apoelstra: ACK 419166f; successfully ran local tests Tree-SHA512: cf6029e40a331c37dce952d30dcfc436a60e5cb8a2e3c87386ae40985e320525f97a10a13f7ccbbbfc047ed9fb124bcd6acab8210d0a999497d172501e57d1b6
2 parents 7ef0c6b + 419166f commit dc1f8c1

20 files changed

+189
-116
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@ lib-profile-release = "wasm-release"
1414

1515
[dependencies]
1616
itertools = "0.13.0"
17-
simfony = { git = "https://github.com/uncomputable/simfony", rev = "d5284014e9f67593e50b272f1f676ea8d09f6ec8" }
17+
#simplicityhl = "0.2.0"
18+
simplicityhl = { package = "simfony", git = "https://github.com/BlockstreamResearch/simplicityhl", rev = "d5284014e9f67593e50b272f1f676ea8d09f6ec8" }
1819
leptos = { version = "0.6.14", features = ["csr"] }
1920
leptos_router = { version = "0.6.15", features = ["csr"] }
2021
console_error_panic_hook = "0.1.7"
2122
hex-conservative = "0.2.1"
2223
js-sys = "0.3.70"
23-
web-sys = { version = "0.3.70", features = ["Navigator", "Clipboard", "Storage"] }
24+
web-sys = { version = "0.3.70", features = [
25+
"Navigator",
26+
"Clipboard",
27+
"Storage",
28+
] }
2429
wasm-bindgen-futures = "0.4.43"
2530
gloo-timers = { version = "0.3.0", features = ["futures"] }
2631
gloo-net = "0.6.0"

Dockerfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Stage 1: Builder
2+
# This stage installs all dependencies and builds the application.
3+
FROM debian:bookworm-slim AS builder
4+
5+
# Install essential build tools, clang, and nodejs for sass
6+
RUN apt-get update && \
7+
apt-get install -y --no-install-recommends \
8+
build-essential \
9+
clang-16 \
10+
llvm-16 \
11+
curl \
12+
pkg-config \
13+
libssl-dev \
14+
ca-certificates \
15+
nodejs \
16+
npm && \
17+
rm -rf /var/lib/apt/lists/*
18+
19+
# Install Rust and the wasm32 target
20+
ENV RUSTUP_HOME=/usr/local/rustup \
21+
CARGO_HOME=/usr/local/cargo \
22+
PATH=/usr/local/cargo/bin:$PATH
23+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable && \
24+
rustup target add wasm32-unknown-unknown
25+
26+
# Install Trunk and Dart Sass
27+
RUN cargo install trunk && \
28+
npm install -g sass
29+
30+
# Set environment variables for the Wasm C compiler, mimicking the Nix setup.
31+
# This tells Rust's build scripts to use clang-16 when compiling C code for Wasm.
32+
ENV CC_wasm32_unknown_unknown=clang-16
33+
ENV AR_wasm32_unknown_unknown=llvm-ar-16
34+
ENV CFLAGS_wasm32_unknown_unknown="-I/usr/lib/clang/16/include"
35+
36+
# Copy the application source code
37+
WORKDIR /app
38+
COPY . .
39+
40+
# Build the application
41+
RUN trunk build --release && \
42+
sh fix-links.sh
43+
44+
# Stage 2: Final Image
45+
# This stage creates a minimal image to serve the built static files.
46+
FROM nginx:1.27-alpine-slim
47+
48+
# Copy the built assets from the builder stage
49+
COPY --from=builder /app/dist /usr/share/nginx/html
50+
51+
# Expose port 80 and start Nginx
52+
EXPOSE 80
53+
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
1-
# Simfony Web IDE
1+
# SimplicityHL Web IDE
22

3-
[Simfony](https://github.com/BlockstreamResearch/simfony) is a high-level language for writing Bitcoin smart contracts.
3+
[SimplicityHL](https://github.com/BlockstreamResearch/simplicityhl) is a high-level language for writing Bitcoin smart contracts.
44

5-
Simfony looks and feels like [Rust](https://www.rust-lang.org). Just how Rust compiles down to assembly language, Simfony compiles down to Simplicity bytecode. Developers write Simfony, full nodes execute Simplicity.
5+
SimplicityHL looks and feels like [Rust](https://www.rust-lang.org). Just how Rust compiles down to assembly language, SimplicityHL compiles down to Simplicity bytecode. Developers write SimplicityHL, full nodes execute Simplicity.
66

7-
[A live demo is running on GitHub pages](https://simfony.dev).
7+
[A live demo is running](https://ide.simplicity-lang.org).
88

99
## Develop the project
1010

11-
### Install dependencies
11+
### Using Docker
12+
13+
Build
14+
```
15+
docker build -t simplicity-webide .
16+
```
17+
18+
Run and naviate to `http://localhost:8080` in your web browser.
19+
```
20+
docker run -p 8080:80 simplicity-webide
21+
```
22+
23+
### Using Nix
1224

1325
First install nix.
1426

doc/README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
11
# How to make a transaction using the web IDE
22

3-
The Simfony web IDE can only make a restricted form of transaction: There is 1 transaction input, 1 transaction output and 1 fee output _(Liquid has explicit fee outputs)_. Confidential transactions or assets other than Bitcoin are not supported.
3+
The SimplicityHL web IDE can only make a restricted form of transaction: There is 1 transaction input, 1 transaction output and 1 fee output _(Liquid has explicit fee outputs)_. Confidential transactions or assets other than Bitcoin are not supported.
44

5-
![Screenshot of mempool.space](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/mempool1.png)
5+
![Screenshot of mempool.space](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/mempool1.png)
66

77
## Write the main function
88

9-
Open [the Simfony web IDE](https://simfony.dev/) and write the main function of your program.
9+
Open [the SimplicityHL web IDE](https://ide.simplicity-lang.org/) and write the main function of your program.
1010

1111
_You can leave the default main function as it is. Customize it if you want._
1212

13-
![Screenshot of the web IDE](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/webide0.png)
13+
![Screenshot of the web IDE](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/webide0.png)
1414

1515
## Generate an address
1616

1717
Click the "Address" button to copy the address of your program to the clipboard.
1818

1919
Leave the web IDE tab open. You will need it later.
2020

21-
![Screenshot of the web IDE](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/webide1.png)
21+
![Screenshot of the web IDE](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/webide1.png)
2222

2323
## Fund the address
2424

2525
Paste the address into [the Liquid testnet faucet](https://liquidtestnet.com/faucet) and press the "Send assets" button.
2626

27-
![Screenshot of the Liquid testnet faucet](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/faucet1.png)
27+
![Screenshot of the Liquid testnet faucet](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/faucet1.png)
2828

2929
Copy the ID of the funding transaction to your clipboard.
3030

31-
![Screenshot of the Liquid testnet faucet](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/faucet2.png)
31+
![Screenshot of the Liquid testnet faucet](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/faucet2.png)
3232

3333
## Look up the funding transaction
3434

3535
Paste the ID of the funding transaction into the [Blockstream Explorer for Liquid testnet](https://blockstream.info/liquidtestnet/).
3636

37-
![Screenshot of the Blockstream Explorer](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/esplora1.png)
37+
![Screenshot of the Blockstream Explorer](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/esplora1.png)
3838

39-
Scroll down and find the Simfony UTXO. The Liquid testnet faucet always sends 100000 tL-BTC. In our example, the Simfony UTXO is vout = 1.
39+
Scroll down and find the SimplicityHL UTXO. The Liquid testnet faucet always sends 100000 tL-BTC. In our example, the SimplicityHL UTXO is vout = 1.
4040

41-
![Screenshot of the Blockstream Explorer](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/esplora2.png)
41+
![Screenshot of the Blockstream Explorer](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/esplora2.png)
4242

4343
## Enter UTXO data into the web IDE
4444

4545
Enter the ID of the funding transaction and the vout into the web IDE.
4646

4747
_You can leave the remaining fields as they are. Feel free to customize._
4848

49-
![Screenshot of the Simfony web IDE](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/webide2.png)
49+
![Screenshot of the SimplicityHL web IDE](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/webide2.png)
5050

5151
## Sign the spending transaction
5252

53-
Click the "Sig 0" button to generate a signature for a transaction that spends the Simfony UTXO.
53+
Click the "Sig 0" button to generate a signature for a transaction that spends the SimplicityHL UTXO.
5454

55-
![Screenshot of the Simfony web IDE](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/webide3.png)
55+
![Screenshot of the SimplicityHL web IDE](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/webide3.png)
5656

5757
Paste the signature into the `mod witness {...}` section.
5858

59-
![Screenshot of the Simfony web IDE](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/webide4.png)
59+
![Screenshot of the SimplicityHL web IDE](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/webide4.png)
6060

6161
## Generate the spending transaction
6262

6363
Click the "Transaction" button to copy the spending transaction to your clipboard.
6464

65-
![Screenshot of the Simfony web IDE](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/webide5.png)
65+
![Screenshot of the SimplicityHL web IDE](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/webide5.png)
6666

6767
## Broadcast the spending transaction
6868

6969
Paste the spending transaction into the [Blockstream Liquid testnet explorer](https://blockstream.info/liquidtestnet/tx/push) and click the "Broadcast transaction" button.
7070

71-
![Screenshot of the Simfony web IDE](https://raw.githubusercontent.com/uncomputable/simfony-webide/master/doc/esplora3.png)
71+
![Screenshot of the SimplicityHL web IDE](https://raw.githubusercontent.com/BlockstreamResearch/simplicity-webide/master/doc/esplora3.png)
7272

73-
If everything worked, the explorer will open the broadcast transaction. In this case, congratulations, you made a Simfony transaction on Liquid testnet!!! You can also look up your transaction on [mempool.space](https://liquid.network/testnet).
73+
If everything worked, the explorer will open the broadcast transaction. In this case, congratulations, you made a SimplicityHL transaction on Liquid testnet!!! You can also look up your transaction on [mempool.space](https://liquid.network/testnet).
7474

7575
If you see an error message, take a look at the following "Troubleshooting" section.
7676

@@ -126,7 +126,7 @@ The fee consumes the entire input value. Decrease the fee.
126126

127127
A Simplicity jet fails.
128128

129-
Double-check the conditions that your Simfony program enforces. Update the witness data or transaction parameters.
129+
Double-check the conditions that your SimplicityHL program enforces. Update the witness data or transaction parameters.
130130

131131
Every time you change the transaction parameters, the signature hash of the transaction changes. In this case, you need to **regenerate signatures** using the "Key Store" tab.
132132

src/components/footer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn Footer() -> impl IntoView {
3939
<a href="https://t.me/simplicity_community" class="footer-social-link">
4040
<img src="images/telegram.svg" alt="Telegram Icon" class="footer-social-icon" />
4141
</a>
42-
<a href="https://github.com/BlockstreamResearch/simfony" class="footer-social-link">
42+
<a href="https://github.com/BlockstreamResearch/simplicityhl" class="footer-social-link">
4343
<img src="images/github.svg" alt="GitHub Icon" class="footer-social-icon" />
4444
</a>
4545
</div>

src/components/merkle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::sync::Arc;
22

33
use js_sys::{Array, Object};
44
use leptos::*;
5-
use simfony::simplicity;
5+
use simplicityhl::simplicity;
66
use simplicity::dag::DagLike;
77
use simplicity::dag::NoSharing;
88
use simplicity::node;

src/components/navigation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn Navigation() -> impl IntoView {
5858
<div class="navigation-dropdown-title">"Whitepaper"</div>
5959
<div class="navigation-dropdown-description">"The original Simplicity whitepaper, detailing the language."</div>
6060
</a>
61-
<a href="https://docs.rs/simfony-as-rust" target="_blank" rel="noopener noreferrer" class="navigation-dropdown-item">
61+
<a href="https://docs.rs/simplicityhl-as-rust" target="_blank" rel="noopener noreferrer" class="navigation-dropdown-item">
6262
<div class="navigation-dropdown-title">"Jets Documentation"</div>
6363
<div class="navigation-dropdown-description">"Technical reference detailing each jet's functionality and use."</div>
6464
</a>
@@ -140,7 +140,7 @@ pub fn Navigation() -> impl IntoView {
140140
class:active=move || docs_open.get()
141141
>
142142
<a href="https://blockstream.com/simplicity.pdf" target="_blank" rel="noopener noreferrer" class="navigation-mobile-dropdown-item" on:click=close_mobile_menu>"Whitepaper"</a>
143-
<a href="https://docs.rs/simfony-as-rust" target="_blank" rel="noopener noreferrer" class="navigation-mobile-dropdown-item" on:click=close_mobile_menu>"Jets Documentation"</a>
143+
<a href="https://docs.rs/simplicityhl-as-rust" target="_blank" rel="noopener noreferrer" class="navigation-mobile-dropdown-item" on:click=close_mobile_menu>"Jets Documentation"</a>
144144
<a href="https://docs.simplicity-lang.org/" target="_blank" rel="noopener noreferrer" class="navigation-mobile-dropdown-item" on:click=close_mobile_menu>"SimplicityHL"</a>
145145
<a href="https://github.com/BlockstreamResearch/SimplicityHL/tree/master/examples" target="_blank" rel="noopener noreferrer" class="navigation-mobile-dropdown-item" on:click=close_mobile_menu>"Contract Examples"</a>
146146
</div>

src/components/program_window/help_button.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use leptos::{component, view, IntoView};
33
#[component]
44
pub fn HelpButton() -> impl IntoView {
55
view! {
6-
<form action="https://github.com/uncomputable/simfony-webide/blob/master/doc/README.md" target="_blank">
6+
<form action="https://github.com/BlockstreamResearch/simplicity-webide/blob/master/doc/README.md" target="_blank">
77
<button class="button" type="submit">
88
" Help"
99
</button>

src/components/program_window/program_tab.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use leptos::{
66
use_context, view, IntoView, RwSignal, Signal, SignalGetUntracked, SignalSet, SignalUpdate,
77
SignalWith, SignalWithUntracked,
88
};
9-
use simfony::parse::ParseFromStr;
10-
use simfony::simplicity::jet::elements::ElementsEnv;
11-
use simfony::{elements, simplicity};
12-
use simfony::{CompiledProgram, SatisfiedProgram, WitnessValues};
9+
use simplicityhl::parse::ParseFromStr;
10+
use simplicityhl::simplicity::jet::elements::ElementsEnv;
11+
use simplicityhl::{elements, simplicity};
12+
use simplicityhl::{CompiledProgram, SatisfiedProgram, WitnessValues};
1313

1414
use crate::components::copy_to_clipboard::CopyToClipboard;
1515
use crate::function::Runner;
@@ -64,7 +64,7 @@ impl Program {
6464
}
6565
self.text.with_untracked(|text| {
6666
self.cached_text.set(text.clone());
67-
let compiled = simfony::Arguments::parse_from_str(text)
67+
let compiled = simplicityhl::Arguments::parse_from_str(text)
6868
.map_err(|error| error.to_string())
6969
.and_then(|args| CompiledProgram::new(text.as_str(), args));
7070
let cmr = compiled

0 commit comments

Comments
 (0)