Skip to content

hypnagonia/eigentrust-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust (WASM) port of Eigentrust

This is a Rust port of the EigenTrust algorithm, originally implemented in Go. The project includes both server and client implementations designed to run natively as well as in a WebAssembly environment for browser compatibility.

Live Demo

https://eigentrust.web.app

Test

cargo test

Build WASM for web

wasm-pack build --target web --release

python3 -m http.server

http://localhost:8000/index.html

Call from browser environment

const worker = new Worker('worker.js');
worker.onmessage = function (e) {
        console.log(e.data)
};

const localtrust = `alice,bob,2\nbob,charlie,2\nalice,charlie,1\ncharlie,bob,1\n`
const pretrust = 'alice,1\n'
const localtrustBytes = new TextEncoder().encode(localtrust)
const pretrustBytes = new TextEncoder().encode(pretrust)
const alpha = 0.5
worker.postMessage({ localtrustBytes, pretrustBytes, alpha });

Run OS native

cargo run ./example/localtrust.csv ./example/pretrust2.csv

Build

cargo build --release
./target/release/eigentrust-rs ./tmp/trust-db.csv ./tmp/seed-db.csv

About

A Rust implementation of the EigenTrust algorithm for managing reputation in decentralized networks. This project is designed to run in both native environments and the browser via WebAssembly.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors