// This outside React, at index.jsx
window.gunData = {};
// This elsewhere, try to not use useEffect !
gun.get("emails").on( (data)=>{
// key could be some id inside data, or just replace the entire object
window.gunData[key] = data;
})
ingest.sentry.io
was down. It's a data tracker for marketing! https://confection.io/trackers/ingest-sentry-io/. If you use Nord VPN, I strongly suggest considering another VPN. But, this led me to realize that using device/machine ID for Gunsafe encryption might not be the best approach. Notice in the link that some browsers will allow trackers to consume your device/machine ID. @bmatusiak What are your thoughts about this? I know you have a hardware based solution, but that won't be viable for my API.
Hey guys! Yesterday I've started building my gift economy section for the @gun-vue project. And got the screen recording shared for those, who would like to see some Vite + Vue 3 + Gun + WindiCSS + Pug web development process. It may be boring and not too professional, but may be useful for those who just start building web apps.
My idea is to make a decentralized donations platform so users can propose some gifts to other users, which they can approve or reject. The actual transaction should be somewhere in the middle. I build this as a piece of a greater public project funding platform.
If you don't have 4 hours to watch that, here's the SEA design I've came up with.
So we can iterate over the list of all gifts reading the 'from' and 'to' fields to check if they are signed by the users and filter them out. Or we can just get a list of gifts for any user just by looking and their user/gifts lists of hashes. And once I get the projects section working, the projects will index the linked gifts hashes too, so we won't need to parse the main ever growing #gifts list, only for some stats maybe.
@amark Is this as a viable GUN data structure for the purpose?
keypair(machineID, [ hardwarekey(machineid) , someAdditionalData ]
using the user interaction option
so it can be used in something like a raspberry pi. hardware keys can be duplicated also for running multi Pi systems
fs
?
import React , {useState} from 'react'
import Gun from 'gun'
const gun = Gun()
const messages = gun.get('messages')
function App() {
const [message, setMessage] = useState('')
const addMessage = e => {
e.preventDefault()
gun.put({message: message})
}
return (
<>
<h1>ToDo</h1>
<form onSubmit = {addMessage}>
<input type="text" onChange={(e) => setMessage(e.target.value)} />
<button type = 'submit'>Add</button>
</form>
{
messages.map(m => {
<p>{m.message}</p>
})
}
</>
)
}
export default App