Phil at both ends
Phil's compiler backend emits two programs for its upload protocol: a client and a server. On this page the client runs in your browser and the server runs on Solana, and they complete the protocol with each other. Nobody wrote either side's protocol logic by hand.
UploadClient, compiled to WebAssembly. Runs in this page.UploadServer, inside a Solana program. Runs on devnet.Run a session
Type anything. Phil's client will hash it, declare it, and send it; Phil's server on Solana will check every step and answer.
A session that is on the record
The button above asks a Solana node to run the server without recording a transaction, which is why it needs no wallet. This one was sent as a real transaction: the bytes in it were produced by Phil's client, and the program that accepted them is Phil's server.
What is Phil's, and what is ours
Phil's
- What each side does, and in what order: the two functions Phil's backend emits.
- The frame format: Phil's control codec v1.
- The interface each function expects from the machine it runs on.
Ours
- That interface, written twice: for a browser (about 100 lines) and for Solana.
- Getting the bytes from one to the other.
- The Solana runtime's checks that the server uses every owner exactly once.
Plainly
- The messages travel in one transaction. A Solana program cannot answer and then wait. So the client first runs as if the server will agree, its messages are sent together, and the client is then run again with the answers the server actually gave. On an ordinary connection the two would take turns; the decisions each side makes are the same.
- Our test compares the client's bytes with an encoder we wrote by hand before the client existed here. They are identical, byte for byte.
- These functions come from an emitter built into Phil's repository for Phil's own upload example. They are not compiled from Phil source text by
philc, which cannot build programs of this size yet. - Devnet. Solana's test network, which is reset from time to time.
The client's runtime is phil-client.ts; the server's is runtime.c; the session tests are test/session.ts. This is a community project and is not affiliated with Phil or Solana.