orao-network / solana-vrf Goto Github PK
View Code? Open in Web Editor NEWSDK for verifiable randomness function (VRF / RNG) on Solana
Home Page: https://orao.network/solana-vrf
License: Apache License 2.0
SDK for verifiable randomness function (VRF / RNG) on Solana
Home Page: https://orao.network/solana-vrf
License: Apache License 2.0
getting this error could this be because the solana chain is congested?
node:internal/deps/undici/undici:12344
Error.captureStackTrace(err, this);
^
TypeError: fetch failed
at node:internal/deps/undici/undici:12344:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at ClientBrowser.callServer (/home/kasuba97/lab-vrf/node_modules/.pnpm/@[email protected]/node_modules/@solana/web3.js/src/connection.ts:1625:17) {
cause: ConnectTimeoutError: Connect Timeout Error
at onConnectTimeout (node:internal/deps/undici/undici:7492:28)
at node:internal/deps/undici/undici:7448:50
at Immediate._onImmediate (node:internal/deps/undici/undici:7480:13)
at process.processImmediate (node:internal/timers:478:21) {
code: 'UND_ERR_CONNECT_TIMEOUT'
hey guys @great9 @orao-dev1 do you know which projects are currently using this SDK? or any examples/visual tutorials I can see? thanks in advance!
When I import js library via npm in my nextjs app, I got an error.
./node_modules/@orao-network/solana-vrf/dist/index.js:18:0
Module not found: Can't resolve 'tweetnacl'
` const vrf = new Orao(provider);
let force = Buffer.from(Keypair.generate().publicKey.toBuffer());
const [seed, tx] = await (await vrf.request(force)).rpc()
const randomness = await vrf.waitFulfilled(force);
console.log("Your randomness is " + randomness.fulfilled());`
I tried to get random number but the error says
Error: Account does not exist or has no data
So, I tried to change the commitment of vrf.waitFulfilled(force); to confirmed but it doesn't respond for hours.
Hi!
I deployed the program to my own program_id,
but when I'm trying to play using the CLI I'm getting an Error,
state command is working well.
how to solve it?
Thanks.
Command:
cargo run -q --package roulette-cli -- play
Output:
Loading a bullet and spinning the cylinder..
Error: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1004 [4 log messages]
Caused by:
0: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1004 [4 log messages]
1: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1004 [4 log messages]
Expected Output:
-- Using RPC https://api.devnet.solana.com, keypair <PATH_TO_MY_KEYPAIR> -- ------
Loading a bullet and spinning the cylinder..
Waiting for the round to finish..
CLICK! Player <MY_PUBLIC_KEY> is alive after 1 round(s)
Command:
cargo run -q --package roulette-cli -- state
Output == Expected Output:
-- Using RPC https://api.devnet.solana.com, keypair <PATH_TO_MY_KEYPAIR> -- ------
Player <MY_PUBLIC_KEY> has never played
Version: orao-network/solana-vrf 0.2.1
The orao vrf documentation states that randomAcc.fulfilled()
returns the randomness if fulfilled
`
var randomAcc = undefined;
try {
randomAcc = await vrf.getRandomness(gen_seed.publicKey.toBytes());
console.log(randomAcc);
} catch (err) {
toast.notify(`${err.message}`, { type: "error" });
}
var randomness = randomAcc.fulfilled();
if (randomness === null) {
console.log("Randomness is not yet fulfilled " + i);
} else {
console.log("Randomness is " + randomness);
return;
}`
i keep receiving the following error indicating the 'fulfilled()' function. Error says TypeError: Argument must be a Buffer
I mention that when executing tests on the anchor env it works. But in this case i have a nextjs + react app
The program works fine on local host but as soon as I switch to Devnet the tests fail.
I’ve spent hours looking through the code to find a solution but my only guess is that it’s something to do with the before block in the tests file.
Have you got any ideas on how to fix this?
ZKVerse is one of our latest client using out vrf on solana. We've made some bts upgrades to lower the randomness fulfillment time.
Hi , when I request for randomness , this error Error: Account does not exist <"some address"> after fee debit from my account.
Please help , as this is happening on mainnet
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.