Full lesson
Predix
Predix; trade reliably.
What it does
From the project README:
Predix, kripto analiz dünyasında devrim yaratıyor. Geleneksel platformlarda analistler kendi paraları ile işlem yaparak analiz paylaşırken, bizde tamamen farklı bir yaklaşım benimsedik. Analistlerimiz sadece bilgi ve deneyimlerini paylaşarak gelir elde edebiliyor.
- Original
- ymbozkurt/Predix
- SuperStack fork
- Blockchains/Predix @
6f57791 - Stars
- 0
- Last push (original)
- 2025-06-06
- Languages
- TypeScript, Rust, HTML, CSS, JavaScript
- Detected stack
- Anchorweb3.js
- Categories
- Other
- Licence
- Apache-2.0
Architecture
16 source files. By extension: .tsx ×9, .ts ×5, .js ×1, .rs ×1.
| Top-level directory | Source files |
|---|---|
app | 13 |
migrations | 1 |
programs | 1 |
tests | 1 |
On-chain programs: programs/predix
❌ Does not build as-is, checked 2026-11-02 Tested on 2026-11-02: full log results.json
Build it yourself: step-by-step guide
Every command below was run on 2026-11-02 by tests/run_fork.py against the pinned commit, and the results come from that run. The full output is in the committed log.
1. Prerequisites (versions we tested with)
- Rust:
rustc 1.99.1 (58cf8f9c3 2026-10-13) - Solana CLI (Agave):
solana-cli 1.18.17 (src:c027cfc3; feat:4215500110, client:Agave) - Anchor (via avm):
0.29.0 - Node.js:
v24.22.1 - npm:
11.21.1 - pnpm:
10.34.6 - Go:
go version go1.27.3 linux/amd64
cargo install --git https://github.com/coral-xyz/anchor avm --locked
avm install 0.29.0 && avm use 0.29.0
sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)"2. Clone at the tested commit
git clone https://github.com/Blockchains/Predix.git && cd Predix
git checkout 6f577914bb63f29b17892d70ff465d908a46782f3. Configure
No environment file is needed.
Fixes we had to apply to the pinned commit before it would build or run, with the reason for each:
sed -i "s/pub system_program: AccountInfo<'info>,/pub system_program: Program<'info, System>,/" programs/predix/src/lib.rs. anchor 0.29 safety check rejects an unchecked AccountInfo; use the typed System programcd app && npm pkg set devDependencies.react-refresh=^0.14.0. craco build needs react-refresh, which the app never declaredsed -i 's#/learn react/i#/select wallet/i#' app/src/App.test.tsx. the Create React App placeholder test looked for 'learn react'; assert the wallet button instead
4. Install dependencies
| Directory | Command | Result | Time |
|---|---|---|---|
. | npx -y yarn@1 install --ignore-engines --network-timeout 600000 | ✅ pass | 3s |
app | npm install --no-audit --no-fund --legacy-peer-deps | ✅ pass | 17s |
. | npx -y yarn@1 install --ignore-engines --network-timeout 600000 | ✅ pass | 1s |
5. Build
| Directory | Command | Result | Time |
|---|---|---|---|
. | anchor@0.29.0 build | ✅ pass | 71s |
app | npm run build | ❌ exit 1 | 21s |
Output tail: npm run build
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.[0m
Browserslist: caniuse-lite is outdated. Please run:
npx update-browserslist-db@latest
Why you should do it regularly: https://github.com/browserslist/update-db#readme6. Test
| Directory | Command | Result | Time |
|---|---|---|---|
. | anchor@0.29.0 test --skip-build --provider.cluster localnet --provider.wallet ~/.config/solana/id.json | ❌ exit 1 | 3s |
app | npm run test | ✅ pass | 4s |
Output tail: anchor@0.29.0 test --skip-build --provider.cluster localnet --provider.wallet ~/
at Object.exports.requireOrImport (/tmp/scbuild/predix/node_modules/mocha/lib/nodejs/esm-utils.js:60:20)
at Object.exports.loadFilesAsync (/tmp/scbuild/predix/node_modules/mocha/lib/nodejs/esm-utils.js:103:20)
at singleRun (/tmp/scbuild/predix/node_modules/mocha/lib/cli/run-helpers.js:125:3)
at Object.exports.handler (/tmp/scbuild/predix/node_modules/mocha/lib/cli/run.js:374:5)
error Command failed with exit code 1.
Error: No such file or directory (os error 2)7. Deploy to a local validator
solana-test-validator --reset # separate terminal
solana config set -ul && solana airdrop 100
anchor deploy --provider.cluster localnet| Directory | Command | Result | Time |
|---|---|---|---|
. | solana airdrop 100 -u localhost >/dev/null; anchor@0.29.0 deploy --provider.cluster localnet --provider.wallet ~/.config/solana/id.json | ✅ pass | 5s |
Proof: program IDs and transactions
predix:Ck2Y19mfRhoAVaBADQUNC7oGnycnM5jLAh23sFa8xUiD(local validator)
Transaction signatures recorded on the local validator (1 shown). Local ledgers are thrown away after the run, so these work as receipts in the log and can't be looked up on an explorer:
predix2Hd9vVWpVvfb1NQAWNsz…q3CuuEBx
Deploy to devnet (free)
solana config set --url devnet
solana airdrop 2 # or https://faucet.solana.com
anchor deploy --provider.cluster devnet # native: solana program deploy target/deploy/<name>.so
# point the frontend RPC env var at https://api.devnet.solana.comHow it works
Every instruction handler in the program, with the accounts struct it validates. Each link points to the line at the pinned commit.
| Instruction | Accounts | Where |
|---|---|---|
init_analyst | InitAnalyst | programs/predix/src/lib.rs:12 |
participate | Participate | programs/predix/src/lib.rs:32 |
buy_post | BuyPost | programs/predix/src/lib.rs:56 |
Extend it
- Add an integration test that runs the main flow end to end and asserts every account state change.
- Add a negative test: call each instruction with the wrong signer or account and check that it fails.
- Add an event (
emit!) to each state-changing instruction and subscribe to it from the client. - Replace any unchecked
AccountInfowith typed accounts plushas_one/seedsconstraints. - Make the frontend read the cluster from an env var, deploy it to GitHub Pages and point it at your devnet program.
- Wire the build into CI by copying this site's verify-forks workflow.
Open the dapp
✅ Operational on devnet, verified 2026-11-02
Open the dapp Connect Phantom or Solflare. Every transaction is signed in your own wallet.
- Devnet (test tokens): program
Ck2Y19mfRhoAVaBADQUNC7oGnycnM5jLAh23sFa8xUiD. Get free devnet SOL at faucet.solana.com. - Mainnet: not yet deployed on mainnet (needs owner approval), so it is disabled
Devnet proof, verified 2026-11-02: real transactions sent through this program on devnet.
init_analyst5m59Pz1kGSefzKcidouX…create_insight4LryS3vApuPttf1rHQ4V…buy_postsyCwnhvDjE2G27QxohS6…
Key code, explained
Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.
programs/predix/src/lib.rs L61–84 @ 6f57791 · Apache-2.0 · original#[derive(Accounts)]pub struct InitAnalyst<'info> { #[account(mut)] pub signer: Signer<'info>, #[account(init, payer = signer, space = 1000)] analyst: Account<'info, Analyst>, pub system_program: AccountInfo<'info>,} #[derive(Accounts)]pub struct CreateInsight<'info> { #[account(mut)] pub signer: Signer<'info>, #[account(init, payer = signer, space = 1000)] pub insight: Account<'info, Insight>, pub system_program: AccountInfo<'info>,} #[derive(Accounts)]pub struct ValidateInsight<'info> { #[account(mut, has_one = analyst)] pub insight: Account<'info, Insight>,- Line 64
pub signer: Signer<'info>,: Requires this account to have signed the transaction. - Line 66
#[account(init, payer = signer, space = 1000)]: Creates and pays for a new account. Space and payer must be specified. - Line 83
#[account(mut, has_one = analyst)]: Checks that a stored pubkey field matches the passed account.
How to run, build and test
These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.
| Directory | Command | Runs |
|---|---|---|
. | npm run lint | prettier */*.js "*/**/*{.js,.ts}" --check |
app | npm run start | craco start |
app | npm run build | craco build |
app | npm run test | craco test |
. | anchor build | compile programs and generate IDLs |
. | anchor test | local validator + test suite |
. | anchor run test | yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts |
. | cargo build | Rust workspace build |
. | cargo test | Rust tests |
What you could build from it
- Fork the SuperStack copy and extend it within the Other gaps listed on the idea page.
- Learn the pattern first: Program Derived Addresses (PDAs)
- Learn the pattern first: Cross-Program Invocations (CPIs)